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: Should throw out error when failed to create index #150

Open
LiilyZhang opened this issue Jul 31, 2024 · 0 comments
Open

Bug: Should throw out error when failed to create index #150

LiilyZhang opened this issue Jul 31, 2024 · 0 comments
Assignees
Labels
bug Something isn't working PR submitted

Comments

@LiilyZhang
Copy link
Contributor

See nil pointer when failed to create index. The code should throw out a defined error

* CSS: 2024/07/30 21:09:22 INFO: CConnecting to mongo...
* CSS: 2024/07/30 21:09:22 INFO: connect to mongo...
* CSS: 2024/07/30 21:09:22 INFO: Connected to mongo...
* CSS: 2024/07/30 21:09:22 INFO: Connected to the database
CSS: 2024/07/30 21:09:22 INFO: Connected to the database
CSS: 2024/07/30 21:09:22 ERROR: Failed to create an index on syncObjects. Error: (Unauthorized) there are no users authenticated
CSS: 2024/07/30 21:09:22 ERROR: Failed to create an index on syncObjects. Error: (Unauthorized) there are no users authenticated
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x14a1057]

goroutine 1 [running]:
github.com/open-horizon/edge-sync-service/core/storage.(*MongoStorage).update.func1(0xc000496840?)
	/tmp/anax-gopath/pkg/mod/github.com/open-horizon/edge-sync-service@v1.11.0/core/storage/mongoStorageHelpers.go:214 +0x97
github.com/open-horizon/edge-sync-service/core/storage.(*MongoStorage).withCollectionHelper(0xc00018ce40, {0x18673a1, 0x12}, 0xc000525a38, 0x0)
	/tmp/anax-gopath/pkg/mod/github.com/open-horizon/edge-sync-service@v1.11.0/core/storage/mongoStorageHelpers.go:532 +0xf2
github.com/open-horizon/edge-sync-service/core/storage.(*MongoStorage).update(0x1698260?, {0x18673a1, 0x12}, {0x1698260?, 0xc0005e2990}, {0x1698260?, 0xc0005e29c0})
	/tmp/anax-gopath/pkg/mod/github.com/open-horizon/edge-sync-service@v1.11.0/core/storage/mongoStorageHelpers.go:221 +0x8f
github.com/open-horizon/edge-sync-service/core/storage.(*MongoStorage).LeaderPeriodicUpdate(0xbd46fe692ca07889?, {0xc0004c6090, 0x24})
	/tmp/anax-gopath/pkg/mod/github.com/open-horizon/edge-sync-service@v1.11.0/core/storage/mongoStorage.go:2045 +0x26e
github.com/open-horizon/edge-sync-service/core/leader.initializeLeadership()
	/tmp/anax-gopath/pkg/mod/github.com/open-horizon/edge-sync-service@v1.11.0/core/leader/leader.go:54 +0x1d7
github.com/open-horizon/edge-sync-service/core/leader.StartLeaderDetermination({0x1b5ac80?, 0xc00018ce40?})
	/tmp/anax-gopath/pkg/mod/github.com/open-horizon/edge-sync-service@v1.11.0/core/leader/leader.go:39 +0x8f
github.com/open-horizon/edge-sync-service/core/base.Start({0x0, 0x0}, 0x15?)
	/tmp/anax-gopath/pkg/mod/github.com/open-horizon/edge-sync-service@v1.11.0/core/base/base.go:122 +0x737
github.com/open-horizon/edge-sync-service/core/base.StandaloneSyncService({0x1b38930?, 0xc0003f6fe8})
	/tmp/anax-gopath/pkg/mod/github.com/open-horizon/edge-sync-service@v1.11.0/core/base/standalone.go:118 +0x5bc
main.main()
	/tmp/anax-gopath/src/github.com/open-horizon/anax/css/cmd/cloud-sync-service/main.go:28 +0x2e
@LiilyZhang LiilyZhang self-assigned this Jul 31, 2024
@LiilyZhang LiilyZhang added bug Something isn't working PR submitted labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR submitted
Projects
None yet
Development

No branches or pull requests

1 participant