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

Embedded persitence is used instead of configured PostgreSQL persistence #3418

Open
LuboTerifaj opened this issue Feb 27, 2024 · 0 comments
Open

Comments

@LuboTerifaj
Copy link
Contributor

Describe the bug

When persistence is enabled in Quarkus project, according to logs, the embedded PostgreSQL database is used regardless of application.properties setting.

Added pom dependencies:

<dependency>
  <groupId>org.kie.kogito</groupId>
  <artifactId>kogito-addons-quarkus-persistence-jdbc</artifactId>
</dependency>

<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>

<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-agroal</artifactId>
</dependency>

application.properties file content:

kogito.persistence.type=jdbc
quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=postgres
quarkus.datasource.password=pass
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres
quarkus.flyway.migrate-at-start=true
kogito.persistence.optimistic.lock=true

See the part of the log:

[WARNING] [io.quarkus.config] Unrecognized configuration key "kogito.data-index.domain-indexing" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
[WARNING] [io.quarkus.config] Unrecognized configuration key "kogito.data-index.blocking" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
[WARNING] [io.quarkus.config] Unrecognized configuration key "kogito.persistence.type" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
[WARNING] [io.quarkus.config] Unrecognized configuration key "kogito.apps.persistence.type" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo

2024-02-27 13:07:45,222 INFO  [io.qua.emb.pos.EmbeddedPostgreSQLRecorder] (Quarkus Main Thread) Embedded Postgres started at port "37313" with database "postgres", user "postgres" and password "postgres"

2024-02-27 13:07:45,565 INFO  [org.fly.cor.int.dat.bas.BaseDatabaseType] (Quarkus Main Thread) Database: jdbc:postgresql://localhost:37313/postgres (PostgreSQL 14.8)

Complete log:

✅ Checking dependencies...
 - Java version check.
 - Maven version check.
🛠️ Starting your Quarkus SonataFlow in dev mode...
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------< org.acme:serverless-workflow-hello-world >--------------
[INFO] Building serverless-workflow-hello-world 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.16.10.Final:dev (default-cli) @ serverless-workflow-hello-world ---
[INFO] Invoking org.apache.maven.plugins:maven-resources-plugin:2.6:resources @ serverless-workflow-hello-world
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Invoking io.quarkus.platform:quarkus-maven-plugin:2.16.10.Final:generate-code @ serverless-workflow-hello-world
[WARNING] K_SINK variable is empty or doesn't exist. Please make sure that this service is a Knative Source or has a SinkBinding bound to it.
[INFO] Invoking org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile @ serverless-workflow-hello-world
[INFO] Nothing to compile - all classes are up to date
[INFO] Invoking org.apache.maven.plugins:maven-resources-plugin:2.6:testResources @ serverless-workflow-hello-world
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/lterifaj/swf-projects/serverless-workflow-hello-world/src/test/resources
[INFO] Invoking io.quarkus.platform:quarkus-maven-plugin:2.16.10.Final:generate-code-tests @ serverless-workflow-hello-world
[WARNING] K_SINK variable is empty or doesn't exist. Please make sure that this service is a Knative Source or has a SinkBinding bound to it.
[INFO] Invoking org.apache.maven.plugins:maven-compiler-plugin:3.10.1:testCompile @ serverless-workflow-hello-world
[INFO] Nothing to compile - all classes are up to date
Listening for transport dt_socket at address: 5005
Press [h] for more options>
Tests paused
Press [r] to resume testing, [h] for more options>
Press [r] to resume testing, [o] Toggle test output, [h] for more options>
2024-02-27 13:07:36,746 WARN  [org.kie.kog.add.qua.kna.eve.KnativeEventingConfigSourceFactory] (main) K_SINK variable is empty or doesn't exist. Please make sure that this service is a Knative Source or has a SinkBinding bound to it.
2024-02-27 13:07:36,924 WARN  [org.kie.kog.add.qua.kna.eve.KnativeEventingConfigSourceFactory] (main) K_SINK variable is empty or doesn't exist. Please make sure that this service is a Knative Source or has a SinkBinding bound to it.
2024-02-27 13:07:37,765 INFO  [org.kie.kog.cod.api.uti.AddonsConfigDiscovery] (build-71) Performed addonsConfig discovery, found: AddonsConfig{usePersistence=true, useTracing=false, useMonitoring=false, usePrometheusMonitoring=false, useCloudEvents=true, useExplainability=false, useProcessSVG=false, useEventDrivenDecisions=false, useEventDrivenRules=false}
2024-02-27 13:07:37,871 INFO  [org.tes.doc.DockerClientProviderStrategy] (build-4) Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
[INFO] Checking for existing resources in: /home/lterifaj/swf-projects/serverless-workflow-hello-world/src/main/kubernetes.
2024-02-27 13:07:38,141 INFO  [org.kie.kog.cod.cor.uti.ApplicationGeneratorDiscovery] (build-54) Generator discovery performed, found [processes]
2024-02-27 13:07:38,544 INFO  [org.tes.doc.DockerClientProviderStrategy] (build-4) Found Docker environment with Environment variables, system properties and defaults. Resolved dockerHost=tcp://192.168.49.2:2376
2024-02-27 13:07:38,545 INFO  [org.tes.DockerClientFactory] (build-4) Docker host IP address is 192.168.49.2
2024-02-27 13:07:38,558 INFO  [org.tes.DockerClientFactory] (build-4) Connected to docker: 
  Server Version: 24.0.7
  API Version: 1.43
  Operating System: Ubuntu 22.04.3 LTS
  Total Memory: 31827 MB
2024-02-27 13:07:38,572 INFO  [org.tes.uti.ImageNameSubstitutor] (build-4) Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2024-02-27 13:07:38,575 INFO  [org.tes.DockerClientFactory] (build-4) Checking the system...
2024-02-27 13:07:38,575 INFO  [org.tes.DockerClientFactory] (build-4) ✔︎ Docker server version should be at least 1.6.0
2024-02-27 13:07:38,577 INFO  [org.kie.kog.qua.wor.dep.AbstractDevServicesProcessor] (build-4) Not starting dev services for Kogito, as Data Index is already present as Quarkus extension.
2024-02-27 13:07:40,195 INFO  [org.dro.drl.qua.uti.dep.DroolsQuarkusResourceUtils] (build-12) No Java source to compile
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2024-02-27 13:07:41,344 WARN  [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "kogito.persistence.optimistic.lock" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2024-02-27 13:07:41,345 WARN  [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "kogito.data-index.blocking" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2024-02-27 13:07:41,345 WARN  [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "kogito.persistence.type" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2024-02-27 13:07:41,345 WARN  [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "kogito.data-index.domain-indexing" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2024-02-27 13:07:41,345 WARN  [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "kogito.apps.persistence.type" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2024-02-27 13:07:41,994 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (Quarkus Main Thread) Detected a Linux x86_64 system
2024-02-27 13:07:42,002 INFO  [io.zon.tes.db.pos.emb.DefaultPostgresBinaryResolver] (Quarkus Main Thread) Detected distribution: 'Fedora Linux'
2024-02-27 13:07:42,004 INFO  [io.zon.tes.db.pos.emb.DefaultPostgresBinaryResolver] (Quarkus Main Thread) System specific postgres binaries found: 'postgres-linux-x86_64.txz'
2024-02-27 13:07:42,061 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (Quarkus Main Thread) Extracting Postgres...
2024-02-27 13:07:44,388 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (Quarkus Main Thread) Postgres binaries at /tmp/embedded-pg/PG-102e6363fced1e91aa3b6178e0d6f3a9
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) The files belonging to this database system will be owned by user "lterifaj".
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) This user must also own the server process.
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) 
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) The database cluster will be initialized with locales
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158))   COLLATE:  en_US.UTF-8
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158))   CTYPE:    en_US.UTF-8
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158))   MESSAGES: en_US.UTF-8
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158))   MONETARY: en_GB.UTF-8
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158))   NUMERIC:  en_GB.UTF-8
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158))   TIME:     en_GB.UTF-8
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) The default text search configuration will be set to "english".
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) 
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) Data page checksums are disabled.
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) 
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) fixing permissions on existing directory /tmp/epg7231620188922794775 ... ok
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) creating subdirectories ... ok
2024-02-27 13:07:44,396 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) selecting dynamic shared memory implementation ... posix
2024-02-27 13:07:44,403 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) selecting default max_connections ... 100
2024-02-27 13:07:44,413 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) selecting default shared_buffers ... 128MB
2024-02-27 13:07:44,420 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) selecting default time zone ... Europe/Prague
2024-02-27 13:07:44,420 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) creating configuration files ... ok
2024-02-27 13:07:44,512 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) running bootstrap script ... ok
2024-02-27 13:07:45,029 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) performing post-bootstrap initialization ... ok
2024-02-27 13:07:45,033 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) syncing data to disk ... ok
2024-02-27 13:07:45,033 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) 
2024-02-27 13:07:45,033 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) Success. You can now start the database server using:
2024-02-27 13:07:45,033 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) 
2024-02-27 13:07:45,033 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158))     /tmp/embedded-pg/PG-102e6363fced1e91aa3b6178e0d6f3a9/bin/pg_ctl -D /tmp/epg7231620188922794775 -l logfile start
2024-02-27 13:07:45,033 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (initdb:pid(3150158)) 
2024-02-27 13:07:45,042 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (Quarkus Main Thread) 38bd1539-3ce8-43ce-ba62-84b6faf530ee initdb completed in 00:00:00.644
2024-02-27 13:07:45,044 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (Quarkus Main Thread) 38bd1539-3ce8-43ce-ba62-84b6faf530ee postmaster started as Process[pid=3150179, exitValue="not exited"] on port 37313.  Waiting up to PT10S for server startup to finish.
2024-02-27 13:07:45,059 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (postgres:pid(3150179)) waiting for server to start....2024-02-27 13:07:45.059 CET [3150182] LOG:  starting PostgreSQL 14.8 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
2024-02-27 13:07:45,059 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (postgres:pid(3150179)) 2024-02-27 13:07:45.059 CET [3150182] LOG:  listening on IPv6 address "::1", port 37313
2024-02-27 13:07:45,059 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (postgres:pid(3150179)) 2024-02-27 13:07:45.059 CET [3150182] LOG:  listening on IPv4 address "127.0.0.1", port 37313
2024-02-27 13:07:45,059 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (postgres:pid(3150179)) 2024-02-27 13:07:45.059 CET [3150182] LOG:  listening on Unix socket "/tmp/.s.PGSQL.37313"
2024-02-27 13:07:45,060 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (postgres:pid(3150179)) 2024-02-27 13:07:45.060 CET [3150183] LOG:  database system was shut down at 2024-02-27 13:07:45 CET
2024-02-27 13:07:45,061 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (postgres:pid(3150179)) 2024-02-27 13:07:45.061 CET [3150182] LOG:  database system is ready to accept connections
2024-02-27 13:07:45,148 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (postgres:pid(3150179))  done
2024-02-27 13:07:45,148 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (postgres:pid(3150179)) server started
2024-02-27 13:07:45,222 INFO  [io.zon.tes.db.pos.emb.EmbeddedPostgres] (Quarkus Main Thread) 38bd1539-3ce8-43ce-ba62-84b6faf530ee postmaster startup finished in 00:00:00.179
2024-02-27 13:07:45,222 INFO  [io.qua.emb.pos.EmbeddedPostgreSQLRecorder] (Quarkus Main Thread) Embedded Postgres started at port "37313" with database "postgres", user "postgres" and password "postgres"
2024-02-27 13:07:45,247 WARN  [org.kie.kog.add.qua.kna.eve.KnativeEventingConfigSourceFactory] (Quarkus Main Thread) K_SINK variable is empty or doesn't exist. Please make sure that this service is a Knative Source or has a SinkBinding bound to it.
2024-02-27 13:07:45,456 WARN  [io.qua.agr.run.AgroalConnectionConfigurer] (Quarkus Main Thread) Agroal does not support detecting if a connection is still usable after an exception for database kind: postgresql
2024-02-27 13:07:45,465 WARN  [io.qua.agr.run.AgroalConnectionConfigurer] (Quarkus Main Thread) Agroal does not support detecting if a connection is still usable after an exception for database kind: postgresql
2024-02-27 13:07:45,534 INFO  [org.fly.cor.int.lic.VersionPrinter] (Quarkus Main Thread) Flyway Community Edition 9.11.0 by Redgate
2024-02-27 13:07:45,534 INFO  [org.fly.cor.int.lic.VersionPrinter] (Quarkus Main Thread) See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#9.11.0
2024-02-27 13:07:45,535 INFO  [org.fly.cor.int.lic.VersionPrinter] (Quarkus Main Thread) 
2024-02-27 13:07:45,565 INFO  [org.fly.cor.int.dat.bas.BaseDatabaseType] (Quarkus Main Thread) Database: jdbc:postgresql://localhost:37313/postgres (PostgreSQL 14.8)
2024-02-27 13:07:45,585 INFO  [org.fly.cor.int.com.DbValidate] (Quarkus Main Thread) Successfully validated 1 migration (execution time 00:00.010s)
2024-02-27 13:07:45,594 INFO  [org.fly.cor.int.sch.JdbcTableSchemaHistory] (Quarkus Main Thread) Creating Schema History table "public"."flyway_schema_history" ...
2024-02-27 13:07:45,615 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Current version of schema "public": << Empty Schema >>
2024-02-27 13:07:45,620 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "1.35.0 - create runtime PostgreSQL"
2024-02-27 13:07:45,633 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Successfully applied 1 migration to schema "public", now at version v1.35.0 (execution time 00:00.020s)
2024-02-27 13:07:46,164 INFO  [org.kie.kog.add.qua.mes.com.QuarkusKogitoExtensionInitializer] (Quarkus Main Thread) Registered Kogito CloudEvent extension
2024-02-27 13:07:46,234 INFO  [io.quarkus] (Quarkus Main Thread) serverless-workflow-hello-world 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.16.10.Final) started in 9.571s. Listening on: http://localhost:8080
2024-02-27 13:07:46,235 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2024-02-27 13:07:46,235 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [agroal, cache, cdi, embedded-postgres, flyway, grpc-server, hibernate-orm, hibernate-orm-panache, jackson-jq, jdbc-postgresql, kogito-addon-knative-eventing-extension, kogito-addon-messaging-extension, kogito-addon-persistence-jdbc-extension, kogito-addon-source-files-extension, kogito-addons-quarkus-data-index-inmemory, kogito-serverless-workflow, kogito-serverless-workflow-devui, kubernetes, narayana-jta, qute, reactive-routes, rest-client, rest-client-jackson, resteasy, resteasy-jackson, resteasy-multipart, security, security-properties-file, servlet, smallrye-context-propagation, smallrye-health, smallrye-openapi, smallrye-reactive-messaging, smallrye-reactive-messaging-http, swagger-ui, vertx, vertx-graphql]

Originally reported by @qb0C80aE

Expected behavior

Configured PostgreSQL database is used.

Actual behavior

Embedded PostgreSQL database is used.

How to Reproduce?

  1. Create Quarkus workflow project
  2. Configure project to include all necessary pom dependencies and application properties.
  3. Build the the project and run the project in dev mode, or deploy it to kubernetes cluster.

For more information see the instructions in https://kiegroup.github.io/kogito-docs/serverlessworkflow/main/persistence/persistence-with-postgresql.html

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Kogito version or git rev (or at least Quarkus version if you are using Kogito via Quarkus platform BOM)

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

The issue is reproducible in various environments. For example:

  • Env1:

    • podman 4.2.0
    • RHEL 8.7
    • java 11
    • Maven 3.8.6
  • Env2:

    • docker 25.0.3
    • Fedora 39
    • OpenJDK 11
    • Maven 3.8.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant