Skip to content

Cannot migrate from version 0.0.7 to 0.0.8/0.0.9 #97

Description

@BlackRose01

Describe the bug

Currently we are running the dim wallet on version 0.0.7 and we would like to upgrade to version 0.0.8. During the startup phase the wallet tries to upgrade the database but it fails. The migration wants to add a column vc_id in the table holder_credential_as_jwt but fails while the column requires NOT NULL but there are already values in the table. I also tried to add the column by myself with NULL option but then the migration throws the error that the column already exists.

Currently I only tried to upgrade the dim wallet itself but not the umbrella chart.

To Reproduce

Steps to reproduce the behavior:

  1. Edit the currently running Deployment kubectl edit deployment ssi-dim-wallet-stub-6f666775f6-t7sgw -n umbrella
  2. Restart the rollout kubectl edit deployment.apps/ssi-dim-wallet-stub -n umbrella

Expected behavior

The migration should run successfully and should work with already existing data.

Screenshots/Error Messages

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.4.5)

2026-02-21T10:47:16.221Z  INFO 1 --- [SSI DIM Wallet stub] [           main] o.e.t.w.s.r.p.WalletStubApplication      : Starting WalletStubApplication using Java 21.0.9 with PID 1 (/app/wallet.jar started by wallet in /app)
2026-02-21T10:47:16.223Z DEBUG 1 --- [SSI DIM Wallet stub] [           main] o.e.t.w.s.r.p.WalletStubApplication      : Running with Spring Boot v3.4.5, Spring v6.2.6
2026-02-21T10:47:16.223Z  INFO 1 --- [SSI DIM Wallet stub] [           main] o.e.t.w.s.r.p.WalletStubApplication      : No active profile set, falling back to 1 default profile: "default"
2026-02-21T10:47:18.362Z  INFO 1 --- [SSI DIM Wallet stub] [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2026-02-21T10:47:18.471Z  INFO 1 --- [SSI DIM Wallet stub] [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 98 ms. Found 6 JPA repository interfaces.
2026-02-21T10:47:19.775Z  INFO 1 --- [SSI DIM Wallet stub] [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=fe634a8d-5983-3e27-9ecb-6102fe8ec1e3
2026-02-21T10:47:21.480Z  INFO 1 --- [SSI DIM Wallet stub] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8080 (http)
2026-02-21T10:47:21.526Z  INFO 1 --- [SSI DIM Wallet stub] [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2026-02-21T10:47:21.526Z  INFO 1 --- [SSI DIM Wallet stub] [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.40]
2026-02-21T10:47:21.726Z  INFO 1 --- [SSI DIM Wallet stub] [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2026-02-21T10:47:21.727Z  INFO 1 --- [SSI DIM Wallet stub] [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5368 ms
2026-02-21T10:47:22.919Z  INFO 1 --- [SSI DIM Wallet stub] [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2026-02-21T10:47:23.273Z  INFO 1 --- [SSI DIM Wallet stub] [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection org.postgresql.jdbc.PgConnection@34652065
2026-02-21T10:47:23.275Z  INFO 1 --- [SSI DIM Wallet stub] [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2026-02-21T10:47:23.564Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.database                       : Set default schema name to public
2026-02-21T10:47:24.733Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.changelog                      : Reading from public.databasechangelog
2026-02-21T10:47:24.864Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.lockservice                    : Successfully acquired change log lock
2026-02-21T10:47:24.866Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.command                        : Using deploymentId: 1670844866
2026-02-21T10:47:24.868Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.changelog                      : Reading from public.databasechangelog
2026-02-21T10:47:24.874Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.ui                             : Running Changeset: db/changelog/changes/add_vc_id_in_holder_credential_as_jwt.sql::raw::includeAll
2026-02-21T10:47:24.927Z ERROR 1 --- [SSI DIM Wallet stub] [           main] liquibase.changelog                      : ChangeSet db/changelog/changes/add_vc_id_in_holder_credential_as_jwt.sql::raw::includeAll encountered an exception.

liquibase.exception.DatabaseException: ERROR: column "vc_id" of relation "holder_credential_as_jwt" contains null values [Failed SQL: (0) /*
 * *******************************************************************************
 *  Copyright (c) 2025 Contributors to the Eclipse Foundation
 *
 *  See the NOTICE file(s) distributed with this work for additional
 *  information regarding copyright ownership.
 *
 *  This program and the accompanying materials are made available under the
 *  terms of the Apache License, Version 2.0 which is available at
 *  https://www.apache.org/licenses/LICENSE-2.0.
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 *  License for the specific language governing permissions and limitations
 *  under the License.
 *
 *  SPDX-License-Identifier: Apache-2.0
 * ******************************************************************************
 */

--liquibase formatted sql

--changeset nitin-vavdiya:1
ALTER TABLE holder_credential_as_jwt ADD COLUMN vc_id VARCHAR NOT NULL;
--rollback ALTER TABLE holder_credential_as_jwt DROP COLUMN vc_id;]
	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:497) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:83) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:185) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.executor.AbstractExecutor.execute(AbstractExecutor.java:141) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1189) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:776) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.changelog.visitor.UpdateVisitor.executeAcceptedChange(UpdateVisitor.java:126) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:70) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.changelog.ChangeLogIterator.lambda$run$0(ChangeLogIterator.java:131) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.lambda$child$0(Scope.java:191) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:200) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:190) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:169) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.changelog.ChangeLogIterator.lambda$run$1(ChangeLogIterator.java:120) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.lambda$child$0(Scope.java:191) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:200) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:190) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:169) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:257) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:261) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:89) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.command.core.AbstractUpdateCommandStep.lambda$run$0(AbstractUpdateCommandStep.java:114) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.lambda$child$0(Scope.java:191) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:200) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:190) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:169) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.command.core.AbstractUpdateCommandStep.run(AbstractUpdateCommandStep.java:112) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.command.core.UpdateCommandStep.run(UpdateCommandStep.java:105) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.command.CommandScope.execute(CommandScope.java:220) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Liquibase.lambda$update$0(Liquibase.java:216) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.lambda$child$0(Scope.java:191) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:200) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:190) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:169) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Liquibase.runInScope(Liquibase.java:1329) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Liquibase.update(Liquibase.java:205) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Liquibase.update(Liquibase.java:188) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:305) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.integration.spring.SpringLiquibase.lambda$afterPropertiesSet$0(SpringLiquibase.java:257) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.lambda$child$0(Scope.java:191) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:200) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:190) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:169) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.Scope.child(Scope.java:257) ~[liquibase-core-4.29.2.jar!/:na]
	at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:250) ~[liquibase-core-4.29.2.jar!/:na]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1865) ~[spring-beans-6.2.6.jar!/:6.2.6]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1814) ~[spring-beans-6.2.6.jar!/:6.2.6]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:607) ~[spring-beans-6.2.6.jar!/:6.2.6]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:529) ~[spring-beans-6.2.6.jar!/:6.2.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:339) ~[spring-beans-6.2.6.jar!/:6.2.6]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:371) ~[spring-beans-6.2.6.jar!/:6.2.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337) ~[spring-beans-6.2.6.jar!/:6.2.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-6.2.6.jar!/:6.2.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-6.2.6.jar!/:6.2.6]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207) ~[spring-beans-6.2.6.jar!/:6.2.6]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:970) ~[spring-context-6.2.6.jar!/:6.2.6]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627) ~[spring-context-6.2.6.jar!/:6.2.6]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.4.5.jar!/:3.4.5]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:753) ~[spring-boot-3.4.5.jar!/:3.4.5]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) ~[spring-boot-3.4.5.jar!/:3.4.5]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:318) ~[spring-boot-3.4.5.jar!/:3.4.5]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1362) ~[spring-boot-3.4.5.jar!/:3.4.5]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1351) ~[spring-boot-3.4.5.jar!/:3.4.5]
	at org.eclipse.tractusx.wallet.stub.runtime.postgresql.WalletStubApplication.main(WalletStubApplication.java:57) ~[!/:]
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
	at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:102) ~[wallet.jar:]
	at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:64) ~[wallet.jar:]
	at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:40) ~[wallet.jar:]
