CKAN和Atom提供?

时间:2016-02-15 02:13:42

标签: atom-feed ckan

Atom feed已经有一段时间了(ckan.org/2012/05/30/atom-feeds/,结果为https://datahub.io/feeds/dataset.atom)。

然而,当我们在我们自己的CKAN实例上尝试此操作时(它与数据库的CKAN版本相同),我们会收到服务器错误。

文档有一些重新设置的设置,但它们似乎不包含启用/禁用的开关,因此假设它们应该在' on'默认情况下? http://docs.ckan.org/en/latest/maintaining/configuration.html#feeds-settings

我们还需要做些什么才能让它发挥作用吗?

由于 亚伦

更新

服务器日志中有与ckan.feeds.date配置相关的详细信息,他们更新了这些配置以包含日期,但仍然收到错误 - 记录在下面。

ATOM提要似乎存在一些问题(例如只是查看Github https://github.com/ckan/ckan/issues/1463 - 尽管它们应该在我们正在运行的版本中得到解决)。你能看到我们可能遗漏的任何东西,和/或是否值得在Github中记录另一个问题,如果问题是一个bug(它似乎与python有关?)而不是配置问题?

我注意到在日志的第3行它正在使用http(vs httpS)网址 - 我们在非HTTPS实例上进行了测试(以确保它一直是相同的网址)并且它仍然导致了同样的错误。

尝试访问https://datastore.landcareresearch.co.nz/feeds/dataset.atom

时记录
[Mon Apr 04 10:43:07 2016] [error] 2016-04-04 10:43:07,074 INFO  [ckan.lib.base]  /dataset render time 0.156 seconds
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] Error - <type 'exceptions.AttributeError'>: 'list' object has no attribute 'replace'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] URL: http://datastore.landcareresearch.co.nz/feeds/dataset.atom
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/weberror/errormiddleware.py', line 162 in __call__
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   app_iter = self.application(environ, sr_checker)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   resp = self.call_func(req, *args, **self.kwargs)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   return self.func(req, *args, **kwargs)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/publisher.py', line 234 in __call__
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   return request.get_response(self.app)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   application, catch_exc_info=False)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   app_iter = application(self.environ, start_response)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   resp = self.call_func(req, *args, **self.kwargs)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   return self.func(req, *args, **kwargs)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/injector.py', line 54 in __call__
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   response = request.get_response(self.app)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   application, catch_exc_info=False)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   app_iter = application(self.environ, start_response)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py', line 389 in inner
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   result = application(environ, start_response)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/beaker/middleware.py', line 73 in __call__
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   return self.app(environ, start_response)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/beaker/middleware.py', line 155 in __call__
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   return self.wrap_app(environ, session_start_response)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/routes/middleware.py', line 131 in __call__
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   response = self.app(environ, start_response)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/wsgiapp.py', line 125 in __call__
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   response = self.dispatch(controller, environ, start_response)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/wsgiapp.py', line 324 in dispatch
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   return controller(environ, start_response)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 338 in __call__
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   res = WSGIController.__call__(self, environ, start_response)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 221 in __call__
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   response = self._dispatch_call()
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 172 in _dispatch_call
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   response = self._inspect_call(func)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 107 in _inspect_call
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   result = self._perform_call(func, args)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 60 in _perform_call
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   return func(**args)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/controllers/feed.py', line 296 in general
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   navigation_urls=navigation_urls)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/controllers/feed.py', line 393 in output_feed
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   return feed.writeString('utf-8')
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webhelpers/feedgenerator.py', line 217 in writeString
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   self.write(s, encoding)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webhelpers/feedgenerator.py', line 333 in write
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   self.write_items(handler)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webhelpers/feedgenerator.py', line 367 in write_items
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   self.add_item_elements(handler, item)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/controllers/feed.py', line 514 in add_item_elements
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   super(_FixedAtom1Feed, self).add_item_elements(handler, item)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webhelpers/feedgenerator.py', line 380 in add_item_elements
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   handler.addQuickElement(u"name", item['author_name'])
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webhelpers/util.py', line 182 in addQuickElement
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   self.characters(contents)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/python2.7/xml/sax/saxutils.py', line 162 in characters
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   self._write(escape(content))
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] File '/usr/lib/python2.7/xml/sax/saxutils.py', line 39 in escape
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   data = data.replace("&", "&amp;")
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] AttributeError: 'list' object has no attribute 'replace'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] 
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] 
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] CGI Variables
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] -------------
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   AUTH_TYPE: 'cookie'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   CKAN_CURRENT_URL: '/feeds/dataset.atom'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   CKAN_LANG: 'en_NZ'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   CKAN_LANG_IS_DEFAULT: True
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   CONTENT_TYPE: '; charset=utf-8'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   DOCUMENT_ROOT: '/etc/apache2/htdocs'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   GATEWAY_INTERFACE: 'CGI/1.1'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_ACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_ACCEPT_ENCODING: 'gzip, deflate, sdch'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_ACCEPT_LANGUAGE: 'en-GB,en-US;q=0.8,en;q=0.6'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_CACHE_CONTROL: 'no-cache'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_CONNECTION: 'close'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_COOKIE: 'ckan=80c3a3f1b25d8d933d8438e88d5da5e1523009e2861bf44580554df3ade2b6e12804008c; auth_tkt="0e1ee44900f448db092e99ab707a7be65654dd84michaels!userid_type:unicode"; auth_tkt="0e1ee44900f448db092e99ab707a7be65654dd84michaels!userid_type:unicode"; __utma=137900973.581330336.1415309487.1448933608.1453156916.12; __utmc=137900973; __utmz=137900973.1446083943.10.3.utmcsr=172.20.88.97|utmccn=(referral)|utmcmd=referral|utmcct=/; _ga=GA1.3.581330336.1415309487; __utma=84049292.581330336.1415309487.1458647532.1459722563.56; __utmb=84049292.5.10.1459722563; __utmc=84049292; __utmz=84049292.1459722563.56.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=https%3A%2F%2Fdatastore.landcareresearch.co.nz%2Ffeeds%2Fdataset.atom'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_HOST: 'datastore.landcareresearch.co.nz'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_PRAGMA: 'no-cache'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_REFERER: 'https://www.google.com/url?q=https%3A%2F%2Fdatastore.landcareresearch.co.nz%2Ffeeds%2Fdataset.atom&sa=D&sntz=1&usg=AFQjCNGLyJbMkRLkuuyRx9wZapwTpNQigg'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_UPGRADE_INSECURE_REQUESTS: '1'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_USER_AGENT: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_X_FORWARDED_FOR: '172.20.88.18'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_X_FORWARDED_HOST: 'datastore.landcareresearch.co.nz'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_X_FORWARDED_PROTO: 'https'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_X_FORWARDED_SERVER: 'datastore.landcareresearch.co.nz'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_X_FORWARDED_SSL: 'on'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   HTTP_X_REAL_IP: '172.20.88.18'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   PATH_INFO: '/feeds/dataset.atom'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   PATH_TRANSLATED: '/etc/ckan/default/apache.wsgi/feeds/dataset.atom'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   REMOTE_ADDR: '127.0.0.1'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   REMOTE_PORT: '45221'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   REMOTE_USER: u'michaels'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   REMOTE_USER_DATA: 'userid_type:unicode'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   REMOTE_USER_TOKENS: ['']
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   REQUEST_METHOD: 'GET'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   REQUEST_URI: '/feeds/dataset.atom'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   SCRIPT_FILENAME: '/etc/ckan/default/apache.wsgi'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   SERVER_ADDR: '127.0.0.1'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   SERVER_ADMIN: '[no address given]'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   SERVER_NAME: 'datastore.landcareresearch.co.nz'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   SERVER_PORT: '80'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   SERVER_PROTOCOL: 'HTTP/1.0'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   SERVER_SIGNATURE: '<address>Apache/2.2.22 (Ubuntu) Server at datastore.landcareresearch.co.nz Port 80</address>\\n'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   SERVER_SOFTWARE: 'Apache/2.2.22 (Ubuntu)'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] 
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] 
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] WSGI Variables
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] --------------
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   application: <fanstatic.publisher.Delegator object at 0x7fbdcf7f0c10>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   beaker.cache: <beaker.cache.CacheManager object at 0x7fbdcf7f0a10>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x7fbdcf7fbf10>>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   beaker.session: {'_accessed_time': 1459723387.442003, '_creation_time': 1459723387.442003}
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   fanstatic.needed: <fanstatic.core.NeededResources object at 0x7fbdcfd8bad0>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   mod_wsgi.application_group: 'default.ckanhosted.com|'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   mod_wsgi.callable_object: 'application'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   mod_wsgi.handler_script: ''
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   mod_wsgi.input_chunked: '0'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   mod_wsgi.listener_host: ''
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   mod_wsgi.listener_port: '8080'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   mod_wsgi.process_group: 'ckan_default'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   mod_wsgi.request_handler: 'wsgi-script'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   mod_wsgi.script_reloading: '1'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   mod_wsgi.version: (3, 3)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   paste.cookies: (<SimpleCookie: __utma='84049292.581330336.1415309487.1458647532.1459722563.56' __utmb='84049292.5.10.1459722563' __utmc='84049292' __utmz='84049292.1459722563.56.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=https%3A%2F%2Fdatastore.landcareresearch.co.nz%2Ffeeds%2Fdataset.atom' _ga='GA1.3.581330336.1415309487' auth_tkt='0e1ee44900f448db092e99ab707a7be65654dd84michaels!userid_type:unicode' ckan='80c3a3f1b25d8d933d8438e88d5da5e1523009e2861bf44580554df3ade2b6e12804008c'>, 'ckan=80c3a3f1b25d8d933d8438e88d5da5e1523009e2861bf44580554df3ade2b6e12804008c; auth_tkt="0e1ee44900f448db092e99ab707a7be65654dd84michaels!userid_type:unicode"; auth_tkt="0e1ee44900f448db092e99ab707a7be65654dd84michaels!userid_type:unicode"; __utma=137900973.581330336.1415309487.1448933608.1453156916.12; __utmc=137900973; __utmz=137900973.1446083943.10.3.utmcsr=172.20.88.97|utmccn=(referral)|utmcmd=referral|utmcct=/; _ga=GA1.3.581330336.1415309487; __utma=84049292.581330336.1415309487.145864...%2Fdataset.atom')
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   paste.registry: <paste.registry.Registry object at 0x7fbdb41f9690>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   paste.throw_errors: True
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   pylons.action_method: <bound method FeedController.general of <ckan.controllers.feed.FeedController object at 0x7fbdcfb13850>>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   pylons.controller: <ckan.controllers.feed.FeedController object at 0x7fbdcfb13850>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   pylons.pylons: <pylons.util.PylonsContext object at 0x7fbdcfb13f50>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   pylons.routes_dict: {'action': u'general', 'controller': u'feed'}
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   repoze.who.api: <repoze.who.api.API object at 0x7fbdb41f9e10>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   repoze.who.identity: <repoze.who identity (hidden, dict-like) at 140452949597392>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   repoze.who.logger: <logging.Logger object at 0x7fbdcf7f0d50>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   repoze.who.plugins: {'ckan.lib.authenticator:UsernamePasswordAuthenticator': <ckan.lib.authenticator.UsernamePasswordAuthenticator object at 0x7fbdcf7eaa50>, 'friendlyform': <FriendlyFormPlugin 140453206729104>, 'auth_tkt': <CkanAuthTktCookiePlugin 140453206728784>}
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   routes.route: <routes.route.Route object at 0x7fbdcf702b10>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   routes.url: <routes.util.URLGenerator object at 0x7fbdc05870d0>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   webob._parsed_query_vars: (GET([]), '')
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   webob.adhoc_attrs: {'response': <Response at 0x7fbdc0587290 200 OK>, 'language': 'en-us'}
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   wsgi process: 'Multi process AND threads (?)'
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   wsgi.file_wrapper: <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7fbdc0575e40>
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   wsgi.version: (1, 1)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   wsgiorg.routing_args: (<routes.util.URLGenerator object at 0x7fbdc05870d0>, {'action': u'general', 'controller': u'feed'})
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] ------------------------------------------------------------
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] 
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]             <p>Additionally an error occurred while sending the &lt;weberror.reporter.EmailReporter object at 0x7fbdc0650110&gt; report:
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] 
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]             <pre>Traceback (most recent call last):
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/weberror/errormiddleware.py", line 450, in send_report
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]     rep.report(exc_data)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/weberror/reporter.py", line 45, in report
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]     server = smtplib.SMTP(self.smtp_server)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   File "/usr/lib/python2.7/smtplib.py", line 254, in __init__
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]     (code, msg) = self.connect(host, port)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   File "/usr/lib/python2.7/smtplib.py", line 314, in connect
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]     self.sock = self._get_socket(host, port, self.timeout)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   File "/usr/lib/python2.7/smtplib.py", line 289, in _get_socket
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]     return socket.create_connection((port, host), timeout)
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]   File "/usr/lib/python2.7/socket.py", line 571, in create_connection
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]     raise err
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] error: [Errno 111] Connection refused
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1] </pre>
[Mon Apr 04 10:43:07 2016] [error] 2016-04-04 10:43:07,761 INFO  [ckan.lib.base]  /feeds/dataset.atom render time 0.094 seconds
[Mon Apr 04 10:43:07 2016] [error] [client 127.0.0.1]             </p>
[Mon Apr 04 10:43:08 2016] [error] 2016-04-04 10:43:08,163 INFO  [ckan.lib.base]  /api/i18n/en_NZ render time 0.002 seconds
[Mon Apr 04 10:43:09 2016] [error] 2016-04-04 10:43:09,892 WARNI [ckan.lib.maintain] Function _resource_preview() in module ckan.controllers.package has been deprecated and will be removed in a later release of ckan. Resource preview is deprecated. Please use the new resource views
[Mon Apr 04 10:43:10 2016] [error] 2016-04-04 10:43:10,019 INFO  [ckan.lib.base]  /dataset/new-zealand-bark-thickness-2015/resource/e1efd90a-b4b9-4656-9c00-50970372bbb9 render time 0.159 seconds
[Mon Apr 04 10:43:14 2016] [error] 2016-04-04 10:43:14,821 INFO  [ckan.lib.base]  /dataset render time 0.082 seconds

2 个答案:

答案 0 :(得分:2)

例外是说传递的author_name值是'list'类型(我想象的是字符串),而不是字符串。

浏览了feed.py后,我认为你应该在ckan配置中检查一下,ckan.feeds.author_nameckan.site_id没有多个值。在值中使用逗号可能会导致它。如果不这样做,也要查看数据库中的package.author字段,虽然我看不出为什么会最终成为一个列表,除非你有自定义架构。

也没有理由不能在第393行之前的feed.py中使用print或断点调试它,并找出此列表的来源。

答案 1 :(得分:0)

问题在于feeds.py

中的以下语句
author_name=pkg.get('author', ''),

pkg.get for author返回一个数组而不是一个字符串。这是一个错误。