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

Error "Space has no name" loading proof #1175

Closed
juliangruber opened this issue Nov 21, 2023 · 2 comments
Closed

Error "Space has no name" loading proof #1175

juliangruber opened this issue Nov 21, 2023 · 2 comments

Comments

@juliangruber
Copy link

I am trying to follow https://web3.storage/docs/how-to/upload/ for setting up an agent with pkey and proof, to upload in a server environment where you can't do the email dance.

I'm getting this error:

Error: Space has no name, please pass a `name` option to specify it
    at Agent.importSpaceFromDelegation (file:///Users/julian/dev/filecoin-station/spark-api/spark-publish/node_modules/@web3-storage/access/dist/src/agent.js:308:19)
    at Client.addSpace (file:///Users/julian/dev/filecoin-station/spark-api/spark-publish/node_modules/@web3-storage/w3up-client/src/client.js:228:30)
    at ...

I'm initializing the space like this:

async function parseProof (data) {
  const blocks = []
  const reader = await CarReader.fromBytes(Buffer.from(data, 'base64'))
  for await (const block of reader.blocks()) {
    blocks.push(block)
  }
  return importDAG(blocks)
}

const principal = ed25519.Signer.parse(W3UP_AGENT_PRIVATE_KEY)
const web3Storage = await Client.create({ principal })
const proof = await parseProof(W3UP_AGENT_PROOF)
const space = await web3Storage.addSpace(proof) // <- throws

I have created the pkey and proof like this:

$ npx ucan-key ed --json
$ npx @web3-storage/w3cli delegation create did:key:...--can 'store/add' --can 'upload/add' | base64
travis added a commit that referenced this issue Nov 21, 2023
@juliangruber reported an issue with our documented space creation flow when the exported space access delegation doesn't specify a name and the client doesn't specify one manually:

#1175

I think it's reasonable to require a name for spaces at some level, but I think the access-client API is too low-level for this.
@travis
Copy link
Member

travis commented Nov 21, 2023

Thanks @juliangruber ! You've identified a bug we introduced late in the game - thanks! We need to confer as a team on how best to fix so it might take a couple days (especially on this holiday week) but you can track its progress here: #1177

alanshaw pushed a commit that referenced this issue Nov 22, 2023
@juliangruber reported an issue with our documented space creation flow
when the exported space access delegation doesn't specify a name and the
client doesn't specify one manually:

#1175

I think it's reasonable to require a name for spaces at some level, but
I think the access-client API is too low-level for this.
@juliangruber
Copy link
Author

I can confirm this all works, after manually upgrading the access dependency :) Thank you!

gobengo pushed a commit that referenced this issue Nov 28, 2023
@juliangruber reported an issue with our documented space creation flow
when the exported space access delegation doesn't specify a name and the
client doesn't specify one manually:

#1175

I think it's reasonable to require a name for spaces at some level, but
I think the access-client API is too low-level for this.
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

3 participants