azukaar / Cosmos-Server

☁️ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication, anti-DDOS, anti-bot)
https://cosmos-cloud.io
Other
2.99k stars 108 forks source link

[BUG]: MongoDB - New Install Crash #127

Closed TheBrokenG0d closed 8 months ago

TheBrokenG0d commented 8 months ago

What happened?

When setting up Cosmos on my unraid. I go through the new install process and trying to install the MongoDB results in a hardcrash.

What should have happened?

It should install MongoDB

How to reproduce the bug?

New Install on Unraid. Start NewInstall Process Select to Install MongoDB

Relevant log output

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x22998c5]

goroutine 9 [running]:
go.mongodb.org/mongo-driver/mongo.(*Collection).insert(0x0, {0x35fd0a8?, 0xc00019c000?}, {0xc001358000, 0x17, 0x0?}, {0x0, 0x0, 0x46cc4e?})
        /home/circleci/.go_workspace/pkg/mod/go.mongodb.org/mongo-driver@v1.11.3/mongo/collection.go:246 +0x145
go.mongodb.org/mongo-driver/mongo.(*Collection).InsertMany(0x0?, {0x35fd0a8?, 0xc00019c000?}, {0xc001358000?, 0x0?, 0x0?}, {0x0?, 0x7?, 0x0?})
        /home/circleci/.go_workspace/pkg/mod/go.mongodb.org/mongo-driver@v1.11.3/mongo/collection.go:368 +0x57
github.com/azukaar/cosmos-server/src/utils.WriteToDatabase(0x3193460?, {0xc000ec3c00, 0x17, 0xc001356210?})
        /home/circleci/project/src/utils/db.go:166 +0xd7
github.com/azukaar/cosmos-server/src/utils.flushAllBuffers()
        /home/circleci/project/src/utils/db.go:135 +0x169
github.com/azukaar/cosmos-server/src/utils.InitDBBuffers.func1()
        /home/circleci/project/src/utils/db.go:102 +0x2a
created by github.com/azukaar/cosmos-server/src/utils.InitDBBuffers
        /home/circleci/project/src/utils/db.go:98 +0x25

Other details

No response

System details

Unraid 6.12.4

azukaar commented 8 months ago

Crash fixed in 0.12.1 thanks you, on the other hand you do have an issue preventing Cosmos to reach the database. Did you install from the Unraid marketplace? If yes try with the docker run command instead, the marketplace image is non official