Caused by: org.postgresql.util.PSQLException: ERROR: column "vc_id" of relation "holder_credential_as_jwt" contains null values
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2733) ~[postgresql-42.7.5.jar!/:42.7.5]
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2420) ~[postgresql-42.7.5.jar!/:42.7.5]
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372) ~[postgresql-42.7.5.jar!/:42.7.5]
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:517) ~[postgresql-42.7.5.jar!/:42.7.5]
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:434) ~[postgresql-42.7.5.jar!/:42.7.5]
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:356) ~[postgresql-42.7.5.jar!/:42.7.5]
	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:341) ~[postgresql-42.7.5.jar!/:42.7.5]
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:317) ~[postgresql-42.7.5.jar!/:42.7.5]
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:312) ~[postgresql-42.7.5.jar!/:42.7.5]
	at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94) ~[HikariCP-5.1.0.jar!/:na]
	at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-5.1.0.jar!/:na]
	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:491) ~[liquibase-core-4.29.2.jar!/:na]
	... 68 common frames omitted

2026-02-21T10:47:24.937Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.util                           : UPDATE SUMMARY
2026-02-21T10:47:24.937Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.util                           : Run:                          0
2026-02-21T10:47:24.937Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.util                           : Previously run:               1
2026-02-21T10:47:24.937Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.util                           : Filtered out:                 0
2026-02-21T10:47:24.937Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.util                           : -------------------------------
2026-02-21T10:47:24.937Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.util                           : Total change sets:            3
2026-02-21T10:47:24.959Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.util                           : Update summary generated
2026-02-21T10:47:24.961Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.command                        : Update command encountered an exception.
2026-02-21T10:47:24.964Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.lockservice                    : Successfully released change log lock
2026-02-21T10:47:24.965Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.command                        : Logging exception.
2026-02-21T10:47:24.965Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.ui                             : ERROR: Exception Details
2026-02-21T10:47:24.965Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.ui                             : ERROR: Exception Primary Class:  PSQLException
2026-02-21T10:47:24.965Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.ui                             : ERROR: Exception Primary Reason:  ERROR: column "vc_id" of relation "holder_credential_as_jwt" contains null values
2026-02-21T10:47:24.965Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.ui                             : ERROR: Exception Primary Source:  PostgreSQL 15.4
2026-02-21T10:47:24.966Z  INFO 1 --- [SSI DIM Wallet stub] [           main] liquibase.command                        : Command execution complete
2026-02-21T10:47:24.967Z  WARN 1 --- [SSI DIM Wallet stub] [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Failed to initialize dependency 'liquibase' of LoadTimeWeaverAware bean 'entityManagerFactory': Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for changeset db/changelog/changes/add_vc_id_in_holder_credential_as_jwt.sql::raw::includeAll:
     Reason: liquibase.exception.DatabaseException: ERROR: column "vc_id" of relation "holder_credential_as_jwt" contains null values [Failed SQL: (0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions