ipfs / ipfs-desktop

An unobtrusive and user-friendly desktop application for IPFS on Windows, Mac and Linux.
https://docs.ipfs.tech/install/ipfs-desktop/
MIT License
5.86k stars 850 forks source link

[gui error report] SyntaxError: Unexpected end of JSON input: The system cannot find the pa #2731

Closed mohammedpatla closed 4 months ago

mohammedpatla commented 5 months ago

👉️ Please describe what you were doing when this error happened.

After install and startup, i might have some cache files from an older installation that are probably breaking something.

Specifications

Error


SyntaxError: Unexpected end of JSON input: The system cannot find the path specified.
    at JSON.parse (<anonymous>)
    at Daemon._getConfig (C:\Users\<USERNAME>-PC\AppData\Local\Programs\IPFS Desktop\resources\app.asar\node_modules\ipfsd-ctl\src\ipfsd-daemon.js:368:21)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Daemon.init (C:\Users\<USERNAME>-PC\AppData\Local\Programs\IPFS Desktop\resources\app.asar\node_modules\ipfsd-ctl\src\ipfsd-daemon.js:158:9)
    at async getIpfsd (C:\Users\<USERNAME>-PC\AppData\Local\Programs\IPFS Desktop\resources\app.asar\src\daemon\daemon.js:63:7)
    at async startDaemon (C:\Users\<USERNAME>-PC\AppData\Local\Programs\IPFS Desktop\resources\app.asar\src\daemon\daemon.js:210:17)
    at async startIpfs (C:\Users\<USERNAME>-PC\AppData\Local\Programs\IPFS Desktop\resources\app.asar\src\daemon\index.js:49:17)
    at async setupDaemon (C:\Users\<USERNAME>-PC\AppData\Local\Programs\IPFS Desktop\resources\app.asar\src\daemon\index.js:116:3)
    at async Promise.all (index 1)
    at async run (C:\Users\
whizzzkid commented 5 months ago

Thanks for opening this issue @mohammedpatla looks like the config file seems to missing, can you confirm ~/.ipfs/config exists and is valid json? Also can you please attach additional log files that can be found here to investigate this further?

mohammedpatla commented 5 months ago

@whizzzkid i crosschecked this file does not exist. Like i installed it using the Windows GUI tool, so I'm not sure if this is supposed to be automatically created.

mohammedpatla commented 5 months ago

Yea i cant seem to find log files, in the directory's as there is nothing named ipfs.log. the only log i get is the one when i launch

image image
SgtPooki commented 5 months ago

@mohammedpatla

I am not sure why the config file wasn't created for you on the new run. I'm looking into this now, because we've had this error for a while.

I was able to create a fresh config file via the below code:

mktemp -d tmpIpfs
IPFS_PATH=tmpIpfs npx kubo@0.25.0 init

which gave me the following at ./tmpIpfs/config:

{
  "Identity": {
    "PeerID": "12D3KooWQq54cuz1sHuerjJsiXAKiNmVuRmmVRdjioGjsrsEvq8h",
    "PrivKey": "CAESQHNnYZBO8UUlztAK2S5Vvj599JxezoVQfwedgRkl/TSe3w2LGNkcF705qvZhvABMgMf+WBF/AyavCcN+aqHptRY="
  },
  "Datastore": {
    "StorageMax": "10GB",
    "StorageGCWatermark": 90,
    "GCPeriod": "1h",
    "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"
    },
    "HashOnRead": false,
    "BloomFilterSize": 0
  },
  "Addresses": {
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4001",
      "/ip6/::/tcp/4001",
      "/ip4/0.0.0.0/udp/4001/quic-v1",
      "/ip4/0.0.0.0/udp/4001/quic-v1/webtransport",
      "/ip6/::/udp/4001/quic-v1",
      "/ip6/::/udp/4001/quic-v1/webtransport"
    ],
    "Announce": [],
    "AppendAnnounce": [],
    "NoAnnounce": [],
    "API": "/ip4/127.0.0.1/tcp/5001",
    "Gateway": "/ip4/127.0.0.1/tcp/8080"
  },
  "Mounts": {
    "IPFS": "/ipfs",
    "IPNS": "/ipns",
    "FuseAllowOther": false
  },
  "Discovery": {
    "MDNS": {
      "Enabled": true
    }
  },
  "Routing": {
    "AcceleratedDHTClient": false,
    "Routers": null,
    "Methods": null
  },
  "Ipns": {
    "RepublishPeriod": "",
    "RecordLifetime": "",
    "ResolveCacheSize": 128
  },
  "Bootstrap": [
    "/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-v1/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN"
  ],
  "Gateway": {
    "HTTPHeaders": {},
    "RootRedirect": "",
    "PathPrefixes": [],
    "APICommands": [],
    "NoFetch": false,
    "NoDNSLink": false,
    "DeserializedResponses": null,
    "DisableHTMLErrors": null,
    "PublicGateways": null,
    "ExposeRoutingAPI": null
  },
  "API": {
    "HTTPHeaders": {}
  },
  "Swarm": {
    "AddrFilters": null,
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "RelayClient": {},
    "RelayService": {},
    "Transports": {
      "Network": {},
      "Security": {},
      "Multiplexers": {}
    },
    "ConnMgr": {},
    "ResourceMgr": {}
  },
  "AutoNAT": {},
  "Pubsub": {
    "Router": "",
    "DisableSigning": false
  },
  "Peering": {
    "Peers": null
  },
  "DNS": {
    "Resolvers": {}
  },
  "Migration": {
    "DownloadSources": [],
    "Keep": ""
  },
  "Provider": {
    "Strategy": ""
  },
  "Reprovider": {},
  "Experimental": {
    "FilestoreEnabled": false,
    "UrlstoreEnabled": false,
    "Libp2pStreamMounting": false,
    "P2pHttpProxy": false,
    "StrategicProviding": false,
    "OptimisticProvide": false,
    "OptimisticProvideJobsPoolSize": 0
  },
  "Plugins": {
    "Plugins": null
  },
  "Pinning": {
    "RemoteServices": {}
  },
  "Internal": {}
}

You could save that json to a ~/.ipfs/config file and try to restart IPFS-Desktop yourself, or run npx kubo@0.25.0 init in your terminal yourself to generate your own config.

let me know if you have any trouble.. it might be a while until I get a fix out that will self-heal scenarios like this.

mohammedpatla commented 5 months ago

@SgtPooki i further looked at this and i found a config.json file in C:\Users\\AppData\Roaming\IPFS Desktop

The config.json looks like this

{
    "ipfsConfig": {
        "type": "go",
        "path": "C:\\Users\\Mohammeds-PC\\.ipfs",
        "flags": [
            "--migrate",
            "--enable-gc",
            "--agent-version-suffix=desktop"
        ],
        "keysize": 2048
    },
    "language": "en-US",
    "experiments": {
        "npmOnIpfs": false
    },
    "__internal__": {
        "migrations": {
            "version": "0.32.0"
        }
    },
    "openWebUIAtLaunch": false,
    "ipfsOnPath": true,
    "autoLaunch": true,
    "checkedCorsConfig": true,
    "window": {
        "width": 1260,
        "height": 715
    },
    "daemonConfigRevision": 1,
    "binaryPath": "C:\\Users\\Mohammeds-PC\\Downloads\\ipfs\\ipfs"
}

And here is an error log from the error.log file

2024-02-01T17:01:44.917Z error: [i18n] init error
2024-02-01T17:01:44.917Z error: Error: ENOENT, assets\locales\en-US.json not found in C:\Users\<My-Username>\AppData\Local\Programs\IPFS Desktop\resources\app.asar
2024-02-01T17:01:45.052Z error: Error: Error: net::ERR_INTERNET_DISCONNECTED
    at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:101:7169)
    at SimpleURLLoaderWrapper.emit (node:events:526:28)
2024-02-01T17:01:45.052Z error: [updater] Error: net::ERR_INTERNET_DISCONNECTED
2024-02-01T17:01:45.108Z error: Unexpected end of JSON input: The system cannot find the path specified.
2024-02-01T17:02:01.854Z error: [splashScreen] loadFile failed
2024-02-01T17:02:01.854Z error: ERR_FAILED (-2) loading 'file:///C:\Users\<My-Username>\AppData\Local\Programs\IPFS Desktop\resources\app.asar\assets\pages\splash.html'
2024-02-02T18:06:58.646Z error: [i18n] init error
2024-02-02T18:06:58.646Z error: Error: ENOENT, assets\locales\en-US.json not found in C:\Users\<My-Username>\AppData\Local\Programs\IPFS Desktop\resources\app.asar
2024-02-02T18:06:58.794Z error: Unexpected end of JSON input: The system cannot find the path specified.
2024-02-02T18:29:31.666Z error: Error: Error: net::ERR_TIMED_OUT
    at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:101:7169)
    at SimpleURLLoaderWrapper.emit (node:events:526:28)
2024-02-02T18:29:31.667Z error: [updater] Error: net::ERR_TIMED_OUT
2024-02-02T18:29:31.705Z error: [splashScreen] loadFile failed
2024-02-02T18:29:31.706Z error: ERR_FAILED (-2) loading 'file:///C:\Users\<My-Username>\AppData\Local\Programs\IPFS Desktop\resources\app.asar\assets\pages\splash.html'

What i am not sure of is if this config file is loaded during launch? It could be as simple as wrong path ~/.ipfs/config does not exist in Windows its either under AppData or under Program Files.

Would you also like me to try replacing the above config with this and try again?

Also is it config or config.json?

SgtPooki commented 5 months ago

it seems like a lot of files are missing. I would attempt to remove the application entirely, including all data at C:\Users\<My-Username>\AppData\Local\Programs\IPFS Desktop and $HOME/.ipfs and re-install

SgtPooki commented 5 months ago

the config file at $HOME/.ipfs/config does not have a .json extension, but it's contents ARE json

mohammedpatla commented 5 months ago

it seems like a lot of files are missing. I would attempt to remove the application entirely, including all data at C:\Users\<My-Username>\AppData\Local\Programs\IPFS Desktop and $HOME/.ipfs and re-install

Now i am always stuck at

image

I tried to even restart my computer after uninstall but some service is blocking the installation i am not sure which?

When i ignore and move this forward then i run into

image image

Where it wont open up anyways.

SgtPooki commented 5 months ago

You may need to use the windows task manager to close any running processes.

mohammedpatla commented 5 months ago

You may need to use the windows task manager to close any running processes.

There is none running, though I already checked.

SgtPooki commented 5 months ago

your files & install became corrupted somehow. deleting files manually (after making sure IPFS Desktop is not running), and re-installing IPFS-Desktop, is really the only path forward that I can think of in this scenario.

If windows is saying that it's still running, then it probably is. I don't know what else to say.

mohammedpatla commented 5 months ago

your files & install became corrupted somehow. deleting files manually (after making sure IPFS Desktop is not running), and re-installing IPFS-Desktop, is really the only path forward that I can think of in this scenario.

If windows is saying that it's still running, then it probably is. I don't know what else to say.

So i noticed, when i install in a different directory the above error pops up ( i think its because i am not running installer as admin). If i install in the same directory (local/programs) then i run into the same startup problem.

But i got it running by doign the following:

github-actions[bot] commented 4 months ago

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[bot] commented 4 months ago

This issue was closed because it is missing author input.