storacha / w3up

⁂ w3up protocol implementation
https://github.com/storacha/specs
Other
64 stars 22 forks source link

fix: return piece accept receipt error #1512

Closed alanshaw closed 5 months ago

alanshaw commented 5 months ago

This was causing the following error in production:

2024-06-21T04:05:01.605Z    ee3a792e-71d8-4188-9a45-a3f44a153719    WARN    HandlerExecutionError: service handler {can: "filecoin/info"} error: Cannot read properties of undefined (reading 'aggregate')
    at invoke (/node_modules/@ucanto/server/src/server.js:157:21)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at run (/node_modules/@web3-storage/upload-api/src/lib.js:169:10)
    ... 4 lines matching cause stack trace ...
    at processResult (/node_modules/src/awslambda.ts:326:50) {
  capability: {
    nb: {
      piece: CID(bafkzcibdyuhqqhgb72e23rtoielekn2lsknb4naxhvyz6fhsd7bms4ld6ghbaiqi)
    },
    can: 'filecoin/info',
    with: 'did:key:z6MkiBeiHFA6kbA2mchg1F9juxCuHuLgymzJpanKswpBZmQT'
  },
  cause: TypeError: Cannot read properties of undefined (reading 'aggregate')
      at filecoinInfo (/node_modules/@web3-storage/filecoin-api/src/storefront/service.js:298:20)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at invoke (/node_modules/@ucanto/server/src/server.js:145:23)
      at run (/node_modules/@web3-storage/upload-api/src/lib.js:169:10)
      at async Promise.all (index 0)
      at execute (/node_modules/@web3-storage/upload-api/src/lib.js:139:5)
      at handle (/node_modules/@web3-storage/upload-api/src/lib.js:108:20)
      at ucanInvocationRouter (/upload-api/functions/ucan-invocation-router.js:298:20)
      at processResult (/node_modules/src/awslambda.ts:326:50),
  error: true
}