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

Jason Tan jason.tan at ersa.edu.au
Thu Jul 3 23:19:39 UTC 2014


Hi Eli,

I'm not familiar with data pusher, but it actually looks like your problem
is more generic.

Here are some questions I'd ask my self and things I'd do:

Confirmed that example.com resolves correctly from the host nginx is
running on?
The "DNS lookup failed" message tends to make me think the DNS name
example.com is not resolving.
In fact I'd do an nslookup for example.com on the app server (ckan) host,
the nginx host and the client host.

And have a look at the 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*
<http://example.com/api/3/action/resource_show>. Response: <html>\r

No "/ckan/"  - is that correct? Should it now be "
http://example.com//ckan/api/3/action/resource_show
<http://example.com/api/3/action/resource_show>". Where does that "
http://example.com/api/3/action/resource_show" URL come from?

My guess is if the mod_wsgi ScriptAlias does what you think it does tht API
will be found under example.com/ckan/api etc now.


Regards
Jason Tan


On 3 July 2014 21: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
>
>


-- 
Jason Tan
Data Infrastructure Specialist, eResearch SA

phone: +61 8 8313 2184
Mob: +61 407 268 270
email: jason.tan at ersa.edu.au
web: http://www.ersa.edu.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140704/50663581/attachment-0003.html>


More information about the ckan-dev mailing list