eclipse-edc / MinimumViableDataspace

Guidance on documentation, scripts and integration steps on using the EDC project results
Apache License 2.0
58 stars 167 forks source link

cannot create contractdefinitions #130

Closed GregorMuenker closed 1 year ago

GregorMuenker commented 1 year ago

Bug Report

Describe the Bug

when setting up the Dataspace locally as desribed in the readme with these commands:

./gradlew build -x test
./gradlew -DuseFsVault="true" :launchers:connector:shadowJar
./gradlew -DuseFsVault="true" :launchers:registrationservice:shadowJar
docker-compose --profile ui -f system-tests/docker-compose.yml up -d --build

contractdefinitions cannot be created in newman, Postman requests or the UI.

Expected Behavior

contractdefinitions should be created by newman automatically and possible to add via request.

Observed Behavior

The Post request sends back a 500 Internal server error and no contractdefinition is created

Steps to Reproduce

Steps to reproduce the behavior:

  1. Set up the Dataspace locally
  2. have a look at the logs of the newman container
  3. send a Post request to http://localhost:9191/api/v1/data/contractdefinitions with a contractdefinition:
    {
    "id": "4a75736e-001d-4364-8bd4-9888490edb56",
    "accessPolicyId": "956e172f-2de1-4501-8881-057a57fd0e69",
    "contractPolicyId": "956e172f-2de1-4501-8881-057a57fd0e69",
        "criteria": [
            {
                "operandLeft": "asset:prop:id",
                "operator": "=",
                "operandRight": "test-document_company1"
            }
        ]
    }
  4. have a look at the logs of container company1 where you can see the error callstack

Context Information

issue first occurred after completely fresh build yesterday morning (08.03.2023) may be correlated to the commit on the ContractDefinitionStore at that time.

Detailed Description

images attached

grafik(3) grafik(2) grafik(1) grafik

wolf4ood commented 1 year ago

Hi @GregorMuenker

i guess it was related on the commit you mention. I think some snapshot build failed and you got this problem. I've tried now and seems resolved since now the snapshot are produced correctly.

Try to refresh your local dependencies and it should fix it.

Let me know if this helps

Thanks

GregorMuenker commented 1 year ago

Hi @wolf4ood

contractdefinitions works as intended again.

but now there are no entries in the federated catalogue.

so calling post on http://localhost:9191/api/v1/data/federatedcatalog results in:

[]

whereas expected was the catalogue of contract offers.

Additionally the company containers show following Error:

DEBUG 2023-03-09T13:05:00.9751156 ExecutionManager: Getting next available crawler
DEBUG 2023-03-09T13:05:00.9754341 Crawler-a2f08c4e-819d-417e-8b38-a2097dfb2d9c: WorkItem acquired
SEVERE 2023-03-09T13:05:00.9758198 org/eclipse/edc/spi/message/MessageContext
DEBUG 2023-03-09T13:05:00.9766414 ExecutionManager: The following work item has errored out. Will re-queue after a small delay: [WorkItem{url='http://company2:8282', protocolName='ids-multipart', errors=[org/eclipse/edc/spi/message/MessageContext]}]
SEVERE 2023-03-09T13:05:00.9782019 ExecutionManager: Unexpected exception happened during in crawler Crawler-a2f08c4e-819d-417e-8b38-a2097dfb2d9c
org.eclipse.edc.spi.EdcException: java.lang.NoClassDefFoundError: org/eclipse/edc/spi/message/MessageContext
        at org.eclipse.edc.catalog.cache.crawler.CatalogCrawler.run(CatalogCrawler.java:79)
        at org.eclipse.edc.catalog.cache.ExecutionManager.doWork(ExecutionManager.java:117)
        at org.eclipse.edc.catalog.cache.ExecutionManager.lambda$executePlan$1(ExecutionManager.java:72)
        at org.eclipse.edc.catalog.spi.model.RecurringExecutionPlan.lambda$catchExceptions$0(RecurringExecutionPlan.java:68)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/edc/spi/message/MessageContext
        at org.eclipse.edc.catalog.cache.query.BatchedRequestFetcher.fetch(BatchedRequestFetcher.java:59)
        at org.eclipse.edc.catalog.cache.query.IdsMultipartNodeQueryAdapter.sendRequest(IdsMultipartNodeQueryAdapter.java:46)
        at org.eclipse.edc.catalog.cache.crawler.CatalogCrawler.run(CatalogCrawler.java:69)
        ... 9 more
INFO 2023-03-09T13:05:00.9799272 ExecutionManager: Run post-execution task
WARNING 2023-03-09T13:05:01.2872017 The /check/* endpoint has been moved under the 'management' context, please update your url accordingly, because this endpoint will be deleted in the next releases
INFO 2023-03-09T13:05:05.9275026 ExecutionManager: Run pre-execution task
INFO 2023-03-09T13:05:05.9276823 ExecutionManager: Run execution
DEBUG 2023-03-09T13:05:05.9451695 Resolving Did Document for did did:web:did-server:company3.
DEBUG 2023-03-09T13:05:05.9501327 Resolving Did Document for did did:web:did-server:company1.
DEBUG 2023-03-09T13:05:05.9561772 Resolving Did Document for did did:web:did-server:company2.
DEBUG 2023-03-09T13:05:05.9628488 ExecutionManager: Loaded 3 work items from storage
DEBUG 2023-03-09T13:05:05.9630041 ExecutionManager: Instantiate crawlers...
DEBUG 2023-03-09T13:05:05.9631561 ExecutionManager: Crawler parallelism is 3, based on config and number of work items
DEBUG 2023-03-09T13:05:05.9634778 ExecutionManager: Getting next available crawler
DEBUG 2023-03-09T13:05:05.9636312 Crawler-5d625800-7fdd-4ad9-9a1d-2abfd462123c: WorkItem acquired
SEVERE 2023-03-09T13:05:05.9639167 org/eclipse/edc/spi/message/MessageContext
DEBUG 2023-03-09T13:05:05.9641093 ExecutionManager: The following work item has errored out. Will re-queue after a small delay: [WorkItem{url='http://company3:8282', protocolName='ids-multipart', errors=[org/eclipse/edc/spi/message/MessageContext]}]
SEVERE 2023-03-09T13:05:05.9647401 ExecutionManager: Unexpected exception happened during in crawler Crawler-5d625800-7fdd-4ad9-9a1d-2abfd462123c
org.eclipse.edc.spi.EdcException: java.lang.NoClassDefFoundError: org/eclipse/edc/spi/message/MessageContext
        at org.eclipse.edc.catalog.cache.crawler.CatalogCrawler.run(CatalogCrawler.java:79)
        at org.eclipse.edc.catalog.cache.ExecutionManager.doWork(ExecutionManager.java:117)
        at org.eclipse.edc.catalog.cache.ExecutionManager.lambda$executePlan$1(ExecutionManager.java:72)
        at org.eclipse.edc.catalog.spi.model.RecurringExecutionPlan.lambda$catchExceptions$0(RecurringExecutionPlan.java:68)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/edc/spi/message/MessageContext
        at org.eclipse.edc.catalog.cache.query.BatchedRequestFetcher.fetch(BatchedRequestFetcher.java:59)
        at org.eclipse.edc.catalog.cache.query.IdsMultipartNodeQueryAdapter.sendRequest(IdsMultipartNodeQueryAdapter.java:46)
        at org.eclipse.edc.catalog.cache.crawler.CatalogCrawler.run(CatalogCrawler.java:69)
        ... 9 more

I can't find any of the classes where the error occured in the Connector repo is there anywhere i could have a look at ?

would be nice if you could confirm this on your side as well. I will also have a look at it on my side :)

Thanks for having a look at it

wolf4ood commented 1 year ago

@GregorMuenker

this other one should be related to this PR

https://github.com/eclipse-edc/Connector/pull/2568

Probably we need to change the federated catalogue accordingly

Thanks

GregorMuenker commented 1 year ago

@wolf4ood

should i leave this issue open and comment on the PR so the contributors are notified about this issue ?

Thanks for the swift answer

wolf4ood commented 1 year ago

@GregorMuenker

yeah we can leave it open and track the catalogue issue also here

Thanks

ndr-brt commented 1 year ago

@GregorMuenker

this other one should be related to this PR

eclipse-edc/Connector#2568

Probably we need to change the federated catalogue accordingly

Thanks

Maybe the MVD should use milestone versions instead of snapshots (that are fragile by definition)?

GregorMuenker commented 1 year ago

@wolf4ood

the original issue is completely resolved now. Thanks for fixing the catalog today. 😄

Using milestone versions instead of snapshots seems be a different/seperate issue that should be opened up.