-
Notifications
You must be signed in to change notification settings - Fork 22
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 is not JSON serializable #26
Comments
Can you update the settings.py or run logparser with “-v” to print more info? logparser/logparser/settings.py Lines 79 to 80 in ed7948b
|
When I run the logparser with the "-v" option inside the container, I only got this output: ****************************************************************************************************
Loading settings from /usr/lib/python3.11/site-packages/logparser/settings.py
****************************************************************************************************
****************************************************************************************************
Visit stats at: http://127.0.0.1:6800/logs/stats.json
****************************************************************************************************
{"downloader/request_bytes": 279,
"downloader/request_count": 1,
"downloader/request_method_count/GET": 1,
"downloader/response_bytes": 379076,
"downloader/response_count": 1,
"downloader/response_status_count/200": 1,
"elapsed_time_seconds": 82.607657,
"feedexport/success_count/FileFeedStorage": 2,
"finish_reason": "finished",
"finish_time": "datetime.datetime(2024, 12, 27, 0, 2, 58, 283984, tzinfo=datetime.timezone.utc)",
"item_scraped_count": 442,
"items_per_minute": None,
"log_count/DEBUG": 448,
"log_count/INFO": 15,
"log_count/WARNING": 2,
"memusage/max": 119156736,
"memusage/startup": 110751744,
"response_received_count": 1,
"responses_per_minute": None,
"scheduler/dequeued": 1,
"scheduler/dequeued/memory": 1,
"scheduler/enqueued": 1,
"scheduler/enqueued/memory": 1,
"start_time": "datetime.datetime(2024, 12, 27, 0, 1, 35, 676327, tzinfo=datetime.timezone.utc)"}
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/logparser/common.py", line 163, in parse_crawler_stats
return json.loads(text)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 12 column 22 (char 486) However, I got the docker logs -f my-scrapper 2>&1 | grep "JSONDecodeError is not JSON serializable" And, the output would be like this: TypeError: Object of type JSONDecodeError is not JSON serializable
TypeError: Object of type JSONDecodeError is not JSON serializable
TypeError: Object of type JSONDecodeError is not JSON serializable
TypeError: Object of type JSONDecodeError is not JSON serializable
TypeError: Object of type JSONDecodeError is not JSON serializable I believe that the |
logparser reported an error in my docker container:
FYI, my container uses the alpine image.
The text was updated successfully, but these errors were encountered: