eclipse-tractusx / tutorial-resources

Apache License 2.0
10 stars 23 forks source link

Unsupported algorithm of PEM-encoded key: EdDSA #378

Closed InRiPa closed 1 week ago

InRiPa commented 2 weeks ago

Hi, I'm trying to get the tutorial working as described here.

Current Behavior

alice-minio-7799dc7cdd-7h2zf                             1/1     Running             0                 2d19h
alice-tractusx-connector-controlplane-595f65ff9f-zztdh   0/1     ImagePullBackOff    12 (2d18h ago)    2d19h
alice-tractusx-connector-dataplane-948c65987-zdpdd       1/1     Running             0                 2d19h
alice-vault-0                                            1/1     Running             0                 2d19h
azurite-7cddb6c555-xb5sr                                 1/1     Running             0                 2d19h
backend-service-98c467cf6-zmkph                          0/1     ErrImageNeverPull   0                 2d19h
bdrs-server-6f46fbfcf6-c5kvf                             1/1     Running             1 (2d19h ago)     2d19h
bdrs-server-vault-0                                      1/1     Running             0                 2d19h
bob-minio-7ff6b56cfc-nrblm                               1/1     Running             0                 2d19h
bob-tractusx-connector-controlplane-58c5c68d4f-z7j6b     0/1     CrashLoopBackOff    782 (3m23s ago)   2d19h
bob-tractusx-connector-dataplane-84bcf85ff7-lrpxt        1/1     Running             0                 2d19h
bob-vault-0                                              1/1     Running             0                 2d19h
common-postgres-5847467f7-z2bqb                          1/1     Running             0                 2d19h
keycloak-f8794dcb8-pm66j                                 1/1     Running             0                 2d19h
miw-5c7fc4cd6b-zv862                                     1/1     Running             0                 2d19h

Expected Behavior

# you should see a list like:
NAME                                                     READY   STATUS    RESTARTS   AGE
alice-tractusx-connector-controlplane-6f7555bcb7-mhxh6   1/1     Running   0          4m
alice-tractusx-connector-dataplane-6db78d69c5-sw87d      1/1     Running   0          4m
alice-vault-0                                            1/1     Running   0          4m
bob-tractusx-connector-controlplane-76ccd79946-84zjw     1/1     Running   0          4m
bob-tractusx-connector-dataplane-85554c7dcd-6pzzs        1/1     Running   0          4m
bob-vault-0                                              1/1     Running   0          4m
keycloak-6bdf4d7689-8mwfd                                1/1     Running   0          4m58s
miw-574bf87bc-c4n6c                                      1/1     Running   0          4m58s
postgres-66677b8665-lxxp2                                1/1     Running   0          5m14s

Additional Information

kubectl logs pods/alice-tractusx-connector-controlplane-595f65ff9f-zztdh

[...]
[2024-07-05 13:17:10] [INFO   ] Schema "public" is up to date. No migration necessary.
INFO 2024-07-05T13:17:10.495786866 Initialized org.eclipse.tractusx.edc.postgresql.migration.BusinessGroupPostgresMigrationExtension
INFO 2024-07-05T13:17:10.50999101 Initialized Commons Connection Pool
INFO 2024-07-05T13:17:10.510237644 Initialized SQL EDR cache store
INFO 2024-07-05T13:17:10.51191067 Initialized SQL Business Partner Store
INFO 2024-07-05T13:17:10.513055001 Initialized Data Encryption Extension
INFO 2024-07-05T13:17:10.514389425 Initialized Transfer Data Plane Default Services
INFO 2024-07-05T13:17:10.514535932 Initialized Data Plane Selector Default Services
INFO 2024-07-05T13:17:10.516503041 Initialized org.eclipse.edc.connector.dataplane.selector.core.DataPlaneSelectorExtension
DEBUG 2024-07-05T13:17:10.517127784 Using embedded DPF selector
INFO 2024-07-05T13:17:10.517317586 Initialized org.eclipse.edc.connector.dataplane.selector.DataPlaneInstanceClientExtension
INFO 2024-07-05T13:17:10.517449132 Initialized Data Plane Client
DEBUG 2024-07-05T13:17:10.517733857 Using remote Data Plane client.
INFO 2024-07-05T13:17:10.518440114 Initialized Control API configuration
INFO 2024-07-05T13:17:10.518726815 Control API will be available under port=8083, path=/control
SEVERE 2024-07-05T13:17:10.647189765 Error booting runtime: Failed to parse private key: Unsupported algorithm of PEM-encoded key: EdDSA
org.eclipse.edc.spi.EdcException: Failed to parse private key: Unsupported algorithm of PEM-encoded key: EdDSA
    at org.eclipse.edc.connector.transfer.dataplane.TransferDataPlaneCoreExtension.lambda$keyPairFromConfig$1(TransferDataPlaneCoreExtension.java:126)
    at org.eclipse.edc.spi.result.AbstractResult.orElseThrow(AbstractResult.java:119)
    at org.eclipse.edc.connector.transfer.dataplane.TransferDataPlaneCoreExtension.keyPairFromConfig(TransferDataPlaneCoreExtension.java:126)
    at org.eclipse.edc.connector.transfer.dataplane.TransferDataPlaneCoreExtension.initialize(TransferDataPlaneCoreExtension.java:106)
    at org.eclipse.edc.boot.system.injection.lifecycle.InitializePhase.initialize(InitializePhase.java:37)
    at org.eclipse.edc.boot.system.injection.lifecycle.ExtensionLifecycleManager.initialize(ExtensionLifecycleManager.java:61)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
    at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
    at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
    at org.eclipse.edc.boot.system.ExtensionLoader.bootServiceExtensions(ExtensionLoader.java:67)
    at org.eclipse.edc.boot.system.runtime.BaseRuntime.bootExtensions(BaseRuntime.java:141)
    at org.eclipse.edc.boot.system.runtime.BaseRuntime.boot(BaseRuntime.java:202)
    at org.eclipse.edc.boot.system.runtime.BaseRuntime.boot(BaseRuntime.java:84)
    at org.eclipse.edc.boot.system.runtime.BaseRuntime.main(BaseRuntime.java:72)

The same error, for Bob and Alice container.

Does anyone know how I can debug, fix this?

Moritz72 commented 1 week ago

From the looks of it you are using an older version of the EDC as the method keyPairFromConfig does not exist in TransferDataPlaneCoreExtension.java from 0.5.0 onwards.

In modules/connector/main.tf there should be

  repository = "https://eclipse-tractusx.github.io/charts/dev"
  chart      = "tractusx-connector"
  version    = "0.6.0"

In your case version is probably "0.5.0" or something like that as I got the same error when testing it with version set to "0.5.0". You need to change it to "0.6.0".

Also, you should probably follow the instructions in the README instead of the ones you linked because a backend service was added which needs additional steps to start properly.

Basically you have to run

./gradlew clean dockerize

from the backend-service folder at the beginning and then after kubectl wait ... you should run

kind load docker-image --name mxd backend-service:1.0.0

Otherwise everything remains the same.

hemantxpatel commented 1 week ago

@Moritz72 , thanks for your comment. @InRiPa you are running old version 0.5.3 as per the tutorial you are following. Please follow the tutorials and README in this repo. MXD has been upgraded to EDC 0.6.x and all the tutorials (request / response schema) have been updated. Feel free to raise an issue if you encounter any issue while running MXD via following our tutorials.

InRiPa commented 1 week ago

Changing the version to 0.6.0 in tutorial-resources/mxd/modules/connector/values.yaml seemed to have fixed it, thanks. Also, I build and pushed the backend-service to a registry. To make it work, I adjusted backend-service.tf (running the example remotely)

container {
    name              = "backend-service"
    image             = "point.to.your.registry.com/project/subproj/backend:1.0.0"
    image_pull_policy = "Always"
   ...
}
# create an additional resource for secret creation of dockrego
image_pull_secrets {                                                                                                                                                                                                                            
    name = "dockrego"
}

In regards to the version, maybe the tutorial page can be updated or rather linked to the README to ease the documentation updating.

In any case, thanks for the help !

hemantxpatel commented 1 week ago

Thanks, we don't own the tutorial you were following, but we will try to raise issue to them to either update the tutorial or provide link to our READMEs.