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

[gui error report] SyntaxError: Unexpected end of JSON input #2000

Closed
agrohs opened this issue Mar 2, 2022 · 8 comments
Closed

[gui error report] SyntaxError: Unexpected end of JSON input #2000

agrohs opened this issue Mar 2, 2022 · 8 comments
Labels
area/linux Linux area/macos MacOS kind/bug A bug in existing code (including security flaws) need/author-input Needs input from the original author need/triage Needs initial labeling and prioritization

Comments

@agrohs
Copy link

agrohs commented Mar 2, 2022

Please describe what you were doing when this error happened.

Specifications

  • OS: darwin
  • IPFS Desktop Version: 0.20.0
  • Electron Version: 17.1.0
  • Chrome Version: 98.0.4758.102

Error

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Daemon._getConfig (/Applications/IPFS Desktop.app/Contents/Resources/app.asar/node_modules/ipfsd-ctl/src/ipfsd-daemon.js:365:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Daemon.init (/Applications/IPFS Desktop.app/Contents/Resources/app.asar/node_modules/ipfsd-ctl/src/ipfsd-daemon.js:157:9)
    at async spawn (/Applications/IPFS Desktop.app/Contents/Resources/app.asar/src/daemon/daemon.js:55:3)
    at async module.exports (/Applications/IPFS Desktop.app/Contents/Resources/app.asar/src/daemon/daemon.js:143:31)
    at async startIpfs (/Applications/IPFS Desktop.app/Contents/Resources/app.asar/src/daemon/index.js:46:17)
    at async module.exports (/Applications/IPFS Desktop.app/Contents/Resources/app.asar/src/daemon/index.js:114:3)
    at async run (/Applications/IPFS Desktop.app/Contents/Resources/app.asar/src/index.js:83:5)
@agrohs agrohs added the need/triage Needs initial labeling and prioritization label Mar 2, 2022
@welcome

This comment was marked as resolved.

@lidel lidel changed the title [gui error report] [gui error report] SyntaxError: Unexpected end of JSON input Mar 3, 2022
@lidel
Copy link
Member

lidel commented Mar 3, 2022

The error originates from https://github.com/ipfs/js-ipfsd-ctl/blob/66a947010b0dbc90074c29724fd64c5bbc9a8eed/src/ipfsd-daemon.js#L365 which suggests reading config via ipfs config show fails due to some error – tracked in ipfs/js-ipfsd-ctl#721

@agrohs @realitymeetsdreams

  • are you able to run ipfs config show ?
  • is your $IPFS_PATH/config a valid JSON?

@hacdias
Copy link
Member

hacdias commented Mar 11, 2022

The error originates from ipfs/js-ipfsd-ctl@66a9470/src/ipfsd-daemon.js#L365 which suggests reading config via ipfs config show fails due to some error – tracked in ipfs/js-ipfsd-ctl#721

@agrohs @realitymeetsdreams

  • are you able to run ipfs config show ?
  • is your $IPFS_PATH/config a valid JSON?

Same questions for you @goralbaris @avelguenin 😄

@avelguenin
Copy link

Thanks for your attention.

ipfs config show returns what seems like a valid JSON file.
I am not sure how to find "IPFS_PATH/config as which ipfs returns /snap/bin/ipfs, which is not a folder. /snap contains ipfs and ipfs-desktop, but I cannot find a .config in either folder's arborescence.

@realitymeetsdreams
Copy link

realitymeetsdreams commented Mar 12, 2022 via email

@lidel
Copy link
Member

lidel commented Mar 14, 2022

@avelguenin Snap confinement issues are separate topic. They could produce the same Unexpected end of JSON input error, but we have no bandwidth to investigate. Let's wait for https://forum.snapcraft.io/t/ipfs-desktop-classic-review/28517 first.

@realitymeetsdreams please download and manually install the latest DMG from IPFS-Desktop-0.20.1.dmg (override the old version in your Applications).

If you continue experiencing this problem, Quit IPFS Desktop, and remove two files:

  • /Users/your-user/.ipfs/config
  • /Users/your-user/.ipfs/api

(you can find out your-user via whoami)

Then, start IPFS Desktop again. It will re-create config with default values, fixing any file corruption you might produce the Unexpected end of JSON input error.

Lmk if this helped

@lidel lidel added need/author-input Needs input from the original author and removed need/analysis Needs further analysis before proceeding labels Mar 14, 2022
@avelguenin
Copy link

I did not remember Snap was community maintained. I'll reinstall through standard procedure. Thanks for your answer.

@lidel
Copy link
Member

lidel commented Mar 23, 2022

I'm closing this as a duplicate of #2050

@lidel lidel closed this as completed Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/linux Linux area/macos MacOS kind/bug A bug in existing code (including security flaws) need/author-input Needs input from the original author need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

5 participants