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

Force user id to be considered as numeric value when loadData with postgresql and Liquibase #8906

Conversation

avdev4j
Copy link
Contributor

@avdev4j avdev4j commented Nov 30, 2018

  1. Postgres Exception @ users loadData
    In case of postgresql the id is considered as varying value
    instead of numeric. The loadData failed. We have to force the type when load data.
    It seems to be a regression but don't any information about it.

Reason: liquibase.exception.DatabaseException: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO public.jhi_user(id, login, password_hash, first_name, last_name, email, image_url, activated, lang_key, created_by, last_modified_by) VALUES('1', 'system', '$2a$10$mE.qmcV0mFU5NcKh73TZx.z4ueI/.bDWbj0T1BYyqP481kGGarKLG', 'System', 'System', 'system@localhost', '', 'TRUE', 'en', 'system', 'system') was aborted: ERROR: column "id" is of type bigint but expression is of type character varying

  • Travis tests are green
  • Tests are added where necessary
  • Documentation is added/updated where necessary
  • Coding Rules & Commit Guidelines as per our CONTRIBUTING.md document are followed

In case of postgresql the id is considered as varying value
instead of numeric. The loadData failed.
@avdev4j avdev4j changed the title Force user id to be considered as numeric value when loadData wirth postgresql Fix ngx-psql-es-noi18n travis build with spring boot 2.1 Nov 30, 2018
@DanielFran
Copy link
Member

@avdev4j I restarted the specific test to use last commited updates for spring-boot 2.1.1

@avdev4j
Copy link
Contributor Author

avdev4j commented Nov 30, 2018

@DanielFran great !
I need to test if on travis it's work because I have some code (don't know where) that use XContentBuilder.string()Ljava/lang/String; method that doesn't exist anymore.

@DanielFran
Copy link
Member

If it pass the test, I will restart all again, because I commited now to use postgresql 11.1 docker image.

@avdev4j
Copy link
Contributor Author

avdev4j commented Nov 30, 2018

Unfortunately we can reproduce the problem :

An attempt was made to call the method org.elasticsearch.common.xcontent.XContentBuilder.string()Ljava/lang/String; but it does not exist. Its class, org.elasticsearch.common.xcontent.XContentBuilder, is available from the following locations:
jar:file:/home/travis/app/app.war!/WEB-INF/lib/elasticsearch-x-content-6.4.3.jar!/org/elasticsearch/common/xcontent/XContentBuilder.class
It was loaded from the following location:
jar:file:/home/travis/app/app.war!/WEB-INF/lib/elasticsearch-x-content-6.4.3.jar!/
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.elasticsearch.common.xcontent.XContentBuilder

I wonder if it come from spring data jest ❓

@DanielFran
Copy link
Member

At least the liquibase issue is fixed!

@avdev4j
Copy link
Contributor Author

avdev4j commented Nov 30, 2018

And the elasticsearch docker starting too !
If someone know what do mean "-E" parameters in "command" in docker-compose file...

@DanielFran
Copy link
Member

Maybe it is better to update the title just to confirm the issue is fixed for user type in postgre and open an issue in data-jest

@avdev4j
Copy link
Contributor Author

avdev4j commented Nov 30, 2018

That's what I did first but because I commit a modification for elastic docker I changed the title.
I will revert the revet but should I keep my commit for the ES docker image ?

@avdev4j avdev4j changed the title Fix ngx-psql-es-noi18n travis build with spring boot 2.1 Force user id to be considered as numeric value when loadData with postgresql an Liquibase Nov 30, 2018
@avdev4j avdev4j changed the title Force user id to be considered as numeric value when loadData with postgresql an Liquibase Force user id to be considered as numeric value when loadData with postgresql and Liquibase Nov 30, 2018
@DanielFran
Copy link
Member

Yes, revert it! I need to review elastic.yml

@DanielFran
Copy link
Member

DanielFran commented Nov 30, 2018

I pushed a fix to see if it works.... please revert so we can relaunch the tests

@avdev4j avdev4j force-pushed the fix_users_immport_id_varying_postgres branch from bf3ef55 to 89bc7fe Compare November 30, 2018 16:26
@avdev4j
Copy link
Contributor Author

avdev4j commented Nov 30, 2018

Done !
I only keep Liquibase fix

@DanielFran DanielFran merged commit be52b1d into jhipster:spring-boot_2.1.0 Nov 30, 2018
@DanielFran
Copy link
Member

Thanks @avdev4j

@avdev4j
Copy link
Contributor Author

avdev4j commented Nov 30, 2018

You're welcome ;)

@jdubois jdubois added this to the 5.7.1 milestone Dec 14, 2018
@avdev4j avdev4j deleted the fix_users_immport_id_varying_postgres branch February 11, 2019 08:02
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.

3 participants