Skip to content
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

Not pinned or pinned indirectly #102

Open
shawnsblog opened this issue Aug 17, 2019 · 3 comments
Open

Not pinned or pinned indirectly #102

shawnsblog opened this issue Aug 17, 2019 · 3 comments

Comments

@shawnsblog
Copy link

After retrieving the local pins (via ListAsync), trying to iterate through and remove (via Pin.RemoveAsync), I'm receiving an error message

"not pinned or pinned indirectly"

Doing a tad bit of research, there seemed to be some conversation about how to handle pinning with regard to direct, recursive, and indirect pins...I trust that this library handles iterative removal? Am I approaching this the wrong way?

@richardschneider
Copy link
Owner

This library, net-ipfs-core only defines the PIN API, it does not implement it.

I assume you are using net-ipfs-http-client; which is just a wrapper around the API and calls the IPFS daemon. Which daemon are you using (go or js and version number)?

Can you show the code you are using and the stack trace.

@shawnsblog
Copy link
Author

I'm using the Go client. IPFS Desktop more directly.

IEnumerable<Cid> localPackages = await ListLocalPackagesAsync();
            foreach(Cid c in localPackages)
            {
                Trace.WriteLine("Removing "+c+" from local storage");
                try
                {
                    await ipfs.Pin.RemoveAsync(c);
                }catch(HttpRequestException ex)
                {
                    Trace.WriteLine("Unable to remove "+c+" from local storage");
                    Trace.WriteLine(ex.Message);
                }
            }
            IEnumerable<Cid> remainingPackages = await ipfs.Pin.ListAsync();

So, it looks like calling ListAsync, returns indirect pins first, which throw the error message, then once it reaches the direct pins is able to delete them, which then cascades to the indirect pins. Removing them "solving" the issue.

And yes, you're correct, ipfs-core is different than ipfs-http-client, I apologize for posting in the wrong project.

@richardschneider
Copy link
Owner

What is the code ListLocalPackagesAsync about? Why not just use ipfs.Pin.ListAsync?

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

No branches or pull requests

2 participants