Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Exception on first time startup #146

Open
shurwit opened this issue Feb 23, 2023 · 0 comments
Open

[BUG] Exception on first time startup #146

shurwit opened this issue Feb 23, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@shurwit
Copy link
Collaborator

shurwit commented Feb 23, 2023

Describe the bug
Currently if you run the latest version of this Building Block for the first time you will get the following exception:

notifications/core.queueLogic.lockQueue.func1({0x7fe60af28698?, 0xc000095a40})
	/notifications-app/core/app_queue.go:167 +0x152
notifications/driven/storage.(*Adapter).PerformTransaction.func1({0x13471a8, 0xc000095a40})
	/notifications-app/driven/storage/adapter.go:66 +0x6e
go.mongodb.org/mongo-driver/mongo.(*Client).UseSessionWithOptions(0x1342550?, {0x1342588, 0xc001075e00}, 0xc00003aea0?, 0xc0000ef598)
	/notifications-app/vendor/go.mongodb.org/mongo-driver/mongo/client.go:768 +0x19c
go.mongodb.org/mongo-driver/mongo.(*Client).UseSession(...)
	/notifications-app/vendor/go.mongodb.org/mongo-driver/mongo/client.go:754
notifications/driven/storage.(*Adapter).PerformTransaction(0xc0000a0058?, 0xc001075da0?, 0x0?)
	/notifications-app/driven/storage/adapter.go:59 +0xe5
notifications/core.queueLogic.lockQueue({0xc0000a41c0, {0x134cb08, 0xc0000a0058}, {0x1343900, 0xc0004a81e0}, 0x0, 0xc00106cea0})
	/notifications-app/core/app_queue.go:184 +0x162
notifications/core.queueLogic.processQueue({0xc0000a41c0, {0x134cb08, 0xc0000a0058}, {0x1343900, 0xc0004a81e0}, 0x0, 0xc00106cea0})
	/notifications-app/core/app_queue.go:53 +0x105
notifications/core.queueLogic.start({0xc0000a41c0, {0x134cb08, 0xc0000a0058}, {0x1343900, 0xc0004a81e0}, 0x0, 0xc00106cea0})
	/notifications-app/core/app_queue.go:40 +0xc6
notifications/core.(*Application).Start(0xc000619b00)
	/notifications-app/core/app.go:68 +0xd0
main.main()
	/notifications-app/main.go:146 +0x1305

To Reproduce
Steps to reproduce the behavior:

  1. Run new instance of Notifications BB
  2. See crash on startup

Expected behavior
This is caused by a nil dereference of the message queue since no queue exists. We need to either handle this nil case appropriately or perform the necessary first time setup when the BB starts to ensure that no manual database configuration is necessary.

@shurwit shurwit added the bug Something isn't working label Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant