International-Data-Spaces-Association / DataspaceConnector

This is an IDS Connector reference implementation.
Apache License 2.0
32 stars 26 forks source link

Connector error at representation subscription #45

Open jfernandezsqs opened 2 years ago

jfernandezsqs commented 2 years ago

I have deployed two Dataspace Connectors version 7.0.1 and I am testing the subscription process between them (checking artifact, offer and representation subscription). I reach an error at Dataspace connector when trying to subscribe to the representation. This is the Swagger UI call performed.

curl -X 'POST' \
  'https://localhost:7081/api/ids/subscribe?recipient=https%3A%2F%2Fconnectora%3A7080%2Fapi%2Fids%2Fdata' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "IDS Example",
  "description": "Notify on update",
  "target": "https://localhost:7080/api/representations/7a1fb097-9893-408b-8729-3d1985db5f98",
  "location": "https://localhost:7081/api/ids/data",
  "subscriber": "https://localhost:7081",
  "pushData": true
}'

These are the logs obtained from connector B (port 7081):

2022-03-09T14:18:05,391 [https-jsse-nio-7081-exec-10] INFO - Using cached DAPS DAT. [expiration=(2022-03-09T14:25:01.000+0000)]
2022-03-09T14:18:05,399 [https-jsse-nio-7081-exec-10] INFO - Using cached DAPS DAT. [expiration=(2022-03-09T14:25:01.000+0000)]
2022-03-09T14:18:05,414 [https-jsse-nio-7081-exec-10] DEBUG - Built request message. [header=({\n  "@context" : {\n    "ids" : "https://w3id.org/idsa/core/",\n    "idsc" : "https://w3id.org/idsa/code/"\n  },\n  "@type" : "ids:RequestMessage",\n  "@id" : "https://w3id.org/idsa/autogen/requestMessage/f0bb8bd0-6487-42d9-b342-ec0e4bfee144",\n  "ids:modelVersion" : "4.2.6",\n  "ids:issued" : {\n    "@value" : "2022-03-09T14:18:05.403Z",\n    "@type" : "http://www.w3.org/2001/XMLSchema#dateTimeStamp"\n  },\n  "ids:issuerConnector" : {\n    "@id" : "https://connector_B"\n  },\n  "ids:recipientConnector" : [ {\n    "@id" : "https://connectora:7080/api/ids/data"\n  } ],\n  "ids:senderAgent" : {\n    "@id" : "https://connector_B"\n  },\n  "ids:securityToken" : {\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-XtcBHyMVq6PEiu22GqVAhVgcsq4DHwA5ukRe0q9C8fiM72MSezbW6yK6_YKzvjoKKEbD31i3876vA90l1FEnS784DLQOILfig70iY7OLjWvhMLk1yduJFqhQQ0ThaeWexIZDic1TsL16_bn9i0EnDVeLahcRLQ_MGEI7JUcL3zCaI-s_2brFNmnkoxm2rdu8BpkHbHgH9eQp-GVJWMt_HW75yzIRishD_E_QvRV9wmfAANg",\n    "ids:tokenFormat" : {\n      "@id" : "https://w3id.org/idsa/code/JWT"\n    }\n  },\n  "ids:target" : {\n    "@id" : "https://localhost:7080/api/representations/7a1fb097-9893-408b-8729-3d1985db5f98"\n  }\n}), payload=({"title":"IDS Example","description":"Notify on update","target":"https://localhost:7080/api/representations/7a1fb097-9893-408b-8729-3d1985db5f98","location":"https://localhost:7081/api/ids/data","subscriber":"https://localhost:7081","pushData":true,"idsProtocol":false})]
2022-03-09T14:18:05,418 [https-jsse-nio-7081-exec-10] INFO - Sending request to https://connectora:7080/api/ids/data ...
2022-03-09T14:18:05,529 [https-jsse-nio-7081-exec-10] INFO - Successfully received response to request.
2022-03-09T14:18:05,535 [https-jsse-nio-7081-exec-10] INFO - Successfully passed SHACL-Validation.
2022-03-09T14:18:05,587 [https-jsse-nio-7081-exec-10] DEBUG - Received unexpected response message. [response=({reason=https://w3id.org/idsa/code/INTERNAL_RECIPIENT_ERROR, payload=Could not process request., type=class de.fraunhofer.iais.eis.RejectionMessageImpl})]

These are the logs obtained from connector A (port 7080): ConnectorA_logs.docx

I have done the same for offer and artifact subscriptions and in that cases I had no error.

{
    "_embedded": {
        "subscriptions": [
            {
                "creationDate": "2022-03-09T14:26:57.150+0000",
                "modificationDate": "2022-03-09T14:26:57.150+0000",
                "title": "",
                "description": "",
                "target": "https://localhost:7080/api/offers/2cb29f2f-4bd4-4be8-a4c9-069510210328",
                "location": "https://localhost:7081/api/ids/data",
                "subscriber": "https://connector_B",
                "pushData": true,
                "idsProtocol": true,
                "additional": {},
                "_links": {
                    "self": {
                        "href": "https://localhost:7080/api/subscriptions/e0e22d34-79c9-4c46-83b9-c4825a51c019"
                    }
                }
            },
            {
                "creationDate": "2022-03-09T14:27:00.843+0000",
                "modificationDate": "2022-03-09T14:27:00.843+0000",
                "title": "",
                "description": "",
                "target": "https://localhost:7080/api/artifacts/48b305ff-4692-4a08-956a-a74e29978d26",
                "location": "https://localhost:7081/api/ids/data",
                "subscriber": "https://connector_B",
                "pushData": true,
                "idsProtocol": true,
                "additional": {},
                "_links": {
                    "self": {
                        "href": "https://localhost:7080/api/subscriptions/0ff304c3-2ee8-4298-b0b6-69b070cc3d36"
                    }
                }
            }
        ]
    },
    "_links": {
        "self": {
            "href": "https://localhost:7080/api/subscriptions?page=0&size=30"
        }
    },
    "page": {
        "size": 30,
        "totalElements": 2,
        "totalPages": 1,
        "number": 0
    }
}

With the unsubscribe I am having the same error with the representation subscription/unsubscription POST /api/ids/subscribe POST /api/ids/unsubscribe

SebastianOpriel commented 2 years ago

Thanks for this bug report. I remember to face some related issues a couple of months ago and helped myself using subscription of artifacts. We will have to investigate this issue in detail.