Skip to content

AggregateError: All promises were rejected / AggregateError: Unable to fetch raw block for CID #93

@NiKrause

Description

@NiKrause

Description of the assumed situation:

A browser contains a corrupted somewhat inaccessible db and adds it to a voyager instance in order to replicate/pin it.

The process timeouts at waitForReplication(db) https://github.com/orbitdb/voyager/blob/main/src/lib/handlers/add.js#L28

Image

As it seems, it cannot get the data from the browser as usual. Helia is trying to find the data online via the TrustlessGatewayBlockBroker.retrieve and fails because the data are just not online available (because they are on the browser only)
We receive an exception and the Voyager application crashes (ends)

According to:
https://nodejs.org/api/events.html#error-events

NodeJS is ending if there is any error event rissen.
What I did in order to stop Voyager from crashing:
After createHelia, I added the following lines:

  const ipfs = await createHelia({ libp2p, datastore, blockstore })
  ipfs.libp2p.addEventListener('error', (err) => {
    console.error('Libp2p error:', err)
  })
  
  process.on('unhandledRejection', (error) => {
    console.error('Unhandled rejection:', error)
  })

Voyager keeps running now but the database itself can't be replicated (pinned)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions