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

Error when have multiple API or Gateway addresses #1091

Closed
alanshaw opened this issue Sep 6, 2019 · 6 comments · Fixed by #1092
Closed

Error when have multiple API or Gateway addresses #1091

alanshaw opened this issue Sep 6, 2019 · 6 comments · Fixed by #1092
Assignees
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@alanshaw
Copy link
Member

alanshaw commented Sep 6, 2019

2019-05-24T12:07:10.926Z error: Error: 36:68: execution error: System Events got an error: Can’t get login item "IPFS Desktop". (-1728)

    at ChildProcess.<anonymous> (/Applications/IPFS Desktop.app/Contents/Resources/app.asar/node_modules/applescript/lib/applescript.js:49:13)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
2019-09-06T11:36:35.896Z error: [ipfsd] addr must be a string, Buffer, or another Multiaddr
@alanshaw
Copy link
Member Author

alanshaw commented Sep 6, 2019

My IPFS config. Looks like it's something to do with the multiple addresses I have setup for API/Gateway?

⨎ cat ~/.ipfs/config 
{
  "API": {
    "HTTPHeaders": {
      "Access-Control-Allow-Credentials": [
        "true"
      ],
      "Access-Control-Allow-Methods": [
        "PUT",
        "POST",
        "GET"
      ],
      "Access-Control-Allow-Origin": [
        "http://example.com"
      ],
      "Server": [
        "go-ipfs/0.4.17"
      ]
    }
  },
  "Addresses": {
    "API": [
      "/ip4/127.0.0.1/tcp/5001",
      "/ip6/::1/tcp/5002"
    ],
    "Announce": [],
    "Gateway": ["/ip4/127.0.0.1/tcp/3003", "/ip4/0.0.0.0/tcp/3004"],
    "NoAnnounce": [],
    "Swarm": [
      "/ip4/0.0.0.0/tcp/3000",
      "/ip4/127.0.0.1/tcp/3001/ws"
    ]
  },
  "Bootstrap": [
    "/dnsaddr/bootstrap.libp2p.io/ipfs/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
    "/dnsaddr/bootstrap.libp2p.io/ipfs/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
    "/dnsaddr/bootstrap.libp2p.io/ipfs/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
    "/dnsaddr/bootstrap.libp2p.io/ipfs/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
    "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
    "/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
    "/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64",
    "/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
    "/ip6/2604:a880:1:20::203:d001/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
    "/ip6/2400:6180:0:d0::151:6001/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
    "/ip6/2604:a880:800:10::4a:5001/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64",
    "/ip6/2a03:b0c0:0:1010::23:1001/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
    "/ip4/127.0.0.1/tcp/4002/ipfs/QmSeJDTNXyVtGCKyjZ79HGknuLaEdttm7VreA1cwefNa39"
  ],
  "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,
      "Interval": 10
    }
  },
  "Experimental": {
    "FilestoreEnabled": false,
    "Libp2pStreamMounting": false,
    "P2pHttpProxy": false,
    "QUIC": false,
    "ShardingEnabled": false,
    "UrlstoreEnabled": false
  },
  "Gateway": {
    "APICommands": null,
    "HTTPHeaders": {
      "Access-Control-Allow-Headers": [
        "X-Requested-With",
        "Range"
      ],
      "Access-Control-Allow-Methods": [
        "GET"
      ],
      "Access-Control-Allow-Origin": [
        "*"
      ]
    },
    "PathPrefixes": [],
    "RootRedirect": "",
    "Writable": false
  },
  "Identity": {
    "PeerID": "QmaFBzZTyz3ibDumf9kUTno7xSFoa36ateG7uoithtY855",
    "PrivKey": "[REDACTED]"
  },
  "Ipns": {
    "RecordLifetime": "",
    "RepublishPeriod": "",
    "ResolveCacheSize": 128
  },
  "Mounts": {
    "FuseAllowOther": false,
    "IPFS": "/ipfs",
    "IPNS": "/ipns"
  },
  "Pubsub": {
    "DisableSigning": false,
    "Router": "",
    "StrictSignatureVerification": false
  },
  "Reprovider": {
    "Interval": "12h",
    "Strategy": "all"
  },
  "Routing": {
    "Type": "dht"
  },
  "Swarm": {
    "AddrFilters": null,
    "ConnMgr": {
      "GracePeriod": "20s",
      "HighWater": 900,
      "LowWater": 600,
      "Type": "basic"
    },
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "DisableRelay": false,
    "EnableRelayHop": false
  }
}

@hacdias
Copy link
Member

hacdias commented Sep 6, 2019

@alanshaw I believe the System Events error can be easily ignored (please try toggling Launch at login on settings to enable and disable to see if it seems to work). That error generally happens when we tell AutoLaunch to make sure it is disabled and it was never enabled so there it is not registered on the Login items. So can be ignored.

The true problem here is the ipfsd error I believe. As far as I can tell just by looking at your settings is that we assume config.Addresses.API/Gateway is a string and forgot the possibility of it being an array!

I will take a look at this ASAP.

@hacdias hacdias self-assigned this Sep 6, 2019
@hacdias hacdias added the kind/bug A bug in existing code (including security flaws) label Sep 6, 2019
@hacdias
Copy link
Member

hacdias commented Sep 6, 2019

@alanshaw go-ipfs config does not say API and Gateway can be arrays. Can they?

@alanshaw
Copy link
Member Author

alanshaw commented Sep 6, 2019

Since go-ipfs 0.4.18 - ipfs/go-ipfs-config#11

Any chance you can send a PR to fix the go-ipfs config documentation?

@hacdias
Copy link
Member

hacdias commented Sep 6, 2019

I will! Thanks!

@hacdias hacdias changed the title System Events got an error: Can’t get login item "IPFS Desktop" Error when have multiple API or Gateway addresses Sep 6, 2019
@hacdias
Copy link
Member

hacdias commented Sep 6, 2019

Hmm... Currently we check if the ports are available and suggest updating them if they're busy. Now I'm wondering... an array as the API or Gateway address implicates an infinite amount of port collisions...

Currently we have dialogs for:

  1. API+Gateway collision.
  2. API collision.
  3. Gateway collision.

I'm wondering if it's better to show a dialog per port collision with a button saying 'CHANGE ALL' and another with something like 'I'll solve it myself, dont ask more'. I doubt there will be many anyways... but it can happen! What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants