I've got myself into a weird state after I believe closing the daemon with ctrl-z (I was closing because jsipfs add -r . stopped responding, as it sometimes does.
This is what happened afterwards:
john:~:$ jsipfs daemon
Initializing daemon...
Error: no ipfs repo found in /Users/john/.jsipfs
please run: jsipfs init
john:~:$ jsipfs init
initializing ipfs node at /Users/john/.jsipfs
Error: repo already exists
@JohnAllen can you share a ls when that happens? We need to check if the fs lock and/or the api file were left there once you had to terminate the previous process.
Sure I will attempt to replicate sometime today and post the output
Ok jsipfs ls did nothing (if it was supposed to) and ls in .jsipfs returns:
api blocks/ config datastore/ repo.lock version
Yeah, I should have explained that was Unix's ls :)
That repo.lock is the issue. What is happening is that it is unable to lock the repo on open and that error is being bubbled up as "repo doesn't exist". This is a issue that comes from ipfs-repo. @pgte mind looking into this?
What go-ipfs does (for the sake of simplicity), sees the repo.lock, then checks the api tries to connect to it and if there is no daemon running, then it just deletes both api and repo.lock and boots the node.
The real error is being masked by js-ipfs here: https://github.com/ipfs/js-ipfs/blob/c5bb0b9fe115acfbfb92b0ac61d00d8ee82bd9a2/src/cli/commands/daemon.js#L31-L32
Yeah seems like that message isn't always on point.
@pgte just pushed a fix, wanna confirm @JohnAllen ? :)
Closing. Let us know if you still see it happen.