error['message'] is not a string
- Dominant language
- Python
- Stars
- 82
- Forks
- 157
- PR merge metrics
- No merged PRs in 30d
Description
I've got a setup with ckan 2.7.3 and datapusher 0.0.13.
When pressing 'upload to datastore' on a geojson resource, it updates with the message 'fetching from [..]', and hangs after that. Digging into the datapusher logs the following exception is found:
```
Fetching from: [redacted]
Error notifying listener
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/apscheduler/scheduler.py", line 239, in _notify_listeners
cb(event)
File "/usr/lib/python2.7/site-packages/ckanserviceprovider/web.py", line 184, in job_listener
db.mark_job_as_errored(job_id, error_object)
File "/usr/lib/python2.7/site-packages/ckanserviceprovider/db.py", line 419, in mark_job_as_errored
_update_job(job_id, update_dict)
File "/usr/lib/python2.7/site-packages/ckanserviceprovider/db.py", line 353, in _update_job
job_dict["error"] = _validate_error(job_dict["error"])
File "/usr/lib/python2.7/site-packages/ckanserviceprovider/db.py", line 329, in _validate_error
"error['message'] must be a string")
InvalidErrorObjectError: error['message'] must be a string
Job "push_to_datastore (trigger: RunTriggerNow, run = True, next run at: None)" raised an exception
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/apscheduler/scheduler.py", line 512, in _run_job
retval = job.func(*job.args, **job.kwargs)
File "/srv/app/src/datapusher/datapusher/jobs.py", line 412, in push_to_datastore
raise util.JobError(e)
JobError
```
The `error` object triggering this is `{u'message': ReadError('Can\'t read Excel file: XLRDError(\'Unsupported format, or corrupt file: Expected BOF record; found \\\'{\\\\n"type"\\\'\',)', )}`, coming from https://github.com/ckan/datapusher/blob/1538e496e5181f94a873f233651c9021f2e676e8/datapusher/jobs.py#L403-L412
The cause of this error is another question, but regardless of that the error handling should not raise an exception itself and consequently CKAN should receive an update with an appropriate message.
Happy to help out on this, but would probably need some guidance from someone who's a bit more familiar with this codebase.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.