International-Data-Spaces-Association / DataspaceConnectorUI

User interface for the Dataspace Connector.
Apache License 2.0
10 stars 14 forks source link

Not possible to publish large (1 MB) files on the broker #234

Closed ip312 closed 2 years ago

ip312 commented 2 years ago

I wanted to publish a 1 MB large txt file on the MDS Test Broker and got the following error message:

frontend

[1] >>> POST https://localhost:8080/api/offers
[1] >>> DATA:  {
[1]   title: 'File 1 MB',
[1]   description: '-',
[1]   keywords: [ 'LargeFile' ],
[1]   publisher: 'https://mobility-dataspace.eu/',
[1]   language: 'EN',
[1]   paymentMethod: 'free',
[1]   license: 'https://creativecommons.org/licenses/by/4.0/',
[1]   'http://w3id.org/mds#dataModel': 'GTFS',
[1]   'http://w3id.org/mds#dataCategory': 'Public Transport Information',
[1]   'http://w3id.org/mds#transportMode': 'Rail'
[1] }
[1] >>> POST https://localhost:8080/api/catalogs/5e3347d9-ee9d-4a81-883b-9bc4c2437575/offers
[1] >>> DATA:  [ '41602d42-aaec-4633-a988-44c0e7630505' ]
[1] >>> POST https://localhost:8080/api/contracts
[1] >>> DATA:  {
[1]   title: '',
[1]   start: '2022-07-28T00:00:00Z',
[1]   end: '2022-07-31T00:00:00Z'
[1] }
[1] >>> POST https://localhost:8080/api/examples/policy
[1] >>> DATA:  { type: 'PROVIDE_ACCESS' }
[1] >>> POST https://localhost:8080/api/offers/41602d42-aaec-4633-a988-44c0e7630505/contracts
[1] >>> DATA:  [ '07cc5e01-bd8f-4c7f-bd6c-373f832204c7' ]
[1] >>> POST https://localhost:8080/api/representations
[1] >>> DATA:  { language: 'EN', mediaType: 'txt' }
[1] >>> POST https://localhost:8080/api/rules
[1] >>> DATA:  {
[1]   value: '{"@context":{"ids":"https://w3id.org/idsa/core/","idsc":"https://w3id.org/idsa/code/"},"@type":"ids:Permission","@id":"https://w3id.org/idsa/autogen/permission/507aebc9-a6c9-4c18-b61c-28f74d6a0a6e","ids:description":[{"@value":"","@type":"http://www.w3.org/2001/XMLSchema#string"}],"ids:title":[{"@value":"","@type":"http://www.w3.org/2001/XMLSchema#string"}],"ids:action":[{"@id":"https://w3id.org/idsa/code/USE"}]}'
[1] }
[1] PayloadTooLargeError: request entity too large
[1]     at readStream (C:\MDS\MDS_Frontend\src\backend\node_modules\raw-body\index.js:156:17)
[1]     at getRawBody (C:\MDS\MDS_Frontend\src\backend\node_modules\raw-body\index.js:109:12)
[1]     at read (C:\MDS\MDS_Frontend\src\backend\node_modules\body-parser\lib\read.js:79:3)
[1]     at jsonParser (C:\MDS\MDS_Frontend\src\backend\node_modules\body-parser\lib\types\json.js:135:5)
[1]     at Layer.handle [as handle_request] (C:\MDS\MDS_Frontend\src\backend\node_modules\express\lib\router\layer.js:95:5)
[1]     at trim_prefix (C:\MDS\MDS_Frontend\src\backend\node_modules\express\lib\router\index.js:328:13)
[1]     at C:\MDS\MDS_Frontend\src\backend\node_modules\express\lib\router\index.js:286:9
[1]     at Function.process_params (C:\MDS\MDS_Frontend\src\backend\node_modules\express\lib\router\index.js:346:12)
[1]     at next (C:\MDS\MDS_Frontend\src\backend\node_modules\express\lib\router\index.js:280:10)
[1]     at urlencodedParser (C:\MDS\MDS_Frontend\src\backend\node_modules\body-parser\lib\types\urlencoded.js:100:7)
[1] >>> POST https://localhost:8080/api/contracts/07cc5e01-bd8f-4c7f-bd6c-373f832204c7/rules
[1] >>> DATA:  [ 'eb88bb13-d415-4721-a800-4a8ba2d9c9ff' ]
[1] >>> GET https://localhost:8080/api/contracts
[1] >>> GET https://localhost:8080/api/endpoints
[1] >>> GET https://localhost:8080/api/catalogs
[1] >>> GET https://localhost:8080/api/brokers
[1] >>> GET https://localhost:8080/api/catalogs

The offer itself was saved with all data except of the Representation/ file input, which was not saved. I edited the offer and added the same file again. Then I tried to publish the offer again and got another error message.

 >>> PUT https://localhost:8080/api/offers/41602d42-aaec-4633-a988-44c0e7630505
[1] >>> DATA:  {
[1]   title: 'File 1 MB',
[1]   description: '-',
[1]   keywords: [ 'LargeFile' ],
[1]   publisher: 'https://mobility-dataspace.eu/',
[1]   language: 'EN',
[1]   paymentMethod: 'free',
[1]   license: 'https://creativecommons.org/licenses/by/4.0/',
[1]   samples: [],
[1]   'http://w3id.org/mds#transportMode': 'Rail',
[1]   'http://w3id.org/mds#dataCategory': 'Public Transport Information',
[1]   'http://w3id.org/mds#dataModel': 'GTFS'
[1] }
[1] >>> POST https://localhost:8080/api/catalogs/5e3347d9-ee9d-4a81-883b-9bc4c2437575/offers
[1] >>> DATA:  [ '41602d42-aaec-4633-a988-44c0e7630505' ]
[1] >>> GET https://localhost:8080/api/offers/41602d42-aaec-4633-a988-44c0e7630505/contracts
[1] >>> GET https://localhost:8080/api/contracts/07cc5e01-bd8f-4c7f-bd6c-373f832204c7/rules
[1] >>> DELETE https://localhost:8080/api/rules/eb88bb13-d415-4721-a800-4a8ba2d9c9ff
[1] >>> DATA:  undefined
[1] >>> POST https://localhost:8080/api/examples/policy
[1] >>> DATA:  { type: 'PROVIDE_ACCESS' }
[1] >>> POST https://localhost:8080/api/rules
[1] >>> DATA:  {
[1]   value: '{"@context":{"ids":"https://w3id.org/idsa/core/","idsc":"https://w3id.org/idsa/code/"},"@type":"ids:Permission","@id":"https://w3id.org/idsa/autogen/permission/df561acc-51f3-41b7-b922-42d7775b590c","ids:description":[{"@value":"","@type":"http://www.w3.org/2001/XMLSchema#string"}],"ids:title":[{"@value":"","@type":"http://www.w3.org/2001/XMLSchema#string"}],"ids:action":[{"@id":"https://w3id.org/idsa/code/USE"}]}'
[1] }
[1] >>> POST https://localhost:8080/api/contracts/07cc5e01-bd8f-4c7f-bd6c-373f832204c7/rules
[1] >>> DATA:  [ '72adea59-9ab6-40cf-afa7-9766aae97e10' ]
[1] >>> PUT https://localhost:8080/api/contracts/07cc5e01-bd8f-4c7f-bd6c-373f832204c7
[1] >>> DATA:  {
[1]   title: '',
[1]   start: '2022-07-28T00:00:00Z',
[1]   end: '2022-07-31T00:00:00Z'
[1] }
[1] >>> PUT https://localhost:8080/api/representations/
[1] >>> DATA:  { language: 'EN', mediaType: 'txt' }
[1] Error on PUT /api/representations/ {"status":405,"statusText":"","headers":{"allow":"GET, POST","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","cache-control":"no-cache, no-store, max-age=0, must-revalidate","pragma":"no-cache","expires":"0","strict-transport-security":"max-age=31536000 ; includeSubDomains","x-frame-options":"DENY","content-type":"application/json","transfer-encoding":"chunked","date":"Thu, 28 Jul 2022 09:35:55 GMT","connection":"close"},"config":null,"request":null,"data":{"timestamp":"2022-07-28T09:35:56.630+00:00","status":405,"error":"Method Not Allowed","path":"/api/representations/"}}
[1] >>> GET https://localhost:8080/api/contracts

The behavior is the same: all atrributes are saved except of the Representation/ file input

SebastianOpriel commented 2 years ago

Thanks for your bug report. Please check out the current development branch (commit: https://github.com/International-Data-Spaces-Association/DataspaceConnectorUI/commit/399c79f970e2c447de2197245d4d2b34dcb404d4), which shall fix the issue. Once you confirm, that the fix is properly working, I will close the issue.

ip312 commented 2 years ago

The issue is fixed, thank you.