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

w3 space usage shows uncaught error Error: no proofs available for resource did:key:z6MkkzxLtWpqXQPPXLEjD2M2gWJZikcpCbdk4HBf7tj7K59j and ability usage/report #168

Open
gobengo opened this issue Jan 24, 2024 · 1 comment
Assignees

Comments

@gobengo
Copy link
Contributor

gobengo commented Jan 24, 2024

⚡ w3 usage report                       
 Account: did:mailto:dag.house:bengo
Provider: did:web:web3.storage
   Space: did:key:z6MktxMvmk3ii638jWcuqzUP3o2A4x2cFnqh9PVKzsaofN1c
    Size: 0

file:///Users/bengo/.nvm/versions/node/v20.11.0/lib/node_modules/@web3-storage/w3cli/node_modules/@web3-storage/access/dist/src/agent.js:489
throw new Error(no proofs available for resource ${space} and ability ${cap.can});
^

Error: no proofs available for resource did:key:z6MkkzxLtWpqXQPPXLEjD2M2gWJZikcpCbdk4HBf7tj7K59j and ability usage/report
at Agent.invoke (file:///Users/bengo/.nvm/versions/node/v20.11.0/lib/node_modules/@web3-storage/w3cli/node_modules/@web3-storage/access/dist/src/agent.js:489:19)
at Agent.invokeAndExecute (file:///Users/bengo/.nvm/versions/node/v20.11.0/lib/node_modules/@web3-storage/w3cli/node_modules/@web3-storage/access/dist/src/agent.js:424:32)
at report (file:///Users/bengo/.nvm/versions/node/v20.11.0/lib/node_modules/@web3-storage/w3cli/node_modules/@web3-storage/w3up-client/src/capability/usage.js:38:31)
at UsageClient.report (file:///Users/bengo/.nvm/versions/node/v20.11.0/lib/node_modules/@web3-storage/w3cli/node_modules/@web3-storage/w3up-client/src/capability/usage.js:16:23)
at getSpaceUsageReports (file:///Users/bengo/.nvm/versions/node/v20.11.0/lib/node_modules/@web3-storage/w3cli/index.js:631:54)
at getSpaceUsageReports.next ()
at usageReport (file:///Users/bengo/.nvm/versions/node/v20.11.0/lib/node_modules/@web3-storage/w3cli/index.js:591:53)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.11.0

Context

  • in my account there are proofs for many spaces, including old ones from before we had usage/report
  • some of those proofs cause spaces to be checked for usage, but because we don't have authorizations for usage/report for those space, the server rejects the usage/report invocation
  • the w3cli is not expecting this error, so it goes uncaught and fails

What should it do?

  • At the very least, catch this error and give a better explanation to the user about what happened
  • maybe also continue on getting usage/report for other spaces that dont error, and only show the errors at the end with a partial usage report
@gobengo gobengo self-assigned this Jan 24, 2024
@gobengo
Copy link
Contributor Author

gobengo commented Jan 24, 2024

discovered while retesting storacha/w3up#1182

gobengo added a commit that referenced this issue Jan 24, 2024
#169)

Motivation:
* fix an uncuaght error I get
#168

---------

Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant