[ckan-dev] How to debug problem with overridden package controller?

Bruce Crevensten becrevensten at alaska.edu
Wed Feb 4 18:53:06 UTC 2015


Hi,

I've overridden the 'before_view' method of the IPackageController per the
documentation (which is excellent) and am using that to make some
additional fields available to customize the display of our data sets.  For
the most part, this is working fine and seems like the right approach,
using code along the lines of:

pkg_dict['custom_vield'] = 'value'

...then returning the modified pkg_dict at the end of the before_view
method.

But I've run into a problem with one particular data set and I don't
understand where to see the cause of the error.

The symptom is that none of my additional fields show up in the debug info
on the page, for example if I toggle the variable display showing variables
available to a snippet, I see this:

extent: u'{"type": "Point", "coordinates": [0.0, 90.0]}'
temporal_start: Undefined
spatial_resolution: Undefined
temporal_end: Undefined

...where 'temporal_start', 'temporal_end' and 'spatial_resolution' are some
fields that I set up in my before_view method.

There's no Jinja2 error dump.  I've got my dev instance configured to be in
debug mode.  The only log reference seems to indicate that an error is
occurring somewhere, but it doesn't give me a good clue about where to look
-- the output from my /var/log/httpd/ckan.error.log shows this when I
render this data set:

[Wed Feb 04 18:40:15 2015] [error] 2015-02-04 18:40:15,169 INFO
 [ckan.lib.base]
 /dataset/projected-daily-quantile-mapped-near-surface-wind-velocity-2-5-degrees-cmip5-ar5
render time 0.996 seconds
[Wed Feb 04 18:40:15 2015] [error] 2015-02-04 18:40:15,760 INFO
 [ckan.lib.base]  /api/i18n/en render time 0.002 seconds

...and the ckan.custom.log file doesn't have any information either.

What is the right strategy for debugging this type of error?

-- 
*Bruce Crevensten*


*Senior Software Engineer*
(SNAP) Scenarios Network for Alaska & Arctic Planning
www.snap.uaf.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20150204/f3d858c1/attachment-0002.html>


More information about the ckan-dev mailing list