Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Panic while connecting to MongoDB Atlas database #58

Open
prashantkhandelwal opened this issue Jan 13, 2023 · 0 comments
Open

Panic while connecting to MongoDB Atlas database #58

prashantkhandelwal opened this issue Jan 13, 2023 · 0 comments
Labels
⚙️ backend backend related issue 🐞 bug Something isn't working 🔥 critical It is a critical issue and need to be fixed asap

Comments

@prashantkhandelwal
Copy link
Contributor

Tried connecting the cloud database provided by MongoDB in Azure Pune Region.

Database Offering: MongoDB Atlas Free Tier
Provider: MongoDB via Azure
Scheme: mongodb-srv

When tried to connect with mongodb-srv as scheme. I got the following panic message:

This error is not produced when the selected scheme is just mongodb

2023/01/13 15:48:31 [Recovery] 2023/01/13 - 15:48:31 panic recovered:
POST /api/v1/dbconnection/create HTTP/1.1
Host: localhost:22022
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en
Connection: keep-alive
Content-Length: 296
Content-Type: text/json
Origin: http://localhost:3000
Referer: http://localhost:3000/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-site
Sec-Gpc: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36


interface conversion: interface {} is int32, not float64
c:/go/src/runtime/iface.go:262 (0x7ff71867bee9)
        panicdottypeE: panic(&TypeAssertionError{iface, have, want, ""})
X:/Github/slashbase/pkg/queryengines/mongoqueryengine/queryengine.go:367 (0x7ff718cce7e4)
        (*MongoQueryEngine).TestConnection: test := data["data"].([]map[string]interface{})[0]["ok"].(float64)
X:/Github/slashbase/pkg/queryengines/queryengines.go:32 (0x7ff71915417c)
        TestConnection: return mongoQueryEngine.TestConnection(dbConn, config)
X:/Github/slashbase/internal/controllers/dbconnection.go:36 (0x7ff7194a7926)
        DBConnectionController.CreateDBConnection: success := queryengines.TestConnection(dbConn.ToQEConnection(), qemodels.NewQueryConfig(false, nil))
X:/Github/slashbase/internal/handlers/dbconnection.go:34 (0x7ff7194abae9)
        DBConnectionHandlers.CreateDBConnection: dbConn, err := dbConnController.CreateDBConnection(createBody.ProjectID, createBody.Name, createBody.Type, createBody.Scheme, createBody.Host, createBody.Port,
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x7ff71949c681)
        (*Context).Next: c.handlers[c.index](c)
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:99 (0x7ff71949c66c)
        CustomRecoveryWithWriter.func1: c.Next()
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x7ff71949b4fd)
        (*Context).Next: c.handlers[c.index](c)
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:489 (0x7ff71949b185)
        (*Engine).handleHTTPRequest: c.Next()
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:445 (0x7ff71949ace4)
        (*Engine).ServeHTTP: engine.handleHTTPRequest(c)
c:/go/src/net/http/server.go:2916 (0x7ff718b7bdfa)
        serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
c:/go/src/net/http/server.go:1966 (0x7ff718b76df6)
        (*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
c:/go/src/runtime/asm_amd64.s:1571 (0x7ff7186d5a60)
        goexit: BYTE    $0x90   // NOP
@paraswaykole paraswaykole added 🐞 bug Something isn't working ⚙️ backend backend related issue labels Jan 13, 2023
@paraswaykole paraswaykole added the 🔥 critical It is a critical issue and need to be fixed asap label Apr 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⚙️ backend backend related issue 🐞 bug Something isn't working 🔥 critical It is a critical issue and need to be fixed asap
Projects
None yet
Development

No branches or pull requests

2 participants