Skip to content

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

Open

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)

Activity

  1. NiKrause commented on Apr 10, 2025

    @NiKrause
    ContributorAuthor

    What helped now was the following:

    1. Creating a new db in the browser and copy the contents of the assumed corrupted db into the the new one
    2. Replication of the new db
    3. Deleting the old one
    4. Referencing the new db in my web deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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