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

Upgrade Couchbase support for Spring Boot 2.4 #13770

Closed
wants to merge 35 commits into from
Closed

Upgrade Couchbase support for Spring Boot 2.4 #13770

wants to merge 35 commits into from

Conversation

mraible
Copy link
Contributor

@mraible mraible commented Jan 30, 2021

Fixes #13544.


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@mraible mraible requested a review from mshima January 30, 2021 00:57
Matt Raible added 3 commits January 29, 2021 18:06
Solves CI error:

'dependencies.dependency.version' for com.couchbase.client:encryption:jar is missing. @ line 151, column 21
@mshima
Copy link
Member

mshima commented Jan 30, 2021

ejs problem is fixed.

@mraible
Copy link
Contributor Author

mraible commented Jan 30, 2021

It seems like there's a lot to do to upgrade to Spring Data Couchbase 4.x. I give up and will add a bug bounty to the open issue for this PR.

@mraible
Copy link
Contributor Author

mraible commented Jan 30, 2021

You can use JHipster Daily Builds + the Couchbase job to trigger a build for your branch. If you don't have access, please let me know and I can trigger it for you.

@mshima
Copy link
Member

mshima commented Jan 30, 2021

Couchbase is completely broken, but we should merge to fix ejs template.

@mraible
Copy link
Contributor Author

mraible commented Jan 30, 2021

I merged in @murdos' changes. Testcontainers doesn't seem to like the Docker container.

[ERROR] tech.jhipster.sample.web.rest.errors.ExceptionTranslatorIT  Time elapsed: 0.006 s  <<< ERROR!
java.lang.IllegalStateException:
Failed to verify that image 'couchbase:6.6.1' is a compatible substitute for 'couchbase/server'. This generally means that you are trying to use an image that Testcontainers has not been designed to use. If this is deliberate, and if you are confident that the image is compatible, you should declare compatibility in code using the `asCompatibleSubstituteFor` method. For example:
   DockerImageName myImage = DockerImageName.parse("couchbase:6.6.1").asCompatibleSubstituteFor("couchbase/server");
and then use `myImage` instead.

I tried changing it from couchbase:6.6.1 to couchbase/server in CouchbaseTestContainerExtension, but tests still fail.

[ERROR] Tests run: 341, Failures: 89, Errors: 25, Skipped: 0

@mraible
Copy link
Contributor Author

mraible commented Jan 30, 2021

This seems to fix the issue, but there's still a lot of test failures.

            DockerImageName image = DockerImageName.parse("couchbase:6.6.1").asCompatibleSubstituteFor("couchbase/server");
            couchbase =
                new CouchbaseContainer(image)
                    .withBucket(new BucketDefinition(getBucketName()).withQuota(100))
                    .withCredentials("user", "secret");

@mraible
Copy link
Contributor Author

mraible commented Jan 30, 2021

Down to 9 test failures for the ngx-couchbase project!

[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   UserServiceIT.assertThatNotActivatedUsersWithNotNullActivationKeyCreatedBefore3DaysAreDeleted:144
Expecting actual not to be empty
[ERROR]   UserServiceIT.assertThatUserCanResetPassword:126
Expecting Optional to contain a value but it was empty.
[ERROR]   UserServiceIT.assertThatUserMustExistToResetPassword:72
Expecting Optional to contain a value but it was empty.
[ERROR]   AccountResourceIT.testActivateAccount:380 Status expected:<200> but was:<500>
[ERROR]   AccountResourceIT.testFinishPasswordReset:688 Status expected:<200> but was:<500>
[ERROR]   AccountResourceIT.testRegisterDuplicateLogin:259
Expecting Optional to contain a value but it was empty.
[ERROR]   AccountResourceIT.testSaveExistingEmail:484 Status expected:<400> but was:<200>
[ERROR]   PublicUserResourceIT.getAllPublicUsers:55 Status expected:<200> but was:<500>
[ERROR]   UserResourceIT.updateUserExistingEmail:399 Status expected:<400> but was:<200>
[ERROR] Errors:
[ERROR]   DomainUserDetailsServiceIT.assertThatUserCanBeFoundByEmailIgnoreCase:96 » UsernameNotFound
[INFO]
[ERROR] Tests run: 341, Failures: 9, Errors: 1, Skipped: 0

Time for a bike ride. :)

@mraible
Copy link
Contributor Author

mraible commented Jan 31, 2021

Now we're at 6 failures and 1 error after the last commit that adds @ScanConsistency to UserRepository.

[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   UserServiceIT.assertThatNotActivatedUsersWithNotNullActivationKeyCreatedBefore3DaysAreDeleted:144
Expecting actual not to be empty
[ERROR]   UserServiceIT.assertThatUserCanResetPassword:126
Expecting Optional to contain a value but it was empty.
[ERROR]   AccountResourceIT.testActivateAccount:380 Status expected:<200> but was:<500>
[ERROR]   AccountResourceIT.testFinishPasswordReset:688 Status expected:<200> but was:<500>
[ERROR]   FieldTestPaginationEntityResourceIT.fullUpdateFieldTestPaginationEntityWithPatch:1244
Expecting:
 <"AAAAAAAAAA">
to be equal to:
 <"BBBBBBBBBB">
but was not.
[ERROR]   PublicUserResourceIT.getAllPublicUsers:55 Status expected:<200> but was:<500>
[ERROR] Errors:
[ERROR]   DomainUserDetailsServiceIT.assertThatUserCanBeFoundByEmailIgnoreCase:96 » UsernameNotFound
[INFO]
[ERROR] Tests run: 341, Failures: 6, Errors: 1, Skipped: 0

@mraible
Copy link
Contributor Author

mraible commented Jan 31, 2021

I think if we could configure default consistency for tests, we could fix a lot of these failures. This SO question makes it look like it was possible in previous versions.

@mraible mraible changed the title Attempt to fix Couchbase CI failure Upgrade Couchbase support for Spring Boot 2.4 Feb 4, 2021
@mraible
Copy link
Contributor Author

mraible commented Feb 4, 2021

There's still a lot of tests failing for the reactive implementation of Couchbase:

[ERROR] Failures:
[ERROR]   UserServiceIT.assertThatNotActivatedUsersWithNotNullActivationKeyCreatedBefore3DaysAreDeleted:146
Expecting actual not to be empty
[ERROR]   UserServiceIT.assertThatUserCanResetPassword:125
Expecting Optional to contain a value but it was empty.
[ERROR]   AccountResourceIT.testActivateAccount:458 Status expected:<200 OK> but was:<500 INTERNAL_SERVER_ERROR>
[ERROR]   AccountResourceIT.testFinishPasswordReset:809 Status expected:<200 OK> but was:<500 INTERNAL_SERVER_ERROR>
[ERROR]   EntityWithPaginationAndDTOResourceIT.getAllEntityWithPaginationAndDTOS:145 JSON path "$.[*].id"
Expected: a collection containing "entitywithpaginationanddto__568aa2c1-d996-4edc-8b58-d9661e486ceb"
     but: was empty
[ERROR]   EntityWithServiceClassPaginationAndDTOResourceIT.getAllEntityWithServiceClassPaginationAndDTOS:151 JSON path "$.[*].id"
Expected: a collection containing "entitywithserviceclasspaginationanddto__453a44d5-e765-4996-aba2-9948d354be34"
     but: was empty
[ERROR]   EntityWithServiceImplPaginationAndDTOResourceIT.getAllEntityWithServiceImplPaginationAndDTOS:151 JSON path "$.[*].id"
Expected: a collection containing "entitywithserviceimplpaginationanddto__fddd7d49-74b9-46a3-8fed-79e58cac9465"
     but: was empty
[ERROR]   FieldTestInfiniteScrollEntityResourceIT.getAllFieldTestInfiniteScrollEntities:803 JSON path "$.[*].id"
Expected: a collection containing "fieldtestinfinitescrollentity__a3ffee23-3585-4f00-b6da-9cd8cb163199"
     but: was empty
[ERROR]   FieldTestPaginationEntityResourceIT.getAllFieldTestPaginationEntities:758 JSON path "$.[*].id"
Expected: a collection containing "fieldtestpaginationentity__2699c14f-90db-48e7-9508-6b2cd535dad9"
     but: was empty
[ERROR]   PublicUserResourceIT.getAllPublicUsers:57 Status expected:<200 OK> but was:<500 INTERNAL_SERVER_ERROR>
[ERROR] Errors:
[ERROR]   UserResourceIT.getAllUsers:255 NullPointer

Test run using daily builds: https://github.com/hipster-labs/jhipster-daily-builds/actions/runs/538490717

@mraible
Copy link
Contributor Author

mraible commented Feb 5, 2021

Do we need to set up testcontainers to support utf-8 for PostgreSQL? Error from webflux-psql job:

2021-02-05 16:00:18.036  WARN 3047 --- [tor-tcp-epoll-2] i.r.p.client.ReactorNettyClient          : 
Error: SEVERITY_LOCALIZED=ERROR, SEVERITY_NON_LOCALIZED=ERROR, CODE=22021, MESSAGE=invalid byte 
sequence for encoding "UTF8": 0x00, FILE=mbutils.c, LINE=1597, ROUTINE=report_invalid_encoding
Error:  Tests run: 13, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.163 s <<< FAILURE! - 
in tech.jhipster.sample.web.rest.MapsIdUserProfileWithDTOResourceIT
Error:  tech.jhipster.sample.web.rest.MapsIdUserProfileWithDTOResourceIT.updateMapsIdUserProfileWithDTOMapsIdAssociationWithNewId  Time elapsed: 0.114 s  <<< ERROR!
org.springframework.r2dbc.BadSqlGrammarException: executeMany; bad SQL grammar 
[INSERT INTO jhi_user (login, password_hash, first_name, last_name, email, activated, lang_key, image_url, created_by, created_date, last_modified_date) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)]; 
nested exception is io.r2dbc.postgresql.ExceptionFactory$PostgresqlBadGrammarException: 
[22021] invalid byte sequence for encoding "UTF8": 0x00
Caused by: io.r2dbc.postgresql.ExceptionFactory$PostgresqlBadGrammarException: 
invalid byte sequence for encoding "UTF8": 0x00

@mraible
Copy link
Contributor Author

mraible commented Mar 5, 2021

Closing and reopening to run CI again.

@mraible
Copy link
Contributor Author

mraible commented Mar 5, 2021

I had to re-create this PR because I deleted my fork. See #14184.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Couchbase tests are failing
5 participants