Orbit-db: After migrating: Could not append entry, key is not allowed to write to the log

Created on 5 Sep 2019  路  12Comments  路  Source: orbitdb/orbit-db

While migrating from orbit-db 0.20.1 to 0.21.4 I get "Error: Could not append entry, key "..." is not allowed to write to the log" error when trying to write to the newly created DB.

I try to open a DB like here https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbopenaddress-options, which with the old version works without issues:

const messagesDbConfig = {
    type: 'feed',
    create: true,
    accessController: {
        admin: ['*'],
        write: ['*']
    }
};
...
messagesDb = await orbitDbInstance.open(messagesDbName + '-' + defaultThreadName, messagesDbConfig)

Clearly I missed something here, can you please have a look?

Most helpful comment

Ay yi yi, my apologies. My brain is obviously fried. Let me try again with those two versions.

All 12 comments

Hi @peterhuba I'll take a look. What version / versions of IPFS are you using so I can accurately reproduce?

With the old version I used ipfs 0.35, with the new 0.37.1

While I test, can you confirm that the same problem exists with 0.36.0?

Hmm, this is the code I just tested by installing v0.21 and then re-running it on v0.22

const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')

const ipfs = new IPFS({
  EXPERIMENTAL: {
    pubsub: true
  }
})

ipfs.on('ready', async() => {
  const messagesDbConfig = {
    type: 'feed',
    create: 'true',
    accessController: {
      admin: ['*'],
      write: ['*']
    }
  };

  const orbitDbInstance = await OrbitDB.createInstance(ipfs)

  messagesDb = await orbitDbInstance.open('messages', messagesDbConfig)
  await messagesDb.load()
  await messagesDb.add("X")
})

This worked. How else might I alter my code to attempt to reproduce what you're seeing?

Don't use create: true on the second time,
And its a problem going from v0.20.1 ==> v0.21 nothing to do with v0.22.x.
Unforunatey I think I deleted my problem dbs only 2 days ago :C
Using ipfs-http-client so seems to be unrelated to ipfs version

Try oppening it from the full /orbitdb/ address the second time

Ay yi yi, my apologies. My brain is obviously fried. Let me try again with those two versions.

Still can't reproduce! I made a repo with a ./run.sh you can run and see what I'm doing. https://github.com/aphelionz/issue-679

I found some old instances running v0.20.0. I'll see if I can reproduce it

@aphelionz yes I also see the error with IPFS 0.36
I can also confirm that the same issue is present when using orbit 0.21. It only works with IPFS 0.35 and orbit 0.20.1 Here's a Gist of what I'm trying to do in the service worker: https://gist.github.com/peterhuba/74d9a8d9c9b1f89e057d1e359502bf8a

As a note, I tested with browser data cleared, so no old DB that might interfere. I'll try to have a look to the test repo you linked.

@peterhuba Interesting. Admittedly I haven't tried it in a service worker yet but I'll give that a shot too. Thanks for posting code.

Works fine after updating an old github.com/orbitdb/orbit-db-identity-provider version I had set to the latest. :man_facepalming:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

varcario picture varcario  路  5Comments

maxkerp picture maxkerp  路  6Comments

cristiano-belloni picture cristiano-belloni  路  5Comments

BartKnucle picture BartKnucle  路  4Comments

oskarpyke picture oskarpyke  路  6Comments