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

Compatibility Issue with Spring Data Couchbase and Couchbase Client 3.6.2 #1950

Open
maksutspahi opened this issue Jul 11, 2024 · 3 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@maksutspahi
Copy link

Description:

I previously reported an issue with spring-boot-starter-data-couchbase version 3.3.1 using Couchbase client version 3.6.0, which leads to a NoSuchMethodError exception when used with spring-boot-dependencies version 3.3.1 that specifies Couchbase client version 3.6.2. The Spring Boot team suggested that downgrading the Couchbase client dependency is not a viable solution as it may affect users relying on fixes made in versions 3.6.1 and 3.6.2.

Steps to Reproduce:

  1. Set up a Spring Boot project with spring-boot-starter-data-couchbase version 3.3.1.
  2. Use spring-boot-dependencies version 3.3.1.
  3. Attempt to perform a reactive Couchbase insert operation.
  4. Observe the NoSuchMethodError exception.

Expected Behavior:

Spring Data Couchbase should be compatible with Couchbase client version 3.6.2 to avoid runtime exceptions.

Actual Behavior:

A NoSuchMethodError exception is thrown due to a version mismatch between Spring Data Couchbase and the Couchbase client version specified in spring-boot-dependencies.

Environment:

  • Spring Boot version: 3.3.1
  • Spring Boot Starter Data Couchbase version: 3.3.1 -> uses spring-data-couchbase 5.3.1
  • Couchbase client version: 3.6.2 (as specified by spring-boot-dependencies 3.3.1)

Exception Log:

java.lang.NoSuchMethodError: 'reactor.core.publisher.Mono com.couchbase.client.core.transaction.CoreTransactionAttemptContext.insert(com.couchbase.client.core.io.CollectionIdentifier, java.lang.String, byte[], com.couchbase.client.core.transaction.support.SpanWrapper)'

at org.springframework.data.couchbase.core.ReactiveInsertByIdOperationSupport$ReactiveInsertByIdSupport.lambda$one$2(ReactiveInsertByIdOperationSupport.java:119) ~[spring-data-couchbase-5.3.1.jar!/:5.3.1]

Response from Spring Boot Team:

"Thanks for the report. All that we could do here would be to downgrade to Couchbase Client dependency to 3.6.0. We don't want to do that as users who aren't affected by the problem you have reported may be relying on fixes made in 3.6.1 and 3.6.2. I think the best way to address this would be to update Spring Data Couchbase so that it's compatible with 3.6.2. To that end, please open a Spring Data Couchbase issue." (spring-projects/spring-boot#41445 (comment))

Possible Solution:

Update Spring Data Couchbase to be compatible with Couchbase client version 3.6.2 to resolve this compatibility issue.


Please let me know if any additional information is needed. Thank you for your attention to this matter.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 11, 2024
@mikereiche
Copy link
Collaborator

mikereiche commented Jul 13, 2024

@maksutspahi

I'm not understanding why/how spring-boot-depdendencies version 3.3.1 specifies Couchbase Client version 3.6.2. Why doesn't it just rely on spring-data-couchbase for that? Which has the depdendency of Couchbase Client version 3.6.0.
That is the only version that we build and test with.

@wilkinsona
Copy link
Member

wilkinsona commented Jul 14, 2024

Spring Boot's dependency management includes 3.6.2 as it's the latest patch release of the client. Our goal is to keep third-party dependencies up-to-date so that users can benefit from the latest bug fixes.

Spring Boot includes auto-configuration for both Couchbase (CouchbaseAutoConfiguration) and Spring Data Couchbase (CouchbaseDataAutoConfiguration and CouchbaseReactiveDataAutoConfiguration). This leaves us in a tricky situation as we can either hold bug fixes back from those only using the former or have an incompatibility that affects some users of the latter. Neither's ideal.

I think there are a few options here. In order of preference, they are:

  1. Updates are made to the Couchbase Client and 3.6.3 is released that's backwards compatible with 3.6.1 and 3.6.0
  2. Updates are made to Spring Data Couchbase so that it's compatible with the breaking changes in 3.6.2
  3. Spring Boot downgrades back to 3.6.0

I'd really like to avoid 3 as it just hides the problem rather than solving it. Anyone who is using Spring Data Couchbase and needs to pick up a bug fix that was made in 3.6.2 will potentially be unable to do so due to the incompatibility. Furthermore, any Spring Boot users who's not using Spring Data Couchbase or is not affected by the current incompatibility will then be exposed to bugs that have already been fixed and will have to manually upgrade.

@dnault
Copy link
Contributor

dnault commented Jul 15, 2024

Tracking on the Couchbase SDK side as https://issues.couchbase.com/browse/JVMCBC-1540

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

5 participants