Skip to content

bad error if $repodir/api file is bad/corrupted #3191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jbenet opened this issue Sep 5, 2016 · 2 comments
Closed

bad error if $repodir/api file is bad/corrupted #3191

jbenet opened this issue Sep 5, 2016 · 2 comments
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)

Comments

@jbenet
Copy link
Member

jbenet commented Sep 5, 2016

Version/Platform/Processor information (from ipfs version --all):

0.4.3-rc3

Type (bug, feature, meta, test failure, question): bug
Area (api, commands, daemon, fuse, etc): commands
Priority (from P0: operations on fire, to P4: functioning): P4

Description:

bad error if $repodir/api file is bad/corrupted

> rm ~/.ipfs/api # clear anything there
> touch ~/.ipfs/api # bad file
> ipfs daemon
Error:  is not a 'thin waist' address

It should be something like

> ipfs daemon
Error: failed to parse <path-to-repo/api file. If there is no daemon running, just delete it.
You can do this with:
    ps aux | grep ipfs  # check there is no ipfs daemon
    rm <path-to-repo>/api
@whyrusleeping whyrusleeping added the kind/bug A bug in existing code (including security flaws) label Sep 6, 2016
@whyrusleeping
Copy link
Member

Thats kinda funny actually, It reads the api file, and tries to parse its contents as a multihash. The strange part here is that it succeeds, an empty string is a valid multihash (one with no protocols).

@whyrusleeping whyrusleeping added the help wanted Seeking public contribution on this issue label Sep 6, 2016
@whyrusleeping
Copy link
Member

We should validate the address protocols on read instead of have it fail when we go to start up an http client (as i suspect we're now doing).

@flyingzumwalt flyingzumwalt added the status/deferred Conscious decision to pause or backlog label Sep 26, 2016
@Kubuxu Kubuxu added status/in-progress In progress and removed status/deferred Conscious decision to pause or backlog labels Oct 3, 2016
@whyrusleeping whyrusleeping removed the status/in-progress In progress label Nov 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

4 participants