Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

ipfs.pin.rm gives unclear error #586

Closed
Powersource opened this issue Aug 30, 2017 · 7 comments
Closed

ipfs.pin.rm gives unclear error #586

Powersource opened this issue Aug 30, 2017 · 7 comments

Comments

@Powersource
Copy link

I'm using ipfsd-ctl underneath this api and when I'm trying to remove the default pins I'm getting an unclear error. This is my output (not the prettiest copy paste):

running
index.js:10 Object {id: "QmSWpcv7Ly53F4GHmY1msJqouZAA2EB4ycXNN7TEAwrU64", publicKey: "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQ…NEL8D+P98pVe9t/+yLQHXhKNv2nzTggmowRKXcRsfAgMBAAE=", addresses: Array(2), agentVersion: "go-ipfs/0.4.9/", protocolVersion: "ipfs/0.1.0"}addresses: Array(2)agentVersion: "go-ipfs/0.4.9/"id: "QmSWpcv7Ly53F4GHmY1msJqouZAA2EB4ycXNN7TEAwrU64"protocolVersion: "ipfs/0.1.0"publicKey: "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC27i6mpja98qdDf84YTWC/1lnNlkk1HEoXWmZEFPfj4FqxqBvERyToYlKS6nQk6Je6fE7eUXX9b3hZX8t+TfoIKP1KgSTymsfggWvRBp5pwgqTFfnfWLFDA+28+Z8OaWVjEn85Xid7UGh6hClm0wyIHcyXXaV2Psw9kP7szk8hMjf23y5OyCKvic92R3TQh0yXb+ihBx74qx1ZUhiKfFZTesNzrsN8XxvUi0bUOUiB8ns+LDCXzEgiz5hXVThz+7H9RfjVS+xuiRFdvZN7b/lvqbsoxBVOnq/qXx9L959LvpXNEL8D+P98pVe9t/+yLQHXhKNv2nzTggmowRKXcRsfAgMBAAE="__proto__: Object
index.js:19 hash QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn
index.js:19 hash QmVLDAhCY3X9P2uRudKAryuQFPM5zqA3Yij1dY8FpGbL7T
internal/process/next_tick.js:135 Uncaught (in promise) ["QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"]
_tickDomainCallback @ internal/process/next_tick.js:135
internal/process/next_tick.js:135 Uncaught (in promise) ["QmVLDAhCY3X9P2uRudKAryuQFPM5zqA3Yij1dY8FpGbL7T"]0: "QmVLDAhCY3X9P2uRudKAryuQFPM5zqA3Yij1dY8FpGbL7T"length: 1__proto__: Array(0)
_tickDomainCallback @ internal/process/next_tick.js:135

My code.

{"diskinfo":{"free_space":108443185152,"fstype":"61267","total_space":95628750848},
"environment":{"GOPATH":"/home/me/prj/go","IPFS_PATH":""},"ipfs_commit":"c5d362e3f",
"ipfs_version":"0.4.11-dev","memory":{"swap":0,"virt":672760000},"net":{"interface_addresses":
["/ip4/127.0.0.1","/ip4/10.2.202.244","/ip6/::1","/ip6/fe80::80ca:2835:20da:f537"],"online":true},
"runtime":{"arch":"amd64","compiler":"gc","gomaxprocs":4,"numcpu":4,"numgoroutines":2216,
"os":"linux","version":"go1.8.3"}}

(Maybe unrelated, the program doesn't get past printing 'running' the majority of the time, any clue what's causing that/how to get more info?)

@Powersource
Copy link
Author

I think @diasdavid suggested we add a verbose option to the function?

@daviddias
Copy link
Contributor

@Kubuxu does the above suggest something to you?

@Powersource
Copy link
Author

Trying this on a different computer and with a slightly newer go-ipfs:

{"diskinfo":{"free_space":636385632256,"fstype":"61267","total_space":586358910976},"environment":{"GOPATH":"/home/me/prj/go","IPFS_PATH":""},"ipfs_commit":"ce1ca6ab8","ipfs_version":"0.4.11-dev","memory":{"swap":0,"virt":235376000},"net":{"interface_addresses":["/ip4/127.0.0.1","/ip4/192.168.1.123","/ip4/172.17.0.1","/ip4/172.18.0.1","/ip6/::1","/ip6/fe80::76ae:fe9a:549d:403f"],"online":false},"runtime":{"arch":"amd64","compiler":"gc","gomaxprocs":4,"numcpu":4,"numgoroutines":6,"os":"linux","version":"go1.8.3"}}

running
index.js:9 Uncaught Error: connect ECONNREFUSED 127.0.0.1:37897
    at Object.exports._errnoException (util.js:1050)
    at exports._exceptionWithHostPort (util.js:1073)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097)
exports._errnoException @ util.js:1050
exports._exceptionWithHostPort @ util.js:1073
afterConnect @ net.js:1097
internal/process/next_tick.js:135 Uncaught (in promise) Error: connect ECONNREFUSED 127.0.0.1:37897
    at Object.exports._errnoException (util.js:1050)
    at exports._exceptionWithHostPort (util.js:1073)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097)
exports._errnoException @ util.js:1050
exports._exceptionWithHostPort @ util.js:1073
afterConnect @ net.js:1097

@Powersource
Copy link
Author

After starting ipfs daemon in the background (even after turning it off) (this shouldn't affect this since I use the disposableApi right?) I'm back to the original error:

[truncated id]
index.js:19 hash QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn
index.js:19 hash QmVLDAhCY3X9P2uRudKAryuQFPM5zqA3Yij1dY8FpGbL7T
internal/process/next_tick.js:135 Uncaught (in promise) ["QmVLDAhCY3X9P2uRudKAryuQFPM5zqA3Yij1dY8FpGbL7T"]0: "QmVLDAhCY3X9P2uRudKAryuQFPM5zqA3Yij1dY8FpGbL7T"length: 1__proto__: Array(0)
_tickDomainCallback @ internal/process/next_tick.js:135
internal/process/next_tick.js:135 Uncaught (in promise) ["QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"]0: "QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"length: 1__proto__: Array(0)
_tickDomainCallback @ internal/process/next_tick.js:135

@Kubuxu
Copy link

Kubuxu commented Sep 2, 2017

@diasdavid sorry but no. AFAIK ipfs pin rm returns streaming response, does js-ipfs-api handle it?

@Powersource
Copy link
Author

Wow, just had a several day long problem with cat and ended up realizing now I misunderstood the function signature that's supposed to go in then(), mixed it up with the callback style. The code works if I change the end of line 15 to .then(unpinned => {.

I think the problem lies in the documentation since it only shows how to use the callbacks (for both cat and rm). You have to go into the linked examples to see how to use the promise style.

@achingbrain
Copy link
Collaborator

The docs show our new streaming API and all references to callbacks have been removed so I'm going to close this. Please open a new issue against ipfs/js-ipfs or on https://discuss.ipfs.io if you are having problems.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants