Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

DB migration issues from H2 embedded to postgresql #103

vmaniraj ·

Hi Team,
we have installed postgres (PostgreSQL) 13.14 for Quickbuild migration and created an empty database "qbpoc" .
Also updated hibernate.properties as below and copied the driver files to /plugins/com.pmease.quickbuild.libs folder.

hibernate.dialect=com.pmease.quickbuild.persistence.PostgreSQLDialect
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.connection.url=jdbc:postgresql://localhost:5432/qbpoc
hibernate.connection.username=postgres
hibernate.connection.password=postgres

But we are seeing below exception while running restore.sh script with the backup file. Could you please suggest here.

[qbuser@ip-172-31-37-192 bin]$ ./restore.sh /opt/websphere/backup-poc.zip
openjdk version "17.0.11" 2024-04-16 LTS
OpenJDK Runtime Environment (Red_Hat-17.0.11.0.9-3) (build 17.0.11+9-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.11.0.9-3) (build 17.0.11+9-LTS, mixed mode, sharing)

2024-06-06 11:11:21,578 INFO Cleaning cached plugin libraries...
2024-06-06 11:11:21,629 INFO Cleaning temp directory...
2024-06-06 11:11:21,648 INFO Extracting backup file...
2024-06-06 11:11:21,651 INFO Booting QuickBuild from '/opt/quickbuild/quickbuild-13.0.38'...
2024-06-06 11:11:21,651 INFO Starting framework...
2024-06-06 11:11:21,732 INFO Caching plugin libraries...
2024-06-06 11:11:26,205 INFO Starting QuickBuild server...
2024-06-06 11:11:26,206 INFO Migrating data in directory '/opt/quickbuild/quickbuild-13.0.38/restore'...
2024-06-06 11:11:26,478 INFO Importing data from '/opt/quickbuild/quickbuild-13.0.38/restore'...
2024-06-06 11:11:27,572 INFO Stopping QuickBuild server...
2024-06-06 11:11:27,597 INFO Stopping plugins...
2024-06-06 11:11:27,605 INFO Stopping task scheduler...
2024-06-06 11:11:27,635 INFO QuickBuild server stopped.
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.pmease.quickbuild.Quickbuild.importData(Quickbuild.java:1166)
at com.pmease.quickbuild.bootstrap.Restore$1.execute(Restore.java:51)
at com.pmease.quickbuild.Quickbuild$3.run(Quickbuild.java:872)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.google.inject.ProvisionException: Guice provision errors:

  1. Error in custom provider, java.lang.RuntimeException: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "postgres"
    while locating com.pmease.quickbuild.persistence.SessionFactoryProvider
    at com.pmease.quickbuild.QuickbuildModule.configure(QuickbuildModule.java:36)
    while locating org.hibernate.SessionFactory
    for field at com.pmease.quickbuild.entitymanager.impl.DefaultDataManager.sessionFactory(DefaultDataManager.java:137)
    at com.pmease.quickbuild.entitymanager.impl.DefaultDataManager.class(DefaultDataManager.java:137)
    while locating com.pmease.quickbuild.entitymanager.impl.DefaultDataManager
    while locating com.pmease.quickbuild.entitymanager.DataManager

1 error
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
at com.pmease.quickbuild.Quickbuild.getInstance(Quickbuild.java:1061)
at com.pmease.quickbuild.entitymanager.DataManager. (DataManager.java:67)
... 4 more
Caused by: java.lang.RuntimeException: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "postgres"
at com.pmease.quickbuild.bootstrap.BootstrapUtils.wrapAsUnchecked(BootstrapUtils.java:56)
at com.pmease.quickbuild.util.ExceptionUtils.wrapAsUnchecked(ExceptionUtils.java:82)
at com.pmease.quickbuild.util.DbUtils.getConnection(DbUtils.java:107)
at com.pmease.quickbuild.util.DbUtils.getDataVersion(DbUtils.java:135)
at com.pmease.quickbuild.persistence.SessionFactoryProvider.get(SessionFactoryProvider.java:80)
at com.pmease.quickbuild.persistence.SessionFactoryProvider.get(SessionFactoryProvider.java:36)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:55)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:737)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
... 7 more
Caused by: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "postgres"
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:698)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:207)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:262)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:54)
at org.postgresql.jdbc.PgConnection. (PgConnection.java:273)
at org.postgresql.Driver.makeConnection(Driver.java:446)
at org.postgresql.Driver.connect(Driver.java:298)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:681)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)
at com.pmease.quickbuild.util.DbUtils.getConnection(DbUtils.java:101)
... 29 more
Suppressed: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "postgres"
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:698)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:207)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:271)
... 36 more

Thank you!

  • replies 3
  • views 524
  • stars 0
vmaniraj ·

Hi Team,
I am able to migrate it now after updating few configs in postgres config file (pg_hba.conf).
It seems fine, but could you please suggest if we have any option to validate.

Thank you!

robinshen ADMIN ·

Please backup the database via menu "Administration / Database Backup". If it works, things should be fine.

vmaniraj ·

Hi Robin,
Yeah we extracted from "Administration / Database Backup" only. Thank you for confirming.