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

Infinit progress bar loop in contract negotiation due to interrupted process #217

Closed
brunopacheco1 opened this issue Mar 7, 2024 · 3 comments · Fixed by #218
Closed
Labels

Comments

@brunopacheco1
Copy link
Contributor

brunopacheco1 commented Mar 7, 2024

Bug Report

Describe the Bug

Infinit progress bar loop in contract negotiation. That is happening because the contract verification is abruptly terminated, due to policy inequality.

Expected Behavior

Once clicking in Negotiate, few seconds later the contract is agreed and it apears in Contracts.

Observed Behavior

When clicking in Negotiate, the loading bar never stops and every few seconds a request is triggered, but the process never finishes, so no contract is created.

Steps to Reproduce

Steps to reproduce the behavior:

  1. clone and setup eclipse-edc/MinimumViableDataspace and eclipse-edc/DataDashboard.
  2. Execute docker compose -f system-tests/docker-compose.yml up -d --build.
  3. Open Company 1 in the browser: http://localhost:7080/
  4. Go to http://localhost:7080/catalog-browser
  5. Click Negotiate for test-document-2_company3.
  6. See browser Network in developer console.
  7. See docker compose logs.

Context Information

  • eclipse-edc/MinimumViableDataspace at main branch
  • eclipse-edc/DataDashboard at main branch
  • Apple M2 14.3.1
  • Java 17 temurin

Detailed Description

Video screenshot:
https://github.com/eclipse-edc/DataDashboard/assets/4491850/d40f4979-7bc2-4c96-aaaa-4e2d8e833609

Logs:

company3  | DEBUG 2024-03-07T15:30:50.781713329 [PROVIDER] ContractNegotiation 4a5409d7-1959-4df5-be5b-8116ea4ef3c9 is now in state REQUESTED.
company3  | DEBUG 2024-03-07T15:30:51.523723204 [ProviderContractNegotiationManagerImpl] ContractNegotiation 4a5409d7-1959-4df5-be5b-8116ea4ef3c9 is now in state AGREEING
company3  | DEBUG 2024-03-07T15:30:51.524190412 ContractNegotiation: ID 4a5409d7-1959-4df5-be5b-8116ea4ef3c9. [Provider] send agreement
company3  | DEBUG 2024-03-07T15:30:51.554371287 ContractNegotiation: ID 4a5409d7-1959-4df5-be5b-8116ea4ef3c9. [Provider] send agreement
company3  | SEVERE 2024-03-07T15:30:51.557119079 ContractNegotiation: ID 4a5409d7-1959-4df5-be5b-8116ea4ef3c9. Fatal error while [Provider] send agreement. Error details: {"@type":"dspace:ContractNegotiationError","dspace:code":"400","dspace:reason":"Contract agreement received. Validation failed: Policy in the contract agreement is not equal to the one in the contract offer","dspace:processId":"6d5c90a2-df02-4b25-b0c8-71dc8de9e377","@context":{"dct":"https://purl.org/dc/terms/","edc":"https://w3id.org/edc/v0.0.1/ns/","dcat":"https://www.w3.org/ns/dcat/","odrl":"http://www.w3.org/ns/odrl/2/","dspace":"https://w3id.org/dspace/v0.8/"}}
company3  | DEBUG 2024-03-07T15:30:51.557247121 [ProviderContractNegotiationManagerImpl] ContractNegotiation 4a5409d7-1959-4df5-be5b-8116ea4ef3c9 is now in state TERMINATED

Possible Implementation

This is happening because the contract offer'spolicy is different from the asset policy, at line org.eclipse.edc.connector.contract.validation.ContractValidationServiceImpl.117 and org.eclipse.edc.connector.contract.policy.PolicyEquality.35, see the logs above.

The offer that comes from /federatedcatalog contains the correct policy, but some of the ODRL properties are mistyped, thus the parsing from dcat:Dataset into ContractOffer is broken and the process fails, see src/modules/edc-demo/services/catalog-browser.service.ts.60.

@github-actions github-actions bot added the triage label Mar 7, 2024
@brunopacheco1 brunopacheco1 changed the title Loop in contract negotiation due to missing policy permissions Infinit progress bar loop in contract negotiation due to interrupted process Mar 8, 2024
@brunopacheco1
Copy link
Contributor Author

brunopacheco1 commented Mar 8, 2024

@ndr-brt Thanks for the prompt review and merge. I was wondering if this is bug was not hidding another bigger one.

I understood the contract negotiation as a normal handshake between distributed systems. In that sense, I would expect the event TERMINATED should be propagated to all parties. The DataDashboard kept getting REQUESTED, however.

I don't know well enough the archicteture, to judge if this is wrong or not. Is there another channel were I can bring this discussion up?

@ndr-brt
Copy link
Member

ndr-brt commented Mar 8, 2024

@ndr-brt Thanks for the prompt review and merge. I was wondering if this is bug was not hidding another bigger one.

I understood the contract negotiation as a normal handshake between distributed systems. In that sense, I would expect the event TERMINATED should be propagated to all parties. The DataDashboard kept getting VERIFIED, however.

I don't know well enough the archicteture, to judge if this is wrong or not. Is there another channel were I can bring this discussion up?

TERMINATED is a final state that only happens in cases of a canceled negotiation.
please take a look at the specs for details

@brunopacheco1
Copy link
Contributor Author

Great, thanks for sharing this link. If I understood the specification correctly, then the consumer should also get the TERMINATED message back, but by the behavior of DataDashboard, this may not be happening. I will invetigate more be sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants