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

Migration Fail with RuntimeException #24

Open
2 tasks done
mafasva opened this issue Jul 17, 2024 · 6 comments
Open
2 tasks done

Migration Fail with RuntimeException #24

mafasva opened this issue Jul 17, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@mafasva
Copy link

mafasva commented Jul 17, 2024

Before reporting an issue

  • I have searched existing issues
  • I have reproduced the issue with the latest release

Environment information

  • Migration tool version: next :)
    
  • EHRbase version: 0.32.0
    
  • PostgreSQL version: 16.2
    
  • Java Runtime version: 21
    
  • Operating System version: Docker version 26.0.0
    

Steps to reproduce

We have run the migration tool via docker and docker compose with the follow environment:

    image: ehrbase/migration-tool:next
    networks:
      - num-portal
    environment:
      mode: DB2DB
      spring.datasource.import.url: jdbc:postgresql://postgres:5432/ehrbase2
      spring.datasource.import.username: ehrbase
      spring.datasource.import.password: ehrbase
      spring.datasource.export.url: jdbc:postgresql://postgres:5432/ehrbase
      spring.datasource.export.username: ehrbase
      spring.datasource.export.password: ehrbase
      import.ehrbase-db-user: ehrbase_restricted

the database ehrnase ist the old DB and ehrbase2 is the new one.

Expected behavior

DB is mgrated in ehrbase2 and the ehrbase container is running in version 2.x.xDB is mgrated in ehrbase2 and the ehrbase container is running in version 2.x.x

Actual result

ehrbaseMigration-1  | 2024-07-17T08:27:01.720Z  INFO 1 --- [           main] o.e.migration.service.ProcessService     : Processing ehrs 0 - 99 of 1058
ehrbaseMigration-1  | 2024-07-17T08:27:22.799Z  INFO 1 --- [           main] o.e.migration.service.ProcessService     : Start import of ehrs 0 - 99 of 1058
ehrbaseMigration-1  | 2024-07-17T08:27:28.409Z  INFO 1 --- [           main] o.e.migration.service.ProcessService     : Finished import of ehrs 0 - 99 of 1058
ehrbaseMigration-1  | 2024-07-17T08:27:28.409Z  INFO 1 --- [           main] o.e.migration.service.ProcessService     : Processing ehrs 100 - 199 of 1058
ehrbaseMigration-1  | 2024-07-17T08:27:34.419Z  INFO 1 --- [           main] o.e.migration.service.ProcessService     : Start import of ehrs 100 - 199 of 1058
ehrbaseMigration-1  | 2024-07-17T08:27:34.769Z  INFO 1 --- [           main] .s.b.a.l.ConditionEvaluationReportLogger :
ehrbaseMigration-1  |
ehrbaseMigration-1  | Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
ehrbaseMigration-1  | 2024-07-17T08:27:34.863Z ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed
ehrbaseMigration-1  |
ehrbaseMigration-1  | java.lang.RuntimeException: SQL [insert into "ehr"."ehr_status_data" ("vo_id", "num", "ehr_id", "citem_num", "rm_entity", "entity_concept", "entity_name", "entity_attribute", "entity_path", "entity_path_cap", "entity_idx", "entity_idx_cap", "entity_idx_len", "data") values (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb))]; ERROR: duplicate key value violates unique constraint "ehr_status_subject_idx"
ehrbaseMigration-1  |   Detail: Key ((((((data -> 'su'::text) -> 'er'::text) -> 'X'::text) -> 'V'::text) ->> 0), ((((data -> 'su'::text) -> 'er'::text) -> 'ns'::text) ->> 0))=(10, DEMOGRAPHIC) already exists.
ehrbaseMigration-1  |   at org.ehrbase.migration.importer.v4.ImportService.executeBulkInsert(ImportService.java:52) ~[migration-service-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
ehrbaseMigration-1  |   at org.ehrbase.migration.importer.v4.LocatableImporter.write(LocatableImporter.java:114) ~[migration-service-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
ehrbaseMigration-1  |   at org.ehrbase.migration.importer.v4.EhrSchemaImporter.writeStatus(EhrSchemaImporter.java:74) ~[migration-service-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
ehrbaseMigration-1  |   at org.ehrbase.migration.service.ProcessService.writeData(ProcessService.java:190) ~[migration-service-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
ehrbaseMigration-1  |   at org.ehrbase.migration.service.ProcessService.lambda$db2db$3(ProcessService.java:135) ~[migration-service-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
ehrbaseMigration-1  |   at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.IntPipeline$1$1.accept(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.Spliterator$OfInt.forEachRemaining(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at org.ehrbase.migration.service.ProcessService.lambda$db2db$4(ProcessService.java:133) ~[migration-service-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
ehrbaseMigration-1  |   at java.base/java.util.ArrayList.forEach(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at org.ehrbase.migration.service.ProcessService.db2db(ProcessService.java:122) ~[migration-service-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
ehrbaseMigration-1  |   at org.ehrbase.migration.application.MigrationTool.run(MigrationTool.java:69) ~[classes/:1.3.0-SNAPSHOT]
ehrbaseMigration-1  |   at org.springframework.boot.SpringApplication.lambda$callRunner$5(SpringApplication.java:790) ~[spring-boot-3.2.5.jar:3.2.5]
ehrbaseMigration-1  |   at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:83) ~[spring-core-6.1.6.jar:6.1.6]
ehrbaseMigration-1  |   at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60) ~[spring-core-6.1.6.jar:6.1.6]
ehrbaseMigration-1  |   at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:88) ~[spring-core-6.1.6.jar:6.1.6]
ehrbaseMigration-1  |   at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:798) ~[spring-boot-3.2.5.jar:3.2.5]
ehrbaseMigration-1  |   at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:789) ~[spring-boot-3.2.5.jar:3.2.5]
ehrbaseMigration-1  |   at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:774) ~[spring-boot-3.2.5.jar:3.2.5]
ehrbaseMigration-1  |   at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:774) ~[spring-boot-3.2.5.jar:3.2.5]
ehrbaseMigration-1  |   at org.springframework.boot.SpringApplication.run(SpringApplication.java:341) ~[spring-boot-3.2.5.jar:3.2.5]
ehrbaseMigration-1  |   at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:149) ~[spring-boot-3.2.5.jar:3.2.5]
ehrbaseMigration-1  |   at org.ehrbase.migration.application.MigrationTool.main(MigrationTool.java:62) ~[classes/:1.3.0-SNAPSHOT]
ehrbaseMigration-1  |   at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
ehrbaseMigration-1  |   at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91) ~[workspace/:na]
ehrbaseMigration-1  |   at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53) ~[workspace/:na]
ehrbaseMigration-1  |   at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58) ~[workspace/:na]

