Ipfs-companion: Unable to pin resources via ipfs-companion

Created on 26 Jul 2018  路  11Comments  路  Source: ipfs/ipfs-companion

Error while pinning IPFS Resource
JSON.parse: unexpected character at line 1 column 1 of the JSON data

kinbug help wanted

All 11 comments

@swedneck thank you for reporting this!

  • Which version of companion and go-ipfs are you running?
  • What was the URL when you tried to pin?

    • (ideally) are you able to tell what was the raw JSON payload that triggered this error?

      > Opening Browser Console (ctrl+shift+j) and enabling XHR and Request logging should let you inspect raw response when right-clicking on a logged request:

      screenshot_13

IPFS companion Beta @ 9424acc
go-ipfs 0.4.16

I get the error no matter what i try to pin.

Hm.. I was unable to reproduce with these versions.

What OS are you running? Is it possible some sort of firewall software is blocking request ?
Does below command succeeds and returns {"Pins":["zb2rhk6GMPQF3hfzwXTaNYFLKomMeC6UXdUt6jZKPpeVirLtV"]} ?

curl 'http://127.0.0.1:5001/api/v0/pin/add?r=true&arg=bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy'

I'm running fedora workstation 28, and that command returns the correct string.

@swedneck and what is the browser version?

Firefox 61.0.1

Hm.. are you running a lot of extensions in Firefox?
What if you install Companion in an empty, ephemeral profile:

firefox --no-remote --profile $(mktemp -d) 'https://addons.mozilla.org/en-US/firefox/addon/ipfs-companion/'

If you try to pin via Companion running in it, is the error still there?

Nope, i get the same error.

So I've been running out of ideas :sweat_smile: and tried to pin/unpin IPNS resource and.. bingo:
screenshot_15

The error is caused by change in js-ipfs-api: in past ipfs.name.resolve returned object with Path field, right now it returns a path as a string. Will fix this shortly.

@swedneck
Let me know if you have issues with pinning non-IPNS paths.
Try pinning this: https://ipfs.io/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR

Pinning that worked!

Fix landed in v2.4.3.10570, thanks for reporting!

Was this page helpful?
0 / 5 - 0 ratings