Authorization header problem - push to datastore fails - HTTP status code: 400
- Dominant language
- Python
- Stars
- 82
- Forks
- 157
- PR merge metrics
- No merged PRs in 30d
Description
When trying to use datapusher, it would consistently fail.
Datapusher log:
```
ckan | 2017-02-23 21:58:40,052 INFO [ckan.lib.base] /dataset/test-4/resource_data/1aec102a-035e-4f7b-856b-e9eaf49510d8 render time 0.144 seconds
ckan | 2017-02-23 21:58:40,451 INFO [ckan.lib.base] /dataset/49de5ea7-29c2-431f-ab27-eaaf74d9469b/resource/1aec102a-035e-4f7b-856b-e9eaf49510d8/download/techcrunchcontinentalusa-2.csv render time 0.461 seconds
ckan | 2017-02-23 21:58:40,520 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
ckan | 2017-02-23 21:58:40,645 INFO [ckan.lib.base] /api/3/action/datapusher_hook render time 0.015 seconds
ckan_datapusher | --------------------------------------------------------------------------------
ckan_datapusher | ERROR in scheduler [/usr/lib/python2.7/site-packages/apscheduler/scheduler.py:520]:
ckan_datapusher | Job "push_to_datastore (trigger: RunTriggerNow, run = True, next run at: None)" raised an exception
ckan_datapusher | --------------------------------------------------------------------------------
ckan_datapusher | Traceback (most recent call last):
ckan_datapusher | File "/usr/lib/python2.7/site-packages/apscheduler/scheduler.py", line 512, in _run_job
ckan_datapusher | retval = job.func(*job.args, **job.kwargs)
ckan_datapusher | File "build/bdist.linux-x86_64/egg/datapusher/jobs.py", line 321, in push_to_datastore
ckan_datapusher | request_url=resource.get('url'), response=e.read())
ckan_datapusher | HTTPError
```
Ckan HTML Log:
```
Error: DataPusher received a bad HTTP response when trying to download the data file
HTTP status code: 400
Response: InvalidArgumentAuthorization header is invalid -- one and only one ' ' (space) requiredAuthorization
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with datapusher/jobs.py around push_to_datastore and inspect the authorization-header change in commit 2394e81c47205abe7df4be7215aa66fa63bedc1e. Reproduce the 400 response with the provided CKAN and DataPusher versions, comparing public and private resources; done means downloads work without the invalid Authorization header while private-file access remains supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- api, authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100