EnviDat / ckanext-composite

Extension for structured metadata fields based on ckanext-scheming and ckanext-repeating
GNU Affero General Public License v3.0
5 stars 20 forks source link

Resource support? #3

Closed timgiles closed 8 years ago

timgiles commented 8 years ago

Hi Lucia,

When I try to implement composite fields in the Resources section, I ge the following error:

[Sun Oct 23 15:27:50.482187 2016] [:error] [pid 38869:tid 140035570280192] 2016-10-23 15:27:50,482 DEBUG [ckanext.composite.validators] _(u'resources', 0, u'resChecksums'): u'[]' [Sun Oct 23 15:27:50.483839 2016] [:error] [pid 38869:tid 140035570280192] 2016-10-23 15:27:50,483 DEBUG [ckanext.composite.validators] (u'resources', 0, u'resChecksums'): u'[]' [Sun Oct 23 15:27:50.545759 2016] [:error] [pid 38869:tid 140035570280192] /usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py:79: SAWarning: Usage of the 'related attribute set' operation is not currently supported within the execution stage of the flush process. Results may not be consistent. Consider using alternative event listeners or connection-level operations instead. [Sun Oct 23 15:27:50.545787 2016] [:error] [pid 38869:tid 140035570280192] sess._flush_warning("related attribute set") [Sun Oct 23 15:27:50.559102 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] Error - <class 'sqlalchemy.exc.StatementError'>: <ckan.lib.navl.dictization_functions.Missing object at 0x7f5c8903add0> is not JSON serializable (original cause: TypeError: <ckan.lib.navl.dictization_functions.Missing object at 0x7f5c8903add0> is not JSON serializable) u'INSERT INTO resource (id, package_id, url, format, description, hash, position, name, resource_type, mimetype, mimetype_inner, size, created, last_modified, cache_url, cache_last_updated, webstore_url, webstore_last_updated, url_type, extras, state, revision_id) VALUES (%(id)s, %(package_id)s, %(url)s, %(format)s, %(description)s, %(hash)s, %(position)s, %(name)s, %(resource_type)s, %(mimetype)s, %(mimetype_inner)s, %(size)s, %(created)s, %(last_modified)s, %(cache_url)s, %(cache_last_updated)s, %(webstore_url)s, %(webstore_last_updated)s, %(url_type)s, %(extras)s, %(state)s, %(revision_id)s)' [{'mimetype': None, 'cache_url': None, 'state': u'active', 'hash': u'', 'description': u'', 'format': u'TXT', 'url': u'readme.txt', 'cache_last_updated': None, 'extras': {'ebsResourceDT': u'', u'resFormat': u'TXT', u'resChecksums': <ckan.lib.navl.dictization_functions.Missing object at 0x7f5c8903add0>, 'resStatus': u'', 'resLicenseURL': u'', 'resLicenseCustom': u''}, 'webstore_url': None, 'package_id': u'976c7204-5095-4502-969c-a7bd44a4df41', 'mimetype_inner': None, 'webstore_last_updated': None, 'last_modified': datetime.datetime(2016, 10, 23, 13, 27, 50, 445248), 'position': 1, 'revision_id': u'2e6341e6-1e47-4bae-912e-afb4661a6b22', 'size': None, 'url_type': u'upload', 'id': u'c3e6b663-25f8-41ed-b05f-8b1c848397da', 'resource_type': None, 'name': u''}] [Sun Oct 23 15:27:50.837620 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] URL: http://ckantest.data.slu.se/dataset/new_resource/test67 [Sun Oct 23 15:27:50.837659 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/weberror/errormiddleware.py', line 171 in call [Sun Oct 23 15:27:50.837667 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] app_iter = self.application(environ, sr_checker) [Sun Oct 23 15:27:50.837673 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in call [Sun Oct 23 15:27:50.837679 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] resp = self.call_func(req, args, _self.kwargs) [Sun Oct 23 15:27:50.837685 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func [Sun Oct 23 15:27:50.837691 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return self.func(req, _args, _kwargs) [Sun Oct 23 15:27:50.837697 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/publisher.py', line 234 in call [Sun Oct 23 15:27:50.837703 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return request.get_response(self.app) [Sun Oct 23 15:27:50.837709 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response [Sun Oct 23 15:27:50.837715 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] application, catch_exc_info=False) [Sun Oct 23 15:27:50.837720 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application [Sun Oct 23 15:27:50.837726 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] app_iter = application(self.environ, start_response) [Sun Oct 23 15:27:50.837732 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in call [Sun Oct 23 15:27:50.837738 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] resp = self.call_func(req, _args, _self.kwargs) [Sun Oct 23 15:27:50.837744 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func [Sun Oct 23 15:27:50.837749 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return self.func(req, _args, _kwargs) [Sun Oct 23 15:27:50.837755 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/injector.py', line 54 in call [Sun Oct 23 15:27:50.837761 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] response = request.get_response(self.app) [Sun Oct 23 15:27:50.837767 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response [Sun Oct 23 15:27:50.837772 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] application, catch_exc_info=False) [Sun Oct 23 15:27:50.837778 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application [Sun Oct 23 15:27:50.837784 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] app_iter = application(self.environ, start_response) [Sun Oct 23 15:27:50.837790 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py', line 389 in inner [Sun Oct 23 15:27:50.837811 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] result = application(environ, start_response) [Sun Oct 23 15:27:50.837818 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/beaker/middleware.py', line 73 in call [Sun Oct 23 15:27:50.837824 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return self.app(environ, start_response) [Sun Oct 23 15:27:50.837830 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/beaker/middleware.py', line 155 in call [Sun Oct 23 15:27:50.837835 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return self.wrap_app(environ, session_start_response) [Sun Oct 23 15:27:50.837841 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/routes/middleware.py', line 131 in call [Sun Oct 23 15:27:50.837847 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] response = self.app(environ, start_response) [Sun Oct 23 15:27:50.837852 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/wsgiapp.py', line 125 in call [Sun Oct 23 15:27:50.837858 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] response = self.dispatch(controller, environ, start_response) [Sun Oct 23 15:27:50.837863 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/wsgiapp.py', line 324 in dispatch [Sun Oct 23 15:27:50.837869 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return controller(environ, start_response) [Sun Oct 23 15:27:50.837874 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 337 in call [Sun Oct 23 15:27:50.837880 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] res = WSGIController.call(self, environ, start_response) [Sun Oct 23 15:27:50.837885 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 221 in call [Sun Oct 23 15:27:50.837891 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] response = self._dispatch_call() [Sun Oct 23 15:27:50.837897 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 172 in _dispatch_call [Sun Oct 23 15:27:50.837902 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] response = self._inspect_call(func) [Sun Oct 23 15:27:50.837908 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 107 in _inspect_call [Sun Oct 23 15:27:50.837913 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] result = self._perform_call(func, args) [Sun Oct 23 15:27:50.837919 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 60 in _perform_call [Sun Oct 23 15:27:50.837925 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return func(args) [Sun Oct 23 15:27:50.837930 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/src/ckan/ckan/controllers/package.py', line 684 in new_resource [Sun Oct 23 15:27:50.837936 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] get_action('resource_create')(context, data) [Sun Oct 23 15:27:50.837949 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/src/ckan/ckan/logic/init.py', line 416 in wrapped [Sun Oct 23 15:27:50.837956 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] result = _action(context, data_dict, kw) [Sun Oct 23 15:27:50.837962 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/src/ckan/ckan/logic/action/create.py', line 304 in resource_create [Sun Oct 23 15:27:50.837967 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] _get_action('package_update')(context, pkg_dict) [Sun Oct 23 15:27:50.837973 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/src/ckan/ckan/logic/init.py', line 416 in wrapped [Sun Oct 23 15:27:50.837978 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] result = _action(context, data_dict, *_kw) [Sun Oct 23 15:27:50.837984 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/src/ckan/ckan/logic/action/update.py', line 347 in package_update [Sun Oct 23 15:27:50.837989 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] pkg = model_save.package_dict_save(data, context) [Sun Oct 23 15:27:50.837995 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/src/ckan/ckan/lib/dictization/model_save.py', line 303 in package_dict_save [Sun Oct 23 15:27:50.838000 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] package_membership_list_save(pkg_dict.get("groups"), pkg, context) [Sun Oct 23 15:27:50.838006 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/src/ckan/ckan/lib/dictization/model_save.py', line 225 in package_membership_list_save [Sun Oct 23 15:27:50.838012 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] model.Session.flush() [Sun Oct 23 15:27:50.838017 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/scoping.py', line 149 in do [Sun Oct 23 15:27:50.838023 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return getattr(self.registry(), name)(_args, *kwargs) [Sun Oct 23 15:27:50.838029 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/session.py', line 1907 in flush [Sun Oct 23 15:27:50.838034 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] self._flush(objects) [Sun Oct 23 15:27:50.838040 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/session.py', line 2025 in _flush [Sun Oct 23 15:27:50.838045 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] transaction.rollback(_capture_exception=True) [Sun Oct 23 15:27:50.838051 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py', line 57 in exit [Sun Oct 23 15:27:50.838057 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] compat.reraise(exc_type, exc_value, exc_tb) [Sun Oct 23 15:27:50.838062 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/session.py', line 1989 in _flush [Sun Oct 23 15:27:50.838068 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] flush_context.execute() [Sun Oct 23 15:27:50.838073 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py', line 371 in execute [Sun Oct 23 15:27:50.838079 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] rec.execute(self) [Sun Oct 23 15:27:50.838090 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py', line 524 in execute [Sun Oct 23 15:27:50.838097 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] uow [Sun Oct 23 15:27:50.838103 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py', line 64 in save_obj [Sun Oct 23 15:27:50.838108 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mapper, table, insert) [Sun Oct 23 15:27:50.838114 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py', line 568 in _emit_insert_statements [Sun Oct 23 15:27:50.838121 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] execute(statement, multiparams) [Sun Oct 23 15:27:50.838126 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 727 in execute [Sun Oct 23 15:27:50.838132 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return meth(self, multiparams, params) [Sun Oct 23 15:27:50.838137 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/sql/elements.py', line 322 in _execute_on_connection [Sun Oct 23 15:27:50.838143 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return connection._execute_clauseelement(self, multiparams, params) [Sun Oct 23 15:27:50.838149 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 824 in _execute_clauseelement [Sun Oct 23 15:27:50.838154 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] compiled_sql, distilled_params [Sun Oct 23 15:27:50.838160 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 891 in _execute_context [Sun Oct 23 15:27:50.838165 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] None, None) [Sun Oct 23 15:27:50.838171 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 1116 in _handle_dbapi_exception [Sun Oct 23 15:27:50.838177 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] exc_info [Sun Oct 23 15:27:50.838182 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/util/compat.py', line 189 in raise_from_cause [Sun Oct 23 15:27:50.838188 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] reraise(type(exception), exception, tb=exc_tb) [Sun Oct 23 15:27:50.838193 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 887 in _execute_context [Sun Oct 23 15:27:50.838199 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] context = constructor(dialect, self, conn, args) [Sun Oct 23 15:27:50.838204 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/engine/default.py', line 584 in _init_compiled [Sun Oct 23 15:27:50.838210 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] processorskey [Sun Oct 23 15:27:50.838216 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/sql/type_api.py', line 860 in process [Sun Oct 23 15:27:50.838221 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return impl_processor(process_param(value, dialect)) [Sun Oct 23 15:27:50.838236 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/src/ckan/ckan/model/types.py', line 78 in process_bind_param [Sun Oct 23 15:27:50.838242 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return unicode(json.dumps(value, ensure_ascii=False)) [Sun Oct 23 15:27:50.838248 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/simplejson/init.py', line 369 in dumps [Sun Oct 23 15:27:50.838254 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] _kw).encode(obj) [Sun Oct 23 15:27:50.838259 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/simplejson/encoder.py', line 262 in encode [Sun Oct 23 15:27:50.838265 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] chunks = self.iterencode(o, _one_shot=True) [Sun Oct 23 15:27:50.838270 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/simplejson/encoder.py', line 340 in iterencode [Sun Oct 23 15:27:50.838275 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] return _iterencode(o, 0) [Sun Oct 23 15:27:50.838281 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] File '/usr/lib/ckan/default/lib/python2.7/site-packages/simplejson/encoder.py', line 239 in default [Sun Oct 23 15:27:50.838286 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] raise TypeError(repr(o) + " is not JSON serializable") [Sun Oct 23 15:27:50.838296 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] StatementError: <ckan.lib.navl.dictization_functions.Missing object at 0x7f5c8903add0> is not JSON serializable (original cause: TypeError: <ckan.lib.navl.dictization_functions.Missing object at 0x7f5c8903add0> is not JSON serializable) u'INSERT INTO resource (id, package_id, url, format, description, hash, position, name, resource_type, mimetype, mimetype_inner, size, created, last_modified, cache_url, cache_last_updated, webstore_url, webstore_last_updated, url_type, extras, state, revision_id) VALUES (%(id)s, %(package_id)s, %(url)s, %(format)s, %(description)s, %(hash)s, %(position)s, %(name)s, %(resource_type)s, %(mimetype)s, %(mimetype_inner)s, %(size)s, %(created)s, %(last_modified)s, %(cache_url)s, %(cache_last_updated)s, %(webstore_url)s, %(webstore_last_updated)s, %(url_type)s, %(extras)s, %(state)s, %(revision_id)s)' [{'mimetype': None, 'cache_url': None, 'state': u'active', 'hash': u'', 'description': u'', 'format': u'TXT', 'url': u'readme.txt', 'cache_last_updated': None, 'extras': {'ebsResourceDT': u'', u'resFormat': u'TXT', u'resChecksums': <ckan.lib.navl.dictization_functions.Missing object at 0x7f5c8903add0>, 'resStatus': u'', 'resLicenseURL': u'', 'resLicenseCustom': u''}, 'webstore_url': None, 'package_id': u'976c7204-5095-4502-969c-a7bd44a4df41', 'mimetype_inner': None, 'webstore_last_updated': None, 'last_modified': datetime.datetime(2016, 10, 23, 13, 27, 50, 445248), 'position': 1, 'revision_id': u'2e6341e6-1e47-4bae-912e-afb4661a6b22', 'size': None, 'url_type': u'upload', 'id': u'c3e6b663-25f8-41ed-b05f-8b1c848397da', 'resource_type': None, 'name': u''}] [Sun Oct 23 15:27:50.838310 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] [Sun Oct 23 15:27:50.838316 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] [Sun Oct 23 15:27:50.838321 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] CGI Variables [Sun Oct 23 15:27:50.838326 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] ------------- [Sun Oct 23 15:27:50.838331 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] CKAN_CURRENT_URL: '/dataset/new_resource/test67' [Sun Oct 23 15:27:50.838337 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] CKAN_LANG: 'en' [Sun Oct 23 15:27:50.838347 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] CKAN_LANG_IS_DEFAULT: True [Sun Oct 23 15:27:50.838354 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] CONTENT_TYPE: 'multipart/form-data; boundary=----WebKitFormBoundaryF4MEZaMC2Kk31pQE; charset=utf-8' [Sun Oct 23 15:27:50.838360 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] CONTEXT_DOCUMENT_ROOT: '/var/www' [Sun Oct 23 15:27:50.838365 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] DOCUMENT_ROOT: '/var/www' [Sun Oct 23 15:27:50.838370 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] GATEWAY_INTERFACE: 'CGI/1.1' [Sun Oct 23 15:27:50.838376 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTPACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8' [Sun Oct 23 15:27:50.838381 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTP_ACCEPT_ENCODING: 'gzip, deflate' [Sun Oct 23 15:27:50.838386 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTP_ACCEPT_LANGUAGE: 'en-GB,en;q=0.8,sv;q=0.6' [Sun Oct 23 15:27:50.838392 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTP_CACHE_CONTROL: 'max-age=0' [Sun Oct 23 15:27:50.838397 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTP_CONNECTION: 'close' [Sun Oct 23 15:27:50.838403 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTP_COOKIE: 'utma=213115478.630284032.1466418436.1473850887.1474578167.5; utmz=213115478.1466418436.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); ckan=9901a9431a761651b37a8f26cc3aa3099bde044f57c8f2220ea344109ecfe55d714e71b8' [Sun Oct 23 15:27:50.838410 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTP_HOST: 'ckantest.data.slu.se' [Sun Oct 23 15:27:50.838415 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTP_ORIGIN: 'http://ckantest.data.slu.se' [Sun Oct 23 15:27:50.838421 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTP_REFERER: 'http://ckantest.data.slu.se/dataset/new_resource/test67' [Sun Oct 23 15:27:50.838426 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTP_UPGRADE_INSECURE_REQUESTS: '1' [Sun Oct 23 15:27:50.838432 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTP_USER_AGENT: 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36' [Sun Oct 23 15:27:50.838438 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTP_VIA: '1.1 slu-proxy.slu.se (squid/3.5.20)' [Sun Oct 23 15:27:50.838443 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] HTTP_X_FORWARDED_FOR: '172.21.223.37' [Sun Oct 23 15:27:50.838448 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] PATH_INFO: '/dataset/new_resource/test67' [Sun Oct 23 15:27:50.838454 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] PATH_TRANSLATED: '/etc/ckan/default/apache.wsgi/dataset/new_resource/test67' [Sun Oct 23 15:27:50.838459 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] REMOTE_ADDR: '127.0.0.1' [Sun Oct 23 15:27:50.838464 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] REMOTE_PORT: '48962' [Sun Oct 23 15:27:50.838469 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] REQUEST_METHOD: 'POST' [Sun Oct 23 15:27:50.838474 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] REQUEST_SCHEME: 'http' [Sun Oct 23 15:27:50.838479 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] REQUEST_URI: '/dataset/new_resource/test67' [Sun Oct 23 15:27:50.838485 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] SCRIPT_FILENAME: '/etc/ckan/default/apache.wsgi' [Sun Oct 23 15:27:50.838500 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] SERVER_ADDR: '127.0.0.1' [Sun Oct 23 15:27:50.838507 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] SERVER_ADMIN: '[no address given]' [Sun Oct 23 15:27:50.838512 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] SERVER_NAME: 'ckantest.data.slu.se' [Sun Oct 23 15:27:50.838518 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] SERVER_PORT: '80' [Sun Oct 23 15:27:50.838523 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] SERVER_PROTOCOL: 'HTTP/1.0' [Sun Oct 23 15:27:50.838528 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] SERVER_SIGNATURE: '

Apache/2.4.7 (Ubuntu) Server at ckantest.data.slu.se Port 80
\n' [Sun Oct 23 15:27:50.838534 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] SERVER_SOFTWARE: 'Apache/2.4.7 (Ubuntu)' [Sun Oct 23 15:27:50.838539 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] [Sun Oct 23 15:27:50.838544 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] [Sun Oct 23 15:27:50.838549 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] WSGI Variables [Sun Oct 23 15:27:50.838554 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] -------------- [Sun Oct 23 15:27:50.838559 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] application: <fanstatic.publisher.Delegator object at 0x7f5c88893a90> [Sun Oct 23 15:27:50.838565 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] beaker.cache: <beaker.cache.CacheManager object at 0x7f5c88893b10> [Sun Oct 23 15:27:50.838571 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x7f5c7d3d3c90>> [Sun Oct 23 15:27:50.838577 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] beaker.session: {'ckanext-ldap-user': u'tigi0001', '_accessed_time': 1477229270.374464, '_creation_time': 1477207812.458233} [Sun Oct 23 15:27:50.838583 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] fanstatic.needed: <fanstatic.core.NeededResources object at 0x7f5c7d508f90> [Sun Oct 23 15:27:50.838589 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mod_wsgi.application_group: 'default.ckanhosted.com|' [Sun Oct 23 15:27:50.838594 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mod_wsgi.callable_object: 'application' [Sun Oct 23 15:27:50.838599 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mod_wsgi.enable_sendfile: '0' [Sun Oct 23 15:27:50.838604 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mod_wsgi.handler_script: '' [Sun Oct 23 15:27:50.838609 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mod_wsgi.input_chunked: '0' [Sun Oct 23 15:27:50.838614 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mod_wsgi.listener_host: '' [Sun Oct 23 15:27:50.838620 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mod_wsgi.listener_port: '8080' [Sun Oct 23 15:27:50.838625 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mod_wsgi.process_group: 'ckan_default' [Sun Oct 23 15:27:50.838630 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mod_wsgi.queue_start: '1477229270355899' [Sun Oct 23 15:27:50.838635 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mod_wsgi.request_handler: 'wsgi-script' [Sun Oct 23 15:27:50.838641 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mod_wsgi.script_reloading: '1' [Sun Oct 23 15:27:50.838646 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] mod_wsgi.version: (3, 4) [Sun Oct 23 15:27:50.838665 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] paste.cookies: (, 'utma=213115478.630284032.1466418436.1473850887.1474578167.5; utmz=213115478.1466418436.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); ckan=9901a9431a761651b37a8f26cc3aa3099bde044f57c8f2220ea344109ecfe55d714e71b8') [Sun Oct 23 15:27:50.838674 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] paste.registry: <paste.registry.Registry object at 0x7f5c7d44ca90> [Sun Oct 23 15:27:50.838679 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] paste.throw_errors: True [Sun Oct 23 15:27:50.838685 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] pylons.action_method: <bound method PackageController.new_resource of <ckan.controllers.package.PackageController object at 0x7f5c7d508610>> [Sun Oct 23 15:27:50.838691 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] pylons.controller: <ckan.controllers.package.PackageController object at 0x7f5c7d508610> [Sun Oct 23 15:27:50.838697 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'} [Sun Oct 23 15:27:50.838740 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] pylons.pylons: <pylons.util.PylonsContext object at 0x7f5c7d5089d0> [Sun Oct 23 15:27:50.838752 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] pylons.routes_dict: {'action': u'new_resource', 'controller': u'package', 'id': u'test67'} [Sun Oct 23 15:27:50.838758 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] repoze.who.api: <repoze.who.api.API object at 0x7f5c7d508c10> [Sun Oct 23 15:27:50.838764 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] repoze.who.logger: <logging.Logger object at 0x7f5c8889e4d0> [Sun Oct 23 15:27:50.838770 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] repoze.who.plugins: {'ckan.lib.authenticator:UsernamePasswordAuthenticator': <ckan.lib.authenticator.UsernamePasswordAuthenticator object at 0x7f5c888d8d50>, 'friendlyform': <FriendlyFormPlugin 140035404492048>, 'auth_tkt': <CkanAuthTktCookiePlugin 140035404491984>} [Sun Oct 23 15:27:50.838777 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] routes.route: <routes.route.Route object at 0x7f5c7d50f6d0> [Sun Oct 23 15:27:50.838783 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] routes.url: <routes.util.URLGenerator object at 0x7f5c8889e990> [Sun Oct 23 15:27:50.838789 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] webob._parsed_post_vars: (MultiDict([('id', ''), ('url', 'ReadMe.txt'), ('upload', FieldStorage('upload', 'ReadMe.txt')), ('clear_upload', ''), ('name', ''), ('resStatus', ''), ('description', ''), ('resLicenseURL', ''), ('resLicenseCustom', ''), ('ebsResourceDT', ''), ('save', 'go-metadata')]), <FakeCGIBody at 0x7f5c7d508950 viewing MultiDict([('id...a')])>) [Sun Oct 23 15:27:50.838797 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] webob._parsed_query_vars: (GET([]), '') [Sun Oct 23 15:27:50.838802 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] webob.adhoc_attrs: {'errors': 'ignore', 'response': <Response at 0x7f5c7d508a50 200 OK>, 'language': 'en-us'} [Sun Oct 23 15:27:50.838808 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] webob.is_body_readable: True [Sun Oct 23 15:27:50.838814 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] webob.is_body_seekable: False [Sun Oct 23 15:27:50.838819 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] wsgi process: 'Multi process AND threads (?)' [Sun Oct 23 15:27:50.838832 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] wsgi.file_wrapper: <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f5c888a5eb8> [Sun Oct 23 15:27:50.838839 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] wsgiorg.routing_args: (<routes.util.URLGenerator object at 0x7f5c8889e990>, {'action': u'new_resource', 'controller': u'package', 'id': u'test67'}) [Sun Oct 23 15:27:50.838846 2016] [:error] [pid 38869:tid 140035570280192] [remote 127.0.0.1:60305] ------------------------------------------------------------

I dont know where to look for a fix and was hoping you might understand where and what needs to be done. I dont mind doing the later, but need some help understanding it first.

espona commented 8 years ago

(Sorry, I replied to the mail but it doesn't appear here. See my answer below) Dear Tim, I never tested it with the resources before but I just did add a composite field without any issue.

capture_composite_resources

Which version of CKAN are you using? I developed/tested it for 2.5.2. Could you send me the definition of the field in your schema.json? I will try to reproduce the error and look for a solution. Also did you "transformed" to composite an existing field or you added a new extra one?

Lucia

timgiles commented 8 years ago

Hi Lucia.

Sorry for being out of contact for a few days. After reading it should work, I removed everything from Resources and re-added everything. I am glad to say it worked a treat. I and my team have been making various changes so it looks like I made a mistake.

Working really great. Thank you for putting out Composite and the recent update (validation)

espona commented 7 years ago

Thanks Tim, happy to hear that it worked out :relaxed: