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

[Bug Report] Unexpected token: <EOF> at line 1, column 1 #295

Closed
afknst opened this issue Apr 18, 2022 · 2 comments
Closed

[Bug Report] Unexpected token: <EOF> at line 1, column 1 #295

afknst opened this issue Apr 18, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@afknst
Copy link

afknst commented Apr 18, 2022

Describe the bug
One day I suddenly got "HTTP 500: Internal server error. Please try again later." from the HOME and LIBRARY pages.
And from terminal log:
[ERROR] 2022/04/18 13:35:39 | Unexpected token: <EOF> at line 1, column 1

Then I tried to upgrade (from v0.26.0 to v0.26.2), to delete the database and regenerate, to recompile de docker image, nothing worked.
I was thinking that a file in my library may be damaged. But the scanner works fine, I got the error only when I access the main page. So I don't know.

To Reproduce
I don't know.

Expected behavior
Functioning normally.

Environment (please complete the following information):

  • OS: docker / arm32v7
  • Browser chrome
  • Mango Version 0.26.0, 0.26.1, 0.26.2

Docker (if you are running Mango in a Docker container)
It's not a problem of docker.

Additional context
2022-04-18 15 42 23 raspberrypi 255f011ac2f1
2022-04-18 15 42 35 raspberrypi 815023484b59

@afknst afknst added the bug Something isn't working label Apr 18, 2022
@afknst
Copy link
Author

afknst commented Apr 18, 2022

Searched a bit and I think this may be a problem of crystal json parser.
It works well after deleting all generated json files.
Please, stop managing reading process by the creepy json files. You have a sql database to do that.

Solution, in the library, run
find . -type f -name '*.json' -exec rm {} \;

Btw you'll lose all your reading process if you do this.
I did it since I don't know which json file is damaged and I was too lazy to find out.

@KandyWrong
Copy link

For anyone who stumbles across this same problem and doesn't want to go through a bazillion JSON files to find the broken one, here's a quick work-around.

First, install jsonlint-php with:
sudo apt install jsonlint-php

(substitute the package manager for whatever distro you're using)

Then run this command inside your manga directory:
find . -name \*.json -print0 | xargs -0I {} jsonlint-php -q '{}'

I stole all this from https://superuser.com/a/699897

You might be able to repair the broken JSON. I just deleted it and mango regenerated it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants