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

dat unpublish fails with SyntaxError: Unexpected end of JSON input #1058

Open
CristianCantoro opened this issue Dec 19, 2018 · 0 comments
Open

Comments

@CristianCantoro
Copy link

(I am coming from dat-ecosystem-archive/datBase#637)

I am reporting:

  • a bug or unexpected behavior

Please give us details about your installation to assist you. Run dat -v to see the version of Dat you are using.

  • Operating system:
  • Node Version:
  • Dat Version:

Expected behavior

dat unpublish unpublishes the dat.

Actual behavior

The program crashes with an error.

$ dat unpublish
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /home/cconsonni/.dotfiles/nvm/.nvm/versions/node/v10.14.0/lib/node_modules/dat/node_modules/toiletdb/index.js:73:29
    at /home/cconsonni/.dotfiles/nvm/.nvm/versions/node/v10.14.0/lib/node_modules/dat/node_modules/hyperdrive/index.js:537:5
    at f (/home/cconsonni/.dotfiles/nvm/.nvm/versions/node/v10.14.0/lib/node_modules/dat/node_modules/once/once.js:25:25)
    at Class.<anonymous> (/home/cconsonni/.dotfiles/nvm/.nvm/versions/node/v10.14.0/lib/node_modules/dat/node_modules/stream-collector/index.js:15:5)
    at Class.emit (events.js:187:15)
    at endReadableNT (/home/cconsonni/.dotfiles/nvm/.nvm/versions/node/v10.14.0/lib/node_modules/dat/node_modules/readable-stream/lib/_stream_readable.js:1010:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Debug Logs

$ DEBUG=dat* dat unpublish
  dat Dat DEBUG mode engaged, enabling quiet mode +0ms
  dat dat 13.11.4 +18ms
  dat node v10.14.0 +1ms
  dat-node archive ready. version: 1446 +0ms
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /home/cconsonni/.dotfiles/nvm/.nvm/versions/node/v10.14.0/lib/node_modules/dat/node_modules/toiletdb/index.js:73:29
    at /home/cconsonni/.dotfiles/nvm/.nvm/versions/node/v10.14.0/lib/node_modules/dat/node_modules/hyperdrive/index.js:537:5
    at f (/home/cconsonni/.dotfiles/nvm/.nvm/versions/node/v10.14.0/lib/node_modules/dat/node_modules/once/once.js:25:25)
    at Class.<anonymous> (/home/cconsonni/.dotfiles/nvm/.nvm/versions/node/v10.14.0/lib/node_modules/dat/node_modules/stream-collector/index.js:15:5)
    at Class.emit (events.js:187:15)
    at endReadableNT (/home/cconsonni/.dotfiles/nvm/.nvm/versions/node/v10.14.0/lib/node_modules/dat/node_modules/readable-stream/lib/_stream_readable.js:1010:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Seeing this bug "pretty-printed json fails to parse w/ dat --json" (#37), I have compacted my dat.json, but the error persists.

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

1 participant