[GODRIVER-1440] Panic in Mongo Client Creation Created: 14/Dec/19  Updated: 27/Oct/23  Resolved: 16/Dec/19

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Leo Przybylski Assignee: Divjot Arora (Inactive)
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When attempting to execute the following from inside an lgo notebook:

// Set client options
clientOptions := options.Client().ApplyURI("mongodb://localhost:27017")
 
// Connect to MongoDB
client, err := mongo.Connect(context.TODO(), clientOptions)
 
if err != nil {
    log.Fatal(err)
}
 
// Check the connection
err = client.Ping(context.TODO(), nil)
 
if err != nil {
    log.Fatal(err)
}
 
fmt.Println("Connected to MongoDB!")

from https://www.mongodb.com/blog/post/mongodb-go-driver-tutorial

I encounter the following panic:

goroutine 27 [running]:
runtime/debug.Stack(0xc00053bbf0, 0x0, 0x0)
	/usr/local/go/src/runtime/debug/stack.go:24 +0x9f
github.com/yunabe/lgo/core.(*resultCounter).recordResult(0xc0000a6398, 0x7f2593f87020, 0x7f25945945b0)
	/go/src/github.com/yunabe/lgo/core/core.go:95 +0xdd
github.com/yunabe/lgo/core.(*resultCounter).recordResultInDefer(0xc0000a6398)
	/go/src/github.com/yunabe/lgo/core/core.go:100 +0x3b
panic(0x7f2593f87020, 0x7f25945945b0)
	/usr/local/go/src/runtime/panic.go:679 +0x1be
io.ReadAtLeast(0x0, 0x0, 0xc0000a1c50, 0x10, 0x10, 0x10, 0xc00053be28, 0x7f255573dc53, 0x7f2555767f00)
	/usr/local/go/src/io/io.go:310 +0x5a
io.ReadFull(...)
	/usr/local/go/src/io/io.go:329
go.mongodb.org/mongo-driver/x/mongo/driver/uuid.New(0x0, 0x0, 0x1, 0xc0001a8500)
	/go/src/go.mongodb.org/mongo-driver/x/mongo/driver/uuid/uuid.go:24 +0x88
go.mongodb.org/mongo-driver/mongo.NewClient(0xc00053bee0, 0x1, 0x1, 0xc0001a83c0, 0xc000460f74, 0xc000491200)
	/go/src/go.mongodb.org/mongo-driver/mongo/client.go:121 +0x54
github.com/yunabe/lgo/sess7b2274696d65223a313537363330353935303435373532363135347d/exec6.LgoExport_main()
	/go/src/github.com/yunabe/lgo/sess7b2274696d65223a313537363330353935303435373532363135347d/exec6/src.go:13 +0x9c
github.com/yunabe/lgo/sess7b2274696d65223a313537363330353935303435373532363135347d/exec7.lgo_init()
	/go/src/github.com/yunabe/lgo/sess7b2274696d65223a313537363330353935303435373532363135347d/exec7/src.go:7 +0x27
github.com/yunabe/lgo/cmd/runner.loadShared.func3()
	/go/src/github.com/yunabe/lgo/cmd/runner/runner.go:62 +0x26
github.com/yunabe/lgo/core.startExec.func1(0xc0000a6360, 0xc00051f960)
	/go/src/github.com/yunabe/lgo/core/core.go:256 +0xa0
created by github.com/yunabe/lgo/core.startExec
	/go/src/github.com/yunabe/lgo/core/core.go:253 +0xcb
main routine failed



 Comments   
Comment by Divjot Arora (Inactive) [ 16/Dec/19 ]

Hi leonardprzybylski@invisionapp.com,

Given that the stack trace is in the lgo code, not the driver, we recommend filing this as an issue on the lgo repository. The maintainer(s) there would be more helpful and code give some insight as to why this is happening. I don't think there's much here for us to investigate, so I'm closing this issue, but feel free to add a new comment if you have more information and we can re-open if necessary.

 

– Divjot

Comment by Leo Przybylski [ 16/Dec/19 ]

Environment

Go Version

go version go1.13.5 linux/amd64

 

Linux Distribution

Linux c6a655a25aed 5.2.0-kali2-amd64 #1 SMP Debian 5.2.9-2kali1 (2019-08-22) x86_64 GNU/Linux

 

Generated at Thu Feb 08 08:36:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.