Further information

No response

@mafasva mafasva added the bug Something isn't working label Jul 17, 2024
@stefanspiska
Copy link
Contributor

The error means that you have a ehr in your source system which has the same subject as another ehr. (old ehrbase did not check that correctly ).
That means that in

{
	"name": {
		"_type": "DV_TEXT",
		"value": "EHR Status"
	},
	"uid": {
		"_type": "OBJECT_VERSION_ID",
		"value": "c599013e-2f17-4783-af2f-fa549f2eea03::local.ehrbase.org::1"
	},
	"subject": {
		"_type": "PARTY_SELF",
		"external_ref": {
			"_type": "PARTY_REF",
			"namespace": "examples",
			"type": "PERSON",
			"id": {
				"_type": "GENERIC_ID",
				"value": "ins139",
				"scheme": "id_scheme"
			}
		}
	},
	"_type": "EHR_STATUS",
	"archetype_node_id": "openEHR-EHR-EHR_STATUS.generic.v1",
	"is_queryable": false,
	"is_modifiable": true
}

the combination of id.value and id.scheme needs to be unique.

You have to go into you old db and use the query

select status.ehr_id, pi.party_ref_value,party_ref_scheme from ehr.status join ehr.party_identified pi on pi.id = status.party and pi.sys_tenant = status.sys_tenant;

this will give you the ehrs with id.value and id.scheme

then you need to changed the ones which are duplicated.

@mafasva
Copy link
Author

mafasva commented Jul 18, 2024

Mirgation was successful, thank you

@mafasva mafasva closed this as completed Jul 18, 2024
@ujanssen
Copy link

I did the same migration with an other database

\copy (select pi.party_ref_value,party_ref_scheme, COUNT(*) from ehr.status join ehr.party_identified pi on pi.id = status.party and pi.sys_tenant = status.sys_tenant GROUP BY pi.party_ref_value,party_ref_scheme HAVING COUNT(*) > 1) TO STDOUT WITH CSV HEADER;

gives me no output as I deleted all duplicates before.

I got still the same error message with

Detail: Key ((((((data -> 'su'::text) -> 'er'::text) -> 'X'::text) -> 'V'::text) ->> 0), ((((data -> 'su'::text) -> 'er'::text) -> 'ns'::text) ->> 0))=(10, DEMOGRAPHIC) already exists.

@mafasva mafasva reopened this Oct 15, 2024
@vidi42
Copy link
Contributor

vidi42 commented Oct 15, 2024

@ujanssen weird, the error message seems to be the same.

To get the obvious stuff out first, are you migrating into an empty target DB?
Also, can you share some details about the ehrbase version and a stack trace?

Thank you.

@ujanssen
Copy link

the import database is started via docker and I run the command from createdb.sql - so the target db should be empty.
ehrbare version is 0.32.0

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-10-15T11:53:40.999+02:00 ERROR 20427 --- [ main] o.s.boot.SpringApplication : Application run failed

java.lang.RuntimeException: SQL [insert into "ehr"."ehr_status_data" ("vo_id", "num", "ehr_id", "citem_num", "rm_entity", "entity_concept", "entity_name", "entity_attribute", "entity_path", "entity_path_cap", "entity_idx", "entity_idx_cap", "entity_idx_len", "data") values (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb)), (cast(? as uuid), ?, cast(? as uuid), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, cast(? as jsonb))]; ERROR: duplicate key value violates unique constraint "ehr_status_subject_idx"
Detail: Key ((((((data -> 'su'::text) -> 'er'::text) -> 'X'::text) -> 'V'::text) ->> 0), ((((data -> 'su'::text) -> 'er'::text) -> 'ns'::text) ->> 0))=(10, DEMOGRAPHIC) already exists.
at org.ehrbase.migration.importer.v4.ImportService.executeBulkInsert(ImportService.java:52) ~[migration-service-1.3.0-SNAPSHOT.jar!/:1.3.0-SNAPSHOT]
at org.ehrbase.migration.importer.v4.LocatableImporter.write(LocatableImporter.java:114) ~[migration-service-1.3.0-SNAPSHOT.jar!/:1.3.0-SNAPSHOT]
at org.ehrbase.migration.importer.v4.EhrSchemaImporter.writeStatus(EhrSchemaImporter.java:74) ~[migration-service-1.3.0-SNAPSHOT.jar!/:1.3.0-SNAPSHOT]
at org.ehrbase.migration.service.ProcessService.writeData(ProcessService.java:190) ~[migration-service-1.3.0-SNAPSHOT.jar!/:1.3.0-SNAPSHOT]
at org.ehrbase.migration.service.ProcessService.lambda$db2db$3(ProcessService.java:135) ~[migration-service-1.3.0-SNAPSHOT.jar!/:1.3.0-SNAPSHOT]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
at java.base/java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180) ~[na:na]
at java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104) ~[na:na]
at java.base/java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:712) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310) ~[na:na]
at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[na:na]
at org.ehrbase.migration.service.ProcessService.lambda$db2db$4(ProcessService.java:133) ~[migration-service-1.3.0-SNAPSHOT.jar!/:1.3.0-SNAPSHOT]
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596) ~[na:na]
at org.ehrbase.migration.service.ProcessService.db2db(ProcessService.java:122) ~[migration-service-1.3.0-SNAPSHOT.jar!/:1.3.0-SNAPSHOT]
at org.ehrbase.migration.application.MigrationTool.run(MigrationTool.java:81) ~[!/:1.3.0-SNAPSHOT]
at org.springframework.boot.SpringApplication.lambda$callRunner$5(SpringApplication.java:790) ~[spring-boot-3.2.5.jar!/:3.2.5]
at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:83) ~[spring-core-6.1.6.jar!/:6.1.6]
at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60) ~[spring-core-6.1.6.jar!/:6.1.6]
at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:88) ~[spring-core-6.1.6.jar!/:6.1.6]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:798) ~[spring-boot-3.2.5.jar!/:3.2.5]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:789) ~[spring-boot-3.2.5.jar!/:3.2.5]
at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:774) ~[spring-boot-3.2.5.jar!/:3.2.5]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[na:na]
at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[na:na]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:774) ~[spring-boot-3.2.5.jar!/:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:341) ~[spring-boot-3.2.5.jar!/:3.2.5]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:149) ~[spring-boot-3.2.5.jar!/:3.2.5]
at org.ehrbase.migration.application.MigrationTool.main(MigrationTool.java:70) ~[!/:1.3.0-SNAPSHOT]
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91) ~[migration-tool.jar:1.3.0-SNAPSHOT]
at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53) ~[migration-tool.jar:1.3.0-SNAPSHOT]
at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58) ~[migration-tool.jar:1.3.0-SNAPSHOT]

@stefanspiska
Copy link
Contributor

stefanspiska commented Oct 16, 2024

@mafasva

Well then you would need to run not the docker image but checkout the code run it in debug mode and find out which ehrIds this ehr_status with 10, DEMOGRAPHIC uses and why is duplicated.

Maybe set a breakpoint and delete ehr_status_subject_idx and see if it run tough and then you could look into the db.

Sorry for not be more specific but without more info about the data which create the issue I do not have an Idee.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants