You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I want to use postgres instead of the default h2 database, using the docker images. This doesn't work however.
First the connection fails since the default jdbc connection resolver returns an invalid url (i.e. jdbc:postgresql://host:port/kapua;schema=public).
After setting the connection resolver to MariaDB, the connection works, but liquibase scripts fails:
15:31:28.807 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - =================== KapuaLiquibaseClient Configuration ===================
15:31:28.807 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - | Liquibase Version: 3.6.3
15:31:28.807 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - | DB connection info
15:31:28.807 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - | JDBC URL: jdbc:postgresql://some.cloud.host:5432/kapua?useTimezone=true&useLegacyDatetimeCode=false&serverTimezone=UTC&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true
15:31:28.807 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - | Username: kapua
15:31:28.807 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - | Password: ******
15:31:28.807 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - | Schema: public
15:31:28.807 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - | Timestamp(3) fix info (eclipse/kapua#2889)
15:31:28.807 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - | Force timestamp fix: false
15:31:28.807 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - | Apply timestamp fix: true
15:31:28.807 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - ==========================================
15:31:28.808 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - Running Liquibase scripts...
15:31:29.415 [main] INFO org.reflections.Reflections - Reflections took 24 ms to scan 14 urls, producing 333 keys and 344 values
15:31:29.504 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - Executing pre master files...
15:31:29.506 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - Master Liquibase files found: 5
15:31:29.508 [main] INFO o.e.k.c.l.KapuaLiquibaseClient - Executing liquibase script: /tmp/kapua-liquibase/changelog-authorization-master.pre.xml...
15:31:31.187 [main] ERROR liquibase.changelog.ChangeSet - Change Set KapuaDB/changelog-authorization-0.2.0.xml::changelog-authorization-domain-0.2.0::eurotech failed. Error: ERROR: syntax error at or near "("
Position: 49 [Failed SQL: CREATE TABLE public.athz_domain (scope_id BIGINT(21) unsigned, id BIGSERIAL NOT NULL, created_on TIMESTAMP(3) WITHOUT TIME ZONE DEFAULT NOW() NOT NULL, created_by BIGINT(21) unsigned NOT NULL, name VARCHAR(255) NOT NULL, "serviceName" VARCHAR(1023) NOT NULL, CONSTRAINT ATHZ_DOMAIN_PKEY PRIMARY KEY (id), UNIQUE (name))]
15:31:31.200 [main] ERROR o.e.k.c.l.KapuaLiquibaseClient - Running Liquibase scripts... ERROR! Error: Migration failed for change set KapuaDB/changelog-authorization-0.2.0.xml::changelog-authorization-domain-0.2.0::eurotech:
Reason: liquibase.exception.DatabaseException: ERROR: syntax error at or near "("
Position: 49 [Failed SQL: CREATE TABLE public.athz_domain (scope_id BIGINT(21) unsigned, id BIGSERIAL NOT NULL, created_on TIMESTAMP(3) WITHOUT TIME ZONE DEFAULT NOW() NOT NULL, created_by BIGINT(21) unsigned NOT NULL, name VARCHAR(255) NOT NULL, "serviceName" VARCHAR(1023) NOT NULL, CONSTRAINT ATHZ_DOMAIN_PKEY PRIMARY KEY (id), UNIQUE (name))]
liquibase.exception.MigrationFailedException: Migration failed for change set KapuaDB/changelog-authorization-0.2.0.xml::changelog-authorization-domain-0.2.0::eurotech:
Reason: liquibase.exception.DatabaseException: ERROR: syntax error at or near "("
Position: 49 [Failed SQL: CREATE TABLE public.athz_domain (scope_id BIGINT(21) unsigned, id BIGSERIAL NOT NULL, created_on TIMESTAMP(3) WITHOUT TIME ZONE DEFAULT NOW() NOT NULL, created_by BIGINT(21) unsigned NOT NULL, name VARCHAR(255) NOT NULL, "serviceName" VARCHAR(1023) NOT NULL, CONSTRAINT ATHZ_DOMAIN_PKEY PRIMARY KEY (id), UNIQUE (name))]
The BIGINT(21) is not supported by postgres
To Reproduce
Add the postgres jdbc driver to the docker image
Configure all commons.db properties (and env variables) for connecting with a postgres database.
For me that is:
Application can't connect with db since the jdbc url is wrong. Set commons.db.jdbcConnectionUrlResolver to MariaDB
Restart application
Expected behavior
Application starts without issues and creates the correct tables
Version of Kapua
1.5.4
Type of deployment
[ ] Docker
[X] Openshift (in its variants)
[ ] Others
Main component affected
[X] Console (in case of console please report info on which browser you encountered the problem)
[X] REST API
[X] Message Broker
[ ] - Others
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
I want to use postgres instead of the default h2 database, using the docker images. This doesn't work however.
First the connection fails since the default jdbc connection resolver returns an invalid url (i.e.
jdbc:postgresql://host:port/kapua;schema=public
).After setting the connection resolver to MariaDB, the connection works, but liquibase scripts fails:
The
BIGINT(21)
is not supported by postgresTo Reproduce
commons.db
properties (and env variables) for connecting with a postgres database.For me that is:
commons.db.jdbcConnectionUrlResolver
toMariaDB
Expected behavior
Application starts without issues and creates the correct tables
Version of Kapua
1.5.4
Type of deployment
[ ] Docker
[X] Openshift (in its variants)
[ ] Others
Main component affected
[X] Console (in case of console please report info on which browser you encountered the problem)
[X] REST API
[X] Message Broker
[ ] - Others
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: