Wrong type adaption for BLOB in scrapyd sqlite3 utils
See original GitHub issueWhen I execute
curl http://localhost:6800/schedule.json -d project=default -d spider=spider1
I go to scrapyd console and I see the Exception:
[-] Unhandled Error
Traceback (most recent call last):
File "/home/scrapyV1/venv/lib/python2.7/site-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(*args, **kw)
File "/home/scrapyV1/venv/lib/python2.7/site-packages/twisted/internet/defer.py", line 1274, in unwindGenerator
return _inlineCallbacks(None, gen, Deferred())
File "/home/scrapyV1/venv/lib/python2.7/site-packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks
result = g.send(result)
File "/home/scrapyV1/venv/lib/python2.7/site-packages/scrapyd/poller.py", line 23, in poll
msg = yield maybeDeferred(q.pop)
--- <exception caught here> ---
File "/home/scrapyV1/venv/lib/python2.7/site-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(*args, **kw)
File "/home/scrapyV1/venv/lib/python2.7/site-packages/scrapyd/spiderqueue.py", line 21, in pop
return self.q.pop()
File "/home/scrapyV1/venv/lib/python2.7/site-packages/scrapyd/sqlite.py", line 119, in pop
return self.decode(msg)
File "/home/scrapyV1/venv/lib/python2.7/site-packages/scrapyd/sqlite.py", line 170, in decode
return json.loads(text)
File "/usr/local/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python2.7/json/decoder.py", line 382, in raw_decode
obj, end = self.scan_once(s, idx)
exceptions.ValueError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
After that I can’t run next Spider, I get
{"status": "error", "message": "No JSON object could be decoded", "node_name": "spider-test2"}
How to determine what that error is related to?
Issue Analytics
- State:
- Created 7 years ago
- Comments:32 (19 by maintainers)
Top Results From Across the Web
Developers - Wrong type adaption for BLOB in scrapyd sqlite3 utils -
When I execute. curl http://localhost:6800/schedule.json -d project=default -d spider=spider1. I go to scrapyd console and I see the Exception:
Read more >Integer becomes blob - SQLite Forum
Hello, recently I moved all my data to an SQLite database, it is about 17million records and at a random record instead of...
Read more >sqlite-utils command-line tool
The sqlite-utils query command lets you run queries directly against a SQLite ... Binary strings are not valid JSON, so BLOB columns containing...
Read more >Unsupported type error in sqlite3 using python - Stack Overflow
I know I made some error in asigning proper datatype to the sqlite table. How can I find the error causing column and...
Read more >Adapting and Converting SQLite Data Types for Python
So, a registered converter would have converted the BLOB values, too. Get Our Python Developer Kit for Free. I put together a Python...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Finally! But you also need to add
self.conn.text_factory = bytes
to SqliteDict class after connect creation. Now everything works perfectly! Thank you!Probably a bug in sqlite or the python module. Try this: