[ckan-dev] Resource preview error on non-root ckan

eli fericel elifericel at yahoo.com
Fri Jul 4 08:55:24 UTC 2014


Hi, 


In production.ini i  have :

ckan.site_url = http://example.com
After i changed in ckan.site_url = http://example.com/ckan, when creating new resource , 
upload is executing ok. Resource url showed is http://example.com/ckan/ckan/storage/f/2014-07-04T10%3A31%3A10.088Z/test.csv  (incorrect, ckan is twice). Now  error show up on download and on view new resource I just uploaded.

Error message from datapusher.error is:

Fetching from: http://example.com/ckan/ckan/storage/f/2014-07-04T10%3A12%3A23.597Z/test.csv
[Fri Jul 04 13:12:41 2014] [error] Job "push_to_datastore (trigger: RunTriggerNow, run = True, next run at: None)" raised an exception
[Fri Jul 04 13:12:41 2014] [error] Traceback (most
 recent call last):
[Fri Jul 04 13:12:41 2014] [error]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/APScheduler-2.1.1-py2.7.egg/apscheduler/scheduler.py", line 512, in _run_job
[Fri Jul 04 13:12:41 2014] [error]     retval = job.func(*job.args, **job.kwargs)
[Fri Jul 04 13:12:41 2014] [error]   File "/usr/lib/ckan/default/src/datapusher/datapusher/jobs.py", line 240, in push_to_datastore
[Fri Jul 04 13:12:41 2014] [error]     raise util.JobError('Invalid HTTP response: %s' % e)
[Fri Jul 04 13:12:41 2014] [error] JobError: Invalid HTTP response: HTTP Error 404: Not Found



I don't think it id DNS problem because i  replaced the domain name with ip address and error is the same.


URL in this  line:

'[Thu Jul 03 13:55:45 2014] [error] JobError: CKAN bad response. Status code: 404 Not Found. At: http://example.com/api/3/action/resource_show.'

is incorrect , /ckan is missing and i don't know which settings should be done to obtain correct url .

Thanks to all
Eli


On Friday, July 4, 2014 7:11 AM, Nigel Babu <nigel.babu at okfn.org> wrote:
 


You need to also set http://docs.ckan.org/en/latest/maintaining/configuration.html#ckan-site-url correctly.



Nigel Babu
Developer, Open Knowledge


On 3 July 2014 17:28, eli fericel <elifericel at yahoo.com> wrote:

Hi,
>
>
>I have installed ckan 2.1.1 with datapusher on Ubuntu 12.04. Running the whole thing works fine as root (example.com) through apache and proxy by nginx.
>I want to serve CKAN on a non-root URL (example.com/ckan). I made the following settings:
>
> - Changed
 'WSGIScriptAlias / /etc/ckan/default/apache.wsgi' in 'WSGIScriptAlias /ckan /etc/ckan/default/apache.wsgi' in  /etc/apache2/sites-available/ckan-default 
>
> - Changed 'location / { ' in 'location /ckan { ' in  /etc/nginx/sites-available/ckan 
>
> - Changed 'proxy_pass http://127.0.0.1:8080' in 'proxy_pass http://127.0.0.1:8080/ckan' in  /etc/nginx/sites-available/ckan 
>
> After this settings ckan is accessible on example.com/ckan. When creating new resource , upload is execute ok, download new resource is ok. There is an error that appears when I try to view the resource I just uploaded 
>
> "This resource can not be previewed at the moment.
> Could not load preview: DataProxy returned an error (Data transformation failed. error: An
 error occured while connecting to the server: DNS lookup failed for URL: http://example.com/ckan/storage/f/2014-07-03T10%3A55%3A34.762Z/test.csv"
>
>
> Also, in the datapusher.error.log there is an error message:
>
>[Thu Jul 03 13:55:45 2014] [error] Job "push_to_datastore (trigger: RunTriggerNow, run = True, next run at: None)" raised an exception
>[Thu Jul 03 13:55:45 2014] [error] Traceback (most recent call last):
>[Thu Jul 03 13:55:45 2014] [error]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/APScheduler-2.1.1-py2.7.egg/apscheduler/scheduler.py", line 512, in _run_job
>[Thu Jul 03 13:55:45 2014] [error]     retval = job.func(*job.args, **job.kwargs)
>[Thu Jul 03 13:55:45 2014] [error]   File
 "/usr/lib/ckan/default/src/datapusher/datapusher/jobs.py", line 232, in push_to_datastore
>[Thu Jul 03 13:55:45 2014] [error]     resource = get_resource(resource_id, ckan_url, api_key)
>[Thu Jul 03 13:55:45 2014] [error]   File "/usr/lib/ckan/default/src/datapusher/datapusher/jobs.py", line 186, in get_resource
>[Thu Jul 03 13:55:45 2014] [error]     check_response(r, url, 'CKAN')
>[Thu Jul 03 13:55:45 2014] [error]   File "/usr/lib/ckan/default/src/datapusher/datapusher/jobs.py", line 91, in check_response
>[Thu Jul 03 13:55:45 2014] [error]     resp=response.text[:200]))
>[Thu Jul 03 13:55:45 2014] [error] JobError: CKAN bad response. Status code: 404 Not Found. At: http://example.com/api/3/action/resource_show. Response: <html>\r
>[Thu Jul 03 13:55:45 2014] [error] <head><title>404 Not Found</title></head>\r
>[Thu Jul 03 13:55:45 2014] [error] <body bgcolor="white">\r
>[Thu Jul 03 13:55:45 2014] [error] <center><h1>404 Not Found</h1></center>\r
>[Thu Jul 03 13:55:45 2014] [error] <hr><center>nginx/1.1.19</center>\r
>[Thu Jul 03 13:55:45 2014] [error] </body>\r
>[Thu Jul 03 13:55:45 2014] [error] </html>\r
>
> Any help would be appreciated.
> Thanks in advance,
>
> Eli
>
>
>
>_______________________________________________
>ckan-dev mailing list
>ckan-dev at lists.okfn.org
>https://lists.okfn.org/mailman/listinfo/ckan-dev
>Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140704/516606b7/attachment-0003.html>


More information about the ckan-dev mailing list