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

JSONDecodeError: Expecting value #12

Open
Zanonia opened this issue Oct 8, 2017 · 2 comments
Open

JSONDecodeError: Expecting value #12

Zanonia opened this issue Oct 8, 2017 · 2 comments
Labels

Comments

@Zanonia
Copy link

Zanonia commented Oct 8, 2017

Hello

I have this error since today, whereas the script had been running without problems for months and nothing has changed on my system :

Traceback (most recent call last):
  File "./t2m", line 267, in <module>
    parser.dispatch()
  File "/root/.t2m/.t2m/lib/python3.5/site-packages/argh/helpers.py", line 55, in dispatch
    return dispatch(self, *args, **kwargs)
  File "/root/.t2m/.t2m/lib/python3.5/site-packages/argh/dispatching.py", line 174, in dispatch
    for line in lines:
  File "/root/.t2m/.t2m/lib/python3.5/site-packages/argh/dispatching.py", line 277, in _execute_command
    for line in result:
  File "/root/.t2m/.t2m/lib/python3.5/site-packages/argh/dispatching.py", line 260, in _call
    result = function(*positional, **keywords)
  File "./t2m", line 178, in one
    db = get_db()
  File "./t2m", line 34, in get_db
    return json.load(open("db.json", "r"))
  File "/usr/lib/python3.5/json/__init__.py", line 268, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 259 column 3 (char 8213)

Edit :
Apparently, the problem was due to poor data formatting in db.json.
I don't understand how this happened.
I solved the problem by rewriting a new db.json manually.

@Psycojoker
Copy link
Member

Hello,

That's weird, have you edited db.json by hand? I can't see any other situation where that could happen (or that would be a serious bug in the json python stl which I can't expect to happen for those kind of simple situations)

@Zanonia
Copy link
Author

Zanonia commented Oct 10, 2017

I didn't touch the db.json until t2m crashed.
I kept a copy of the original, I think the problem is the comma on line 259:

            865219095100313600,
            865303903293906944,
            865457539185483776,
            865468081333616640,
            865472026546364418,
            86548177475470,
  ,
            865488515278163969,
            865565397780754434,
            865582743744385024,

Can a large number of tweets to be transferred and a too frequent call of the script (the cron was on a 2min interval at this time) cause this kind of problems?

I also noticed in Nginx's error log that when the media attached to a tweet exceeded the size limit of the instance (1MB on mine), an upload was attempted every time you use t2m and this for several days.
I don't know if that deserves to open a new issue.

@Psycojoker Psycojoker added the bug label Apr 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants