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

Unable to remotely pin on Pinata with the WebUI #2096

Closed
mariaa144 opened this issue Feb 9, 2023 · 13 comments
Closed

Unable to remotely pin on Pinata with the WebUI #2096

mariaa144 opened this issue Feb 9, 2023 · 13 comments
Labels
area/pinning Integrating pinning into GUI apps exp/intermediate Prior experience is likely helpful kind/maintenance Work required to avoid breaking changes or harm to project's status quo kind/stale kind/support A question or request for support need/author-input Needs input from the original author P3 Low: Not priority right now topic/dependencies Topic dependencies topic/interop Interoperability

Comments

@mariaa144
Copy link

Describe the bug
When I try to remote pin using the webui I get an error and the pinning doesn't work. I have to go to Pinata web interface to pin manually. The remote pinning was working but after a recent update I started gettting the following error.

The error is: Unable to set pinning at Pinata: HTTPError: reason: "INVALID_ORIGINS", details: "provider array entry: /ip4/10.117.144.19/udp/4001/quic-v1/p2p/xxxxx is not a valid peer multiaddr": 400 Bad Request

To Reproduce
Steps to reproduce the behavior:

  1. Setup remote pinning with Pinata
  2. Try to pin a file
  3. Notice error at the bottom of the webui

Expected behavior
The pinning should work and there shouldn't be an error.

Desktop (please complete the following information):

  • OS: Arch Linux (Garuda Linux)
  • Browser: Firedragon
  • Version: Revision 546fb5a

Additional context
I reached out to Pinata but the support person wasn't able to help me. She said if it was a problem with their service due to a new IPFS version then it would likely be fix sometime in the future.

@mariaa144 mariaa144 added the need/triage Needs initial labeling and prioritization label Feb 9, 2023
@welcome
Copy link

welcome bot commented Feb 9, 2023

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@SgtPooki
Copy link
Member

Hey @mariaa144 thanks for submitting this issue and your detailed descriptions. I'm sorry you're experiencing an issue with pinning your content.

What ipfs version are you connecting the webui to? Kubo recently added support for the quic transport, which may not be supported by some services, but the webui should be able to handle this via graceful degradation of some sort. (we don't right now, which is why this is a bug in webui)

It looks like you're using at least Kubo 0.18.0 because of the transport in your provider array containing quic-v1. You can read more about the quic protocol changes at https://github.com/ipfs/kubo/releases/tag/v0.18.0

QUICv1 and WebTransport config migration
To support QUICv1 and WebTransport by default a new config migration (v13) is run which automatically adds entries in addresses-related fields:

Replace all /quic/webtransport to /quic-v1/webtransport.
For all /quic listeners, keep the Draft-29 listener, and on the same ip and port, add /quic-v1 and /quic-v1/webtransport listeners.

For a temporary fix, try one of the following:

  1. Disable webtransport/quic when talking to pinata (you need to modify ~/.ipfs/config, more descriptions about how this is enabled described at https://github.com/ipfs/kubo/releases/tag/v0.16.0#-webtransport-new-experimental-transport)
  2. use kubo 0.17 or other ipfs daemon that doesn't have webtransport/quic enabled by default until Pinata does.
    • This may require also updating your config, depending on how you're running the backing ipfs daemon for your webui instance.

I will mark this issue as a bug and investigate some mitigation methods in the meantime. Please let us know if you are able to workaround this successfully, and we will update you when we have more details.

@SgtPooki SgtPooki added kind/bug A bug in existing code (including security flaws) status/ready Ready to be worked area/pinning Integrating pinning into GUI apps topic/interop Interoperability exp/intermediate Prior experience is likely helpful P0 Critical: Tackled by core team ASAP kind/maintenance Work required to avoid breaking changes or harm to project's status quo need/analysis Needs further analysis before proceeding effort/days Estimated to take multiple days, but less than a week and removed need/triage Needs initial labeling and prioritization labels Feb 13, 2023
@SgtPooki
Copy link
Member

@mariaa144 I looked into this further, and AFAIK, Kubo should not be falling over on unknown protocols, and I think this is happening in the Pinata API server stack. I believe that Pinata will need to either update to the latest libraries or patch things similar to

diff --git a/node_modules/multiaddr/src/convert.js b/node_modules/multiaddr/src/convert.js
index 7258b50..09f28f9 100644
--- a/node_modules/multiaddr/src/convert.js
+++ b/node_modules/multiaddr/src/convert.js
@@ -39,6 +39,7 @@ Convert.toString = function convertToString (proto, buf) {
case 56: // dnsaddr
case 400: // unix
case 777: // memory
+ case 466: // certhash
return bytes2str(buf)
case 421: // ipfs
@@ -72,6 +73,7 @@ Convert.toBytes = function convertToBytes (proto, str) {
case 56: // dnsaddr
case 400: // unix
case 777: // memory
+ case 466: // certhash
return str2bytes(str)
case 421: // ipfs
diff --git a/node_modules/multiaddr/src/protocols-table.js b/node_modules/multiaddr/src/protocols-table.js
index 4578e43..db46337 100644
--- a/node_modules/multiaddr/src/protocols-table.js
+++ b/node_modules/multiaddr/src/protocols-table.js
@@ -52,6 +52,9 @@ Protocols.table = [
[445, 296, 'onion3'],
[446, V, 'garlic64'],
[460, 0, 'quic'],
+ [461, 0, 'quic-v1'],
+ [465, 0, 'webtransport'],
+ [466, V, 'certhash'],
[477, 0, 'ws'],
[478, 0, 'wss'],
[479, 0, 'p2p-websocket-star'],
.

I reached out to the pinata team internally to discuss this and they will hopefully implement a fix soon. As for webui, the only fix I can think of to resolve this now, and in the future, is to remove protocols conditionally when they fail at the service level, but that should be done on the service side.

I think this issue should be closed because:

  1. There is a workaround for our users
  2. The proper fix is on Pinata's (the service) side.*

Please let me know if you feel differently or have been unable to resolve this issue.

@SgtPooki SgtPooki added P3 Low: Not priority right now topic/dependencies Topic dependencies kind/support A question or request for support need/author-input Needs input from the original author and removed P0 Critical: Tackled by core team ASAP need/analysis Needs further analysis before proceeding effort/days Estimated to take multiple days, but less than a week kind/bug A bug in existing code (including security flaws) labels Feb 14, 2023
@mariaa144
Copy link
Author

I tried to change the config by removing all the lines with "quic" in them but I still got the error. I edited the ~/.ipfs/config and then systemctl --user restart ipfs.service. It isn't clear to me how to disable the feature tiggering the error. I'm on version kubov0.18.1 675f8bddc of IPFS.

@SgtPooki
Copy link
Member

@mariaa144 can you share your config with me?

@mariaa144
Copy link
Author

I tried to remove keys. Let me know if I left anything secret in there. I put back the quic lines because they didn't seem to make a difference.

{
  "API": {
    "HTTPHeaders": {
      "Access-Control-Allow-Origin": [
        "https://webui.ipfs.io",
        "http://webui.ipfs.io.ipns.localhost:8080"
      ]
    }
  },
  "Addresses": {
    "API": "/ip4/127.0.0.1/tcp/5001",
    "Announce": [],
    "AppendAnnounce": [],
    "Gateway": "/ip4/127.0.0.1/tcp/8080",
    "NoAnnounce": [],
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4001",
      "/ip6/::/tcp/4001",
      "/ip4/0.0.0.0/udp/4001/quic",
      "/ip4/0.0.0.0/udp/4001/quic-v1",
      "/ip4/0.0.0.0/udp/4001/quic-v1/webtransport",
      "/ip6/::/udp/4001/quic",
      "/ip6/::/udp/4001/quic-v1",
      "/ip6/::/udp/4001/quic-v1/webtransport"
    ]
  },
  "AutoNAT": {},
  "Bootstrap": [
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
    "/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
  ],
  "DNS": {
    "Resolvers": {}
  },
  "Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
          "child": {
            "path": "blocks",
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"
          },
          "mountpoint": "/blocks",
          "prefix": "flatfs.datastore",
          "type": "measure"
        },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },
          "mountpoint": "/",
          "prefix": "leveldb.datastore",
          "type": "measure"
        }
      ],
      "type": "mount"
    },
    "StorageGCWatermark": 90,
    "StorageMax": "10GB"
  },
  "Discovery": {
    "MDNS": {
      "Enabled": true
    }
  },
  "Experimental": {
    "AcceleratedDHTClient": false,
    "FilestoreEnabled": false,
    "GraphsyncEnabled": false,
    "Libp2pStreamMounting": false,
    "P2pHttpProxy": false,
    "StrategicProviding": false,
    "UrlstoreEnabled": false
  },
  "Gateway": {
    "APICommands": [],
    "HTTPHeaders": {
      "Access-Control-Allow-Headers": [
        "X-Requested-With",
        "Range",
        "User-Agent"
      ],
      "Access-Control-Allow-Methods": [
        "GET"
      ],
      "Access-Control-Allow-Origin": [
        "*"
      ]
    },
    "NoDNSLink": false,
    "NoFetch": false,
    "PathPrefixes": [],
    "PublicGateways": null,
    "RootRedirect": "",
    "Writable": false
  },
  "Identity": {
    "PeerID": "xxx",
    "PrivKey": "zzz"
  },
  "Internal": {},
  "Ipns": {
    "RecordLifetime": "",
    "RepublishPeriod": "",
    "ResolveCacheSize": 128
  },
  "Migration": {
    "DownloadSources": [],
    "Keep": ""
  },
  "Mounts": {
    "FuseAllowOther": false,
    "IPFS": "/ipfs",
    "IPNS": "/ipns"
  },
  "Peering": {
    "Peers": null
  },
  "Pinning": {
    "RemoteServices": {
      "Pinata": {
        "API": {
          "Endpoint": "https://api.pinata.cloud/psa",
          "Key": "xxxx"
        },
        "Policies": {
          "MFS": {
            "Enable": false,
            "PinName": "",
            "RepinInterval": ""
          }
        }
      }
    }
  },
  "Plugins": {
    "Plugins": null
  },
  "Provider": {
    "Strategy": ""
  },
  "Pubsub": {
    "DisableSigning": false,
    "Router": ""
  },
  "Reprovider": {},
  "Routing": {
    "Methods": null,
    "Routers": null
  },
  "Swarm": {
    "AddrFilters": null,
    "ConnMgr": {},
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "RelayClient": {},
    "RelayService": {},
    "ResourceMgr": {},
    "Transports": {
      "Multiplexers": {},
      "Network": {},
      "Security": {}
    }
  }
}

