[ckan-dev] ...not allowed by Access-Control-Allow-Origin, even though resource_proxy is enabled.

Dominik Moritz dominik.moritz at okfn.org
Fri Aug 9 10:06:48 UTC 2013


Hey,

In case you are interested in the source code, you can find the interesting part at [1]. 

What surprises me is that I get a `504 Gateway Time-out` error from nginx. However, the file is not very large (just 351k) and works perfectly fine in my local CKAN and on demo [2]. I don't think that an increased timeout will help since the file is small. Hopefully the 2.0.2/2.1 release will the issue.

Cheers,
Dominik

[1] https://github.com/okfn/ckanext-spatial/blob/master/ckanext/spatial/public/js/geojson_preview.js#L32
[2] http://demo.ckan.org/dataset/geojson-dk/resource/12916ca8-27f0-4e8b-b366-8c1f50a9bd12

On 9 Aug 2013, at 11:44, Adrià Mercader <adria.mercader at okfn.org> wrote:

> Hi Henrik,
> 
> Ignore the Access-Control-Allow-Origin error, this is caused because
> the way the GeoJSON preview is implemented it tries to do a CORS
> request first before trying the resource proxy. See eg
> http://demo.ckan.org/dataset/test-ntest/resource/bccc8d4e-e8bc-4248-91ff-63ba1528d1d4
> where you also get the error but the file is loaded fine.
> 
> I suspect there is a problem on the proxying itself. Does this happen
> on large GeoJSON files or on all of them?
> 
> Next versions of CKAN due on Tuesday (2.0.2 and 2.1) add support for
> streaming on the resource proxy [1], perhaps that will help although
> I'm not entirely familiar with this part of the code, Dominik may know
> more about it.
> 
> You could also try to increase the timeout limit on nginx.
> 
> Hope this helps,
> 
> Adrià
> 
> p.d. Great site btw!
> 
> [1] https://github.com/okfn/ckan/pull/989
> 
> On 8 August 2013 07:45, Henrik Aagaard Sørensen <BU1G at tmf.kk.dk> wrote:
>> I get the following error:
>> 
>> 
>> 
>> XMLHttpRequest cannot load
>> http://wfs-kbhkort.kk.dk/k101/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=k101:groenne_cykelruter&outputFormat=json&SRSNAME=EPSG:4326.
>> Origin http://data.kk.dk is not allowed by Access-Control-Allow-Origin.
>> 
>> 
>> 
>> Even though resource_proxy is enabled, which results in gateway timeout
>> (hopefully).
>> 
>> 
>> 
>> The site is on
>> http://data.kk.dk/dataset/gronne-cykelruter/resource/8d64d2e0-00d1-4ff4-a36d-4f0a34949576
>> 
>> 
>> 
>> Can anyone help me out on how to solve the issue?
>> 
>> 
>> 
>> This is the error-log:
>> 
>> [Thu Aug 08 08:44:38 2013] [error] [client 127.0.0.1] mod_wsgi (pid=1669):
>> Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'.
>> 
>> [Thu Aug 08 08:44:38 2013] [error] [client 127.0.0.1] IOError: failed to
>> write data
>> 
>> [Thu Aug 08 08:44:38 2013] [error] 2013-08-08 08:44:38,254 INFO
>> [ckan.lib.base]  /api/i18n/da render time 0.027 seconds
>> 
>> [Thu Aug 08 08:44:38 2013] [error] 2013-08-08 08:44:38,401 INFO
>> [ckanext.resourceproxy.controller] Proxify resource
>> 8d64d2e0-00d1-4ff4-a36d-4f0a34949576
>> 
>> 
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>> 

Dominik Moritz
CKAN developer  |  skype: d.moritz  |  @doobly_doo
The Open Knowledge Foundation
Empowering through Open Knowledge
http://okfn.org/  |  @okfn  |  http://ckan.org  |  @CKANproject

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130809/a83a7073/attachment-0001.sig>


More information about the ckan-dev mailing list