eclipse-tractusx / managed-identity-wallet

Apache License 2.0
9 stars 23 forks source link

[CRITICAL BUG]: Catena-X NG References for schemas makes MIW / EDC not usable #342

Open matbmoser opened 2 months ago

matbmoser commented 2 months ago

Description

I have found a critical bug in the MIW.

We are testing the MIW in the umbrella and we found out after the consortia github has been deleted the references to the schemas are still pointing to the consortia environment!

Look it here: https://github.com/search?q=repo%3Aeclipse-tractusx%2Fmanaged-identity-wallet%20catenax-ng&type=code

All the Catena-X NG references MUST be substituted to the Tractus-X ones. And schemas from Catena-X NG need to be moved to the MIW repo in Tractus-X

This is making the EDC that are compatible with the MIW not to work!

The problem is with this repos:

The problem

This specific file schemas:

Is not available and its required for the "JSON-LD" expantion in the EDC connector, it shall be moved to the repository in Tractus-X, and can also be provided with github pages.

Posible Solutions

My recommendation would be to add a W3C (https://w3id.org/) redirect like we do with the tractus-x policies:

Add in tractus-x profiles: https://github.com/eclipse-tractusx/tractusx-profiles

Or use the ( https://w3id.org/catenax/ -> https://github.com/catenax-eV/w3id.org ) redirect profile

Another solutions would to move it to the MIW repository and link it with the "raw.github" file access point, then it would be linked to a specific version of the MIW and could be changed without affecting passed versions.

Affects

APP Versions
managed-identity-wallet v0.4.0 & v0.5.0 (with the docs links)
tractusx-edc v0.5.x & v0.6.0
tractusx-umbrella umbrella-0.17.0

Linked Issues

JohnnyH666 commented 2 months ago

Hi, Mathias. I’m experiencing the same issue. Have you found a solution? Does that mean changing the word "Catena-X" in the URL to "tractus-X"? If I'm deploying using umbrella, how to fix this issue? Thanks in advance.

matbmoser commented 2 months ago

@JohnnyH666 What I have heard, is that a solution is being worked. I believe the Catena-X NG will come back again up so that we can have it working at least for now. But this needs to be changed in the MIW. At least for the next version!

matbmoser commented 2 months ago

Hi everyone,

A temporary solution was applied to bring up the Catena-X ng repository back! Thanks for all the people involved! Also it was redeployed the github page which contained the schemas: https://catenax-ng.github.io/product-core-schemas/SummaryVC.json

We have tested with the umbrella and it works fine!:

image

Please lets keep this thread open, so we can solve in long term this problem.

If you are still having issues please feel free to add your comment here!

ipa-big commented 2 months ago

I tried to host the schema files:

via a local Webserver. The server is reachable via http://schema-server.tx.test and so i modified the values file accordingly:

managed-identity-wallet:
  enabled: true
  envs:
     VC_SCHEMA_LINK: "https://www.w3.org/2018/credentials/v1, http://schema-server.tx.test/businessPartnerData.json"
     SUMMARY_VC_SCHEMA_LINK: "https://www.w3.org/2018/credentials/v1, http://schema-server.tx.test/SummaryVC.json"

...and replaced all urls "https://raw.githubusercontent.com/catenax-ng/product-core-schemas/main" in the schema file with "http://schema-server.tx.test" (also tried not modifing the files at all). With this setup I always get the error message "com.apicatalog.jsonld.JsonLdError: Imported context is null":

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-08-01T20:59:35.488Z ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'walletController' defined in URL [jar:file:/app/miw-latest.jar!/BOOT-INF/classes!/org/eclipse/tractusx/managedidentitywallets/controller/WalletController.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'walletService': Invocation of init method failed
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1189) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:950) ~[spring-context-6.0.14.jar!/:6.0.14]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:616) ~[spring-context-6.0.14.jar!/:6.0.14]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.1.6.jar!/:3.1.6]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:738) ~[spring-boot-3.1.6.jar!/:3.1.6]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:440) ~[spring-boot-3.1.6.jar!/:3.1.6]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) ~[spring-boot-3.1.6.jar!/:3.1.6]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-3.1.6.jar!/:3.1.6]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-3.1.6.jar!/:3.1.6]
    at org.eclipse.tractusx.managedidentitywallets.ManagedIdentityWalletsApplication.main(ManagedIdentityWalletsApplication.java:43) ~[classes!/:latest]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[miw-latest.jar:latest]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:95) ~[miw-latest.jar:latest]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[miw-latest.jar:latest]
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) ~[miw-latest.jar:latest]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'walletService': Invocation of init method failed
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:222) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:419) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1762) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1417) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:910) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788) ~[spring-beans-6.0.14.jar!/:6.0.14]
    ... 27 common frames omitted
Caused by: java.lang.RuntimeException: JsonLdError[code=No valid context document has been found for a referenced remote context [code=INVALID_REMOTE_CONTEXT]., message=Imported context is null.]
    at org.eclipse.tractusx.ssi.lib.proof.transform.LinkedDataTransformer.toDataset(LinkedDataTransformer.java:94) ~[cx-ssi-lib-0.0.18.jar!/:na]
    at org.eclipse.tractusx.ssi.lib.proof.transform.LinkedDataTransformer.canocliztion(LinkedDataTransformer.java:62) ~[cx-ssi-lib-0.0.18.jar!/:na]
    at org.eclipse.tractusx.ssi.lib.proof.transform.LinkedDataTransformer.transform(LinkedDataTransformer.java:56) ~[cx-ssi-lib-0.0.18.jar!/:na]
    at org.eclipse.tractusx.ssi.lib.proof.LinkedDataProofGenerator.createProof(LinkedDataProofGenerator.java:89) ~[cx-ssi-lib-0.0.18.jar!/:na]
    at org.eclipse.tractusx.managedidentitywallets.utils.CommonUtils.createVerifiableCredential(CommonUtils.java:139) ~[classes!/:latest]
    at org.eclipse.tractusx.managedidentitywallets.utils.CommonUtils.getHoldersCredential(CommonUtils.java:89) ~[classes!/:latest]
    at org.eclipse.tractusx.managedidentitywallets.service.IssuersCredentialService.issueBpnCredential(IssuersCredentialService.java:198) ~[classes!/:latest]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[spring-aop-6.0.14.jar!/:6.0.14]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) ~[spring-aop-6.0.14.jar!/:6.0.14]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-6.0.14.jar!/:6.0.14]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:751) ~[spring-aop-6.0.14.jar!/:6.0.14]
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-6.0.14.jar!/:6.0.14]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:391) ~[spring-tx-6.0.14.jar!/:6.0.14]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-6.0.14.jar!/:6.0.14]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.14.jar!/:6.0.14]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:751) ~[spring-aop-6.0.14.jar!/:6.0.14]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-6.0.14.jar!/:6.0.14]
    at org.eclipse.tractusx.managedidentitywallets.service.IssuersCredentialService$$SpringCGLIB$$0.issueBpnCredential(<generated>) ~[classes!/:latest]
    at org.eclipse.tractusx.managedidentitywallets.service.WalletService.createWallet(WalletService.java:278) ~[classes!/:latest]
    at org.eclipse.tractusx.managedidentitywallets.service.WalletService$1.doInTransactionWithoutResult(WalletService.java:297) ~[classes!/:latest]
    at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:36) ~[spring-tx-6.0.14.jar!/:6.0.14]
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-6.0.14.jar!/:6.0.14]
    at org.eclipse.tractusx.managedidentitywallets.service.WalletService.createAuthorityWallet(WalletService.java:289) ~[classes!/:latest]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMethod.invoke(InitDestroyAnnotationBeanPostProcessor.java:457) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:401) ~[spring-beans-6.0.14.jar!/:6.0.14]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:219) ~[spring-beans-6.0.14.jar!/:6.0.14]
    ... 40 common frames omitted
Caused by: com.apicatalog.jsonld.JsonLdError: Imported context is null.
    at com.apicatalog.jsonld.context.ActiveContextBuilder.fetch(ActiveContextBuilder.java:543) ~[titanium-json-ld-1.3.3.jar!/:na]
    at com.apicatalog.jsonld.context.ActiveContextBuilder.create(ActiveContextBuilder.java:174) ~[titanium-json-ld-1.3.3.jar!/:na]
    at com.apicatalog.jsonld.expansion.ObjectExpansion.initLocalContext(ObjectExpansion.java:200) ~[titanium-json-ld-1.3.3.jar!/:na]
    at com.apicatalog.jsonld.expansion.ObjectExpansion.expand(ObjectExpansion.java:102) ~[titanium-json-ld-1.3.3.jar!/:na]
    at com.apicatalog.jsonld.expansion.Expansion.compute(Expansion.java:119) ~[titanium-json-ld-1.3.3.jar!/:na]
    at com.apicatalog.jsonld.processor.ExpansionProcessor.expand(ExpansionProcessor.java:124) ~[titanium-json-ld-1.3.3.jar!/:na]
    at com.apicatalog.jsonld.processor.ToRdfProcessor.toRdf(ToRdfProcessor.java:69) ~[titanium-json-ld-1.3.3.jar!/:na]
    at com.apicatalog.jsonld.api.ToRdfApi.get(ToRdfApi.java:166) ~[titanium-json-ld-1.3.3.jar!/:na]
    at org.eclipse.tractusx.ssi.lib.proof.transform.LinkedDataTransformer.toDataset(LinkedDataTransformer.java:92) ~[cx-ssi-lib-0.0.18.jar!/:na]
    ... 73 common frames omitted

I also tried the schema files from other repos/forks on github but getting the same error. Is there a reason why the wallet accepts only the schema files provided from

?

ma3u commented 2 months ago

The link to the scheme will be loaded by start of the MIW. It's short-term fixed, because the catenax-bg organization is recovered.

@MiHahnBerlin: Long-term Catena-X should host the product-core-schemas for high load-access.

check-in in Github: https://github.com/catenax-eV

Webserver: automatic upload to a static web server or better CDN

evegufy commented 2 months ago

@matbmoser I'm removing the issue from Tractus-X Open Meetings, as we discussed it in the Office Hour.