Skip to content

Conversation

@vincz777
Copy link

When starting the CouchbaseContainer sometimes this error occurs:

Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:563)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:354)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 8 more
Caused by: java.lang.IllegalStateException: Could not create primary index for bucket default-bucket: Response{protocol=http/1.1, code=500, message=Internal Server Error, url=http://localhost:33753/query/service}, body={
"requestID": "efb1e253-78dc-477e-841f-d74e1ad4a6d2",
"signature": null,
"results": [
],
"errors": [{"code":5000,"msg":"GSI CreatePrimaryIndex() - cause: Index creation for index #primary, bucket default-bucket, scope _default, collection _default cannot start. Reason: Create index or Alter replica cannot proceed due to rebalance in progress..","reason":{"_level":"exception","caller":"secondary_index:413","cause":{"error":"Index creation for index #primary, bucket default-bucket, scope _default, collection _default cannot start.","reason":"Create index or Alter replica cannot proceed due to rebalance in progress..","source":"CreatePrimaryIndex()"},"code":4350,"icause":"Index creation for index #primary, bucket default-bucket, scope _default, collection _default cannot start. Reason: Create index or Alter replica cannot proceed due to rebalance in progress..","key":"indexing.error","message":"GSI CreatePrimaryIndex()"}}],
"status": "fatal",
"metrics": {"elapsedTime": "45.456464ms","executionTime": "45.368677ms","resultCount": 0,"resultSize": 0,"serviceLoad": 1,"errorCount": 1}
}

Apparently the database is rebalancing, preventing the creation of the primary index.

We propose to make the creation of the primary index retryable, as many other operations occuring during the set-up of the container.

@vincz777 vincz777 requested a review from a team November 13, 2024 10:24
@vincz777
Copy link
Author

Hi @eddumelendez could you please have a look at this PR ? Thanks in advance !

@vincz777
Copy link
Author

Hi @eddumelendez could you please review this PR ? Thanks in advance !

@eddumelendez
Copy link
Member

Hi, thanks for your contribution. I am not sure adding more retries in every call is a good idea. See #7049

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants