[ckan-dev] Error when editing dataset name

Rachel Knowler rachel.knowler at liip.ch
Fri Jun 13 10:13:54 UTC 2014


Hi dev list,

I'm writing a CKAN extension to add some custom metadata fields to 
datasets, and allow manual editing of them. I followed these 
instructions and had no problems: 
https://github.com/ckan/ckan/wiki/How-to-Add-Custom-Fields-to-CKAN-2.0

However, I ran into trouble when adding the dataset name as a field on 
the edit page. With this field included in the template 
package/snippets/package_metadata_fields.html, any attempt to update the 
dataset gives the response 500 Server Error. This happens even if no 
values have been changed.

Server logs from an example attempt:

==> ckan_default.error.log <==
[Fri Jun 13 09:59:43 2014] [error] [client 172.94.43.1] Error - <type 
'exceptions.TypeError'>: expected string or buffer
[Fri Jun 13 09:59:43 2014] [error] 2014-06-13 09:59:43,154 INFO 
[ckan.lib.base]  /dataset/edit/stst_schulwesen render time 0.021 seconds

==> ckan_default.custom.log <==
172.94.43.1 - - [13/Jun/2014:09:59:43 +0000] "POST 
/dataset/edit/stst_schulwesen HTTP/1.1" 500 7583 
"http://stadtzh.lo/dataset/edit/stst_schulwesen" "Mozilla/5.0 (X11; 
Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0"

==> ckan_default.error.log <==
[Fri Jun 13 09:59:43 2014] [error] 2014-06-13 09:59:43,352 INFO 
[ckan.lib.base]  /api/i18n/de render time 0.018 seconds

==> ckan_default.custom.log <==
172.94.43.1 - - [13/Jun/2014:09:59:43 +0000] "GET /api/i18n/de HTTP/1.1" 
200 1949 "http://stadtzh.lo/dataset/edit/stst_schulwesen" "Mozilla/5.0 
(X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0"

---

I've replicated this on my local CKAN instance and on a Digital Ocean 
server (both using Vagrant boxes). I've tried redirecting the return 
URLs as described here 
(http://docs.ckan.org/en/769-docs-reorg/form-integration.html) but this 
made no difference.

Can anybody see where the problem is? Thanks a lot.

- Rachel

-- 
Liip AG // Limmatstrasse 183 // CH-8005 Zürich
Tel +41 43 500 39 80 // Mob +41 78 658 26 12 // www.liip.ch




More information about the ckan-dev mailing list