@SgtPooki
Copy link
Member

Can you try updating the "Swarm" section in your config to be the following? It's the same as what you get from running ipfs config Swarm.Transports.Network.WebTransport --json false

  "Swarm": {
    "AddrFilters": null,
    "ConnMgr": {},
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "RelayClient": {},
    "RelayService": {},
    "ResourceMgr": {},
    "Transports": {
      "Multiplexers": {},
      "Network": {
        "WebTransport": false
      },
      "Security": {}
    }
  }

@SgtPooki SgtPooki removed the status/ready Ready to be worked label Feb 20, 2023
@github-actions
Copy link
Contributor

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

@mariaa144
Copy link
Author

@SgtPooki I tried the changes in my config, I restarted IPFS but I still got the same errors. Do you have any other suggestions for me to try?

@SgtPooki
Copy link
Member

SgtPooki commented Mar 6, 2023

That's the best I can think of until Pinata updates or we solve this error.

@lidel do you have any suggestions?

@github-actions
Copy link
Contributor

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

@github-actions
Copy link
Contributor

This issue was closed because it is missing author input.

@mulder1628
Copy link

why is bot keep closing issues not resolved? I hit this error today, and similar issues got resolved with no real solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/pinning Integrating pinning into GUI apps exp/intermediate Prior experience is likely helpful kind/maintenance Work required to avoid breaking changes or harm to project's status quo kind/stale kind/support A question or request for support need/author-input Needs input from the original author P3 Low: Not priority right now topic/dependencies Topic dependencies topic/interop Interoperability
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants