shynuu / free5gc-populate

Populate the user DB of free5GC at startup
Apache License 2.0
0 stars 6 forks source link

error parsing uri #3

Open cuonghut opened 1 year ago

cuonghut commented 1 year ago

Hi Shynuu, thank you for such a great work. Could you help me on the problem that I'm facing. After I edited config.yaml file, add more imsi into the list and run populate but I got the error error parsing uri: scheme must be "mongodb" or "mongodb+srv". Details:

ubuntu@free5gc:~/free5gc-populate$ ./populate --config config.yaml 
2023-01-17T14:29:54Z [PANI][LIB][MonDB] error parsing uri: scheme must be "mongodb" or "mongodb+srv"
panic: (*logrus.Entry) 0xc0003f8ee0

goroutine 1 [running]:
github.com/sirupsen/logrus.Entry.log({0xc0003a3110, 0xc000395bf0, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0}, 0x0, ...}, ...)
    /home/ubuntu/go/pkg/mod/github.com/sirupsen/logrus@v1.7.0/entry.go:255 +0x2de
github.com/sirupsen/logrus.(*Entry).Log(0xc0003a31f0, 0x0, {0xc00019f730?, 0xb21220?, 0xc0002dd901?})
    /home/ubuntu/go/pkg/mod/github.com/sirupsen/logrus@v1.7.0/entry.go:283 +0xa8
github.com/sirupsen/logrus.(*Entry).Panic(0xc00038b980?, {0xc00019f730, 0x1, 0x1})
    /home/ubuntu/go/pkg/mod/github.com/sirupsen/logrus@v1.7.0/entry.go:321 +0x33
github.com/free5gc/MongoDBLibrary.SetMongoDB({0x0, 0x0}, {0x0, 0x0})
    /home/ubuntu/go/pkg/mod/github.com/free5gc/!mongo!d!b!library@v1.0.0/api_mongoDB.go:29 +0x171
github.com/shynuu/free5gc-populate/runtime.Run({0x7ffc75716652?, 0xc0003c0580?})
    /home/ubuntu/free5gc-populate/runtime/init.go:12 +0x70
main.main.func1(0xc0002dd7e0?)
    /home/ubuntu/free5gc-populate/main.go:32 +0x25
github.com/urfave/cli/v2.(*App).RunContext(0xc0003aeb60, {0xe35690?, 0xc0000b2558}, {0xc000094150, 0x3, 0x3})
    /home/ubuntu/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:322 +0x97c
github.com/urfave/cli/v2.(*App).Run(...)
    /home/ubuntu/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224
main.main()
    /home/ubuntu/free5gc-populate/main.go:37 +0x2d6

I use Ubuntu LTS 22.04, MongoDB 6.0.3, free5gc 3.2.1.

louisroyer commented 2 months ago

Hi @cuonghut, if you still have this issue, please first check the value of mongo.url in your config.yaml. It must start with mongodb:// like in the provided example: https://github.com/shynuu/free5gc-populate/blob/main/config.yaml#L4C8-L4C18 If this doesn't solve your issue, please share your config.yaml file.