Go-ipfs: issues with paths in windows

Created on 31 Aug 2017  路  7Comments  路  Source: ipfs/go-ipfs

Not sure whats going on here, i'm in bash in a mingw shell:

why@DESKTOP-K1JQ69C MINGW64 ~/go/src/github.com/ipfs/go-ipfs (master)
$ ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme
Error: invalid 'ipfs ref' path

but this works:

why@DESKTOP-K1JQ69C MINGW64 ~/go/src/github.com/ipfs/go-ipfs (master)
$ ipfs cat QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme
Hello and Welcome to IPFS!
...
...
topiwindows

Most helpful comment

Following the posix path conversion article I was able to connect to a peer using
ipfs swarm connect "//ip4\104.131.131.82\tcp\4001\ipfs\QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"

All 7 comments

It is possible that mingw is trying to be sneaky and rewrites arguments starting with /, I am not sure how anyone thought it was good idea if this is a case.

It is possible that mingw is trying to be sneaky and rewrites arguments starting with /, I am not sure how anyone thought it was good idea if this is a case.

https://stackoverflow.com/questions/28533664/how-to-prevent-msys-to-convert-the-file-path-for-an-external-program

http://www.mingw.org/wiki/Posix_path_conversion


One solution here is to add a heuristic (client-side) that strips the prefix...

Regardless, we should consider modifying ipfs cat to spit the path back out on error (same as normal cat).

This also causes issues with ipfs swarm peer connect.

Following the posix path conversion article I was able to connect to a peer using
ipfs swarm connect "//ip4\104.131.131.82\tcp\4001\ipfs\QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"

I have experienced the same problem with ipfs v0.4.13

Error: invalid multiaddr, must begin with /

Suggestion from @tylorr fixes the problem:

ipfs.exe bootstrap add "//ip4\192.168.1.7\tcp\4001\ipfs\QmZD8nWNhdfgdDXHmTrqUSSBz3uy7MudVhaBnqQP8mHWFRP"

I am still having this bug

@x5engine unfortunately, there's nothing we can do about this issue other than:

  1. Tell you to use a different shell.
  2. Provide better feedback on the command line (I've filed two PRs for that).
Was this page helpful?
0 / 5 - 0 ratings