Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Fails to start for the first time due to 'datastore key does not have a valid format' #1615

Closed
lidel opened this issue Oct 3, 2018 · 7 comments
Assignees
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP

Comments

@lidel
Copy link
Member

lidel commented Oct 3, 2018

  • Version: 0.32.3
  • Platform: ipfs-companion in Firefox and Chrome
  • Subsystem: looks like related to newly added IPNS

Type: Bug

Severity: High-ish?

Description:

After switching from js-ipfs 0.31.7 to 0.32.3 switching to embedded node in companion produces an error:

2018-10-04--01-23-32

What is interesting, is that if I switch to External node and then back again to Embedded one, second time js-ipfs tries to initialize is successful and everything works as expected.

I did not look into it deeper, but my guess is that there is some sort first-run init that happens after the error occurs that fixes datastore(?) and makes following runs in the same context to work fine. Maybe IPNS tries to publish key before it is stored or something?

cc @vasco-santos in case its something obvious

Steps to reproduce the error:

To build Companion with js-ipfs v0.32.3 and run in Firefox (but the same issue is in Chromium):

  1. git clone https://github.com/ipfs-shipyard/ipfs-companion.git
  2. cd ipfs-companion
  3. git reset --hard 21eb92bee2b8ea99daa3fb1836431bd63f047c24
  4. npm run dev-build
  5. npm run firefox

Then, go to Preferences and switch to Embedded node. Initial try will fail, following ones will succeed.

@lidel lidel added the kind/bug A bug in existing code (including security flaws) label Oct 3, 2018
lidel added a commit to ipfs/ipfs-companion that referenced this issue Oct 3, 2018
lidel added a commit to ipfs/ipfs-companion that referenced this issue Oct 3, 2018
@vasco-santos vasco-santos self-assigned this Oct 4, 2018
@vasco-santos
Copy link
Member

vasco-santos commented Oct 4, 2018

Hey @lidel

I see the problem. Basically, there should be a mismatch of versions for interface-datastore in the dependencies. This causes this condition to happen.

But let's fix this in the correct way! I will create a PR for interface-datastore to add the class-is module and use it instead of the instance of and update here.

@alanshaw
Copy link
Member

@vasco-santos / @lidel can this be closed now?

@lidel
Copy link
Member Author

lidel commented Oct 16, 2018

@alanshaw I think we are waiting for #1617

@vasco-santos
Copy link
Member

We just need interface-datastore#24 to get released and then update the js-ipfs PR. @diasdavid can you release it?

@alanshaw alanshaw added exp/novice Someone with a little familiarity can pick up P0 Critical: Tackled by core team ASAP labels Oct 24, 2018
@pgte
Copy link
Contributor

pgte commented Oct 27, 2018

Also bumping into this issue here: peer-base/peer-base#95

@daviddias
Copy link
Member

@pgte I believe @vasco-santos fixed this yesterday, to get the fix you need a fresh npm install of your modules

@vasco-santos
Copy link
Member

vasco-santos commented Oct 27, 2018

In this case @pgte, since you are already updating interface-datastore, datastore-core and ipfs-repo, you will need to wait for js-ipfs#1617 to get merged and released (which solves this issue).

In the meanwhile, if you do not upgrade those package versions, I think that it will work fine for you.

@ghost ghost removed the status/in-progress In progress label Oct 29, 2018
alanshaw pushed a commit that referenced this issue Oct 29, 2018
As `instance of` fails using different versions of a module, it was changed to use `class-is`.

Needs:

- [x] [js-peer-id#84](libp2p/js-peer-id#84)
- [x] [interface-datastore#24](ipfs/interface-datastore#24)

Fixes #1615
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP
Projects
None yet
Development

No branches or pull requests

5 participants