Tried connecting the cloud database provided by MongoDB in Azure Pune Region.
When tried to connect with mongodb-srv as scheme. I got the following panic message:
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/gin@v1.7.4/context.go:165 (0x7ff71949c681)
(*Context).Next: c.handlers[c.index](c)
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/gin@v1.7.4/recovery.go:99 (0x7ff71949c66c)
CustomRecoveryWithWriter.func1: c.Next()
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/gin@v1.7.4/context.go:165 (0x7ff71949b4fd)
(*Context).Next: c.handlers[c.index](c)
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/gin@v1.7.4/gin.go:489 (0x7ff71949b185)
(*Engine).handleHTTPRequest: c.Next()
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/gin@v1.7.4/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
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