[ckan-dev] ckanext-datajson installation issues

Renato Guevara guevara.renato at gmail.com
Fri Oct 3 13:46:04 UTC 2014


Dave,

Sorry for not specifying that the error log that was printed did in fact
contain the *import ckanext *line.  Yes, the log reflected the added line.
How would I be able to fix the circular dependency?  I'm not knowledgeable
in Python.  One thing that I tried to do, and, unfortunately, I can't test
it at this very moment because our servers are going through some issues,
is that I modified the extension a bit after comparing with other
extensions such as ckanext-harvest and ckanext-spatial.  First, from
ckanext-datajson/ckanext/datajson/__init__.py I removed the line *from
plugin import DataJsonPlugin*.  Then in the ckanext-datajson/setup.py I
modified the line *datajson=ckanext.datajson:DataJsonPlugin *to
*datajson=ckanext.datajson.plugin:DataJsonPlugin*.  This time, I get the
following error:
------------------------------------------------------
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1] mod_wsgi (pid=8518):
Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as
Python module.
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1] mod_wsgi (pid=8518):
Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'.
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/etc/ckan/default/apache.wsgi", line 10, in <module>
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     application =
loadapp('config:%s' % config_filepath)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 247, in loadapp
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     return
loadobj(APP, uri, name=name, **kw)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 272, in loadobj
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     return
context.create()
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 710, in create
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     return
self.object_type.invoke(self)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 146, in invoke
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     return
fix_call(context.object, context.global_conf, **context.local_conf)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/util.py",
line 56, in fix_call
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     val =
callable(*args, **kw)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py", line 57, in
make_app
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]
load_environment(conf, app_conf)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 232, in
load_environment
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     p.load_all(config)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 134, in load_all
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     load(*plugins)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 149, in load
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     service =
_get_service(plugin)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 255, in
_get_service
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     return
plugin.load()(name=plugin_name)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py",
line 1989, in load
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     entry =
__import__(self.module_name, globals(),globals(), ['__name__'])
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/lib/python2.7/site-packages/ckanext_datajson-0.1-py2.7.egg/ckanext/datajson/plugin.py",
line 14, in <module>
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     from
package_to_pod import make_datajson_entry, get_facet_fields
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/lib/python2.7/site-packages/ckanext_datajson-0.1-py2.7.egg/ckanext/datajson/package_to_pod.py",
line 3, in <module>
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     import validator
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/default/lib/python2.7/site-packages/ckanext_datajson-0.1-py2.7.egg/ckanext/datajson/validator.py",
line 28, in <module>
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     for row in
csv.DictReader(urllib.urlopen("
https://raw.github.com/seanherron/OMB-Agency-Bureau-and-Treasury-Codes/master/omb-agency-bureau-treasury-codes.csv
")):
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/python2.7/urllib.py", line 86, in urlopen
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     return
opener.open(url)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/python2.7/urllib.py", line 207, in open
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     return
getattr(self, name)(url)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/python2.7/urllib.py", line 436, in open_https
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     h.endheaders(data)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/python2.7/httplib.py", line 954, in endheaders
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]
self._send_output(message_body)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/python2.7/httplib.py", line 814, in _send_output
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     self.send(msg)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/python2.7/httplib.py", line 776, in send
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     self.connect()
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/python2.7/httplib.py", line 1157, in connect
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     self.timeout,
self.source_address)
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]   File
"/usr/lib/python2.7/socket.py", line 571, in create_connection
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1]     raise err
[Fri Oct 03 06:40:09 2014] [error] [client 127.0.0.1] IOError: [Errno
socket error] [Errno 110] Connection timed out
------------------------------------------------------

Now, this is failing on a connection issue, and, very unfortunately, our
system is having those types of issues right now.  So, I can't really tell
if what I did will fix the issue.  However, it seems that it got past the
dependency issue as it's going beyond the import.  Does this fix this
circular dependency issue?  Keep in mind that the previous code was
retrieved right from GitHub without any modifications.  Someone had
suggested that this plugin was written towards a 2.0.1 version of CKAN and
it needed to be modified for later versions.  Do you think this was the
modification needed?

Thanks,

Renato

On Fri, Oct 3, 2014 at 9:29 AM, David Read <david.read at hackneyworkshop.com>
wrote:

> Hopefully the line numbers will change, proving that the new import
> was inserted into apache.wsgi and apache is rereading it.
>
> There is some circular dependency thing going on. apache.wsgi imports
> paste.deploy, which in turn imports the DataJsonPlugin and that in
> turn pulls in ckan's toolkit and that tries to import paste.deploy
> again. It's certainly something that crops up for people occasionally
> when installing extensions.
>
> David
>
> On 3 October 2014 14:23, Renato Guevara <guevara.renato at gmail.com> wrote:
> > Dave,
> >
> > The error is exactly the same.  I restarted Apache and Nginx, and when I
> > tried to launch a browser to CKAN, I get the exact same logs.
> >
> > Renato
> >
> > On Fri, Oct 3, 2014 at 9:20 AM, David Read <
> david.read at hackneyworkshop.com>
> > wrote:
> >>
> >> Do paste the error message for when you try that.
> >>
> >> Dave
> >>
> >> On 3 October 2014 14:16, Renato Guevara <guevara.renato at gmail.com>
> wrote:
> >> > Thank you for your response.
> >> >
> >> > I actually did try pasting it in the apache.wsgi file, but
> >> > unfortunately,
> >> > this issue still continues.
> >> >
> >> > On Fri, Oct 3, 2014 at 9:11 AM, David Read
> >> > <david.read at hackneyworkshop.com>
> >> > wrote:
> >> >>
> >> >> It could well be the dependency bug mentioned.
> >> >>
> >> >> In your case, the wsgi.py file it refers to is:
> >> >> /etc/ckan/default/apache.wsgi
> >> >>
> >> >> so try editing that as it suggests and restarting apache to see if
> the
> >> >> error goes.
> >> >>
> >> >> David
> >> >>
> >> >> On 29 September 2014 13:58, Renato Guevara <guevara.renato at gmail.com
> >
> >> >> wrote:
> >> >> > I've been trying to install ckanext-datajson using the the
> >> >> > instructions
> >> >> > located at this site:
> >> >> >
> >> >> > https://github.com/HHS/ckanext-datajson
> >> >> >
> >> >> > There is a section where it says that there may be a dependency
> bug.
> >> >> > I
> >> >> > couldn't find a wsgi.py file with the line:
> >> >> >
> >> >> > from paste.deploy import loadapp
> >> >> >
> >> >> > So, I'm not sure if this applied to me or not.  However, when I
> >> >> > restart
> >> >> > apache2, and I try to go to the ckan server, I get a server error.
> >> >> > When
> >> >> > I
> >> >> > look at the logs, I get the following:
> >> >> >
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1] mod_wsgi
> >> >> > (pid=31295):
> >> >> > Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded
> >> >> > as
> >> >> > Python module.
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1] mod_wsgi
> >> >> > (pid=31295):
> >> >> > Exception occurred processing WSGI script
> >> >> > '/etc/ckan/default/apache.wsgi'.
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1] Traceback
> (most
> >> >> > recent
> >> >> > call last):
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> > "/etc/ckan/default/apache.wsgi", line 5, in <module>
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]     from
> >> >> > paste.deploy
> >> >> > import loadapp
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> >
> >> >> >
> >> >> >
> "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/__init__.py",
> >> >> > line 3, in <module>
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]     from
> >> >> > paste.deploy.loadwsgi import *
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> >
> >> >> >
> >> >> >
> "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
> >> >> > line 8, in <module>
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]     import
> >> >> > pkg_resources
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> >
> >> >> >
> >> >> >
> "/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py",
> >> >> > line 2727, in <module>
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]
> >> >> > add_activation_listener(lambda dist: dist.activate())
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> >
> >> >> >
> >> >> >
> "/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py",
> >> >> > line 700, in subscribe
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]
> >> >> > callback(dist)
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> >
> >> >> >
> >> >> >
> "/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py",
> >> >> > line 2727, in <lambda>
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]
> >> >> > add_activation_listener(lambda dist: dist.activate())
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> >
> >> >> >
> >> >> >
> "/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py",
> >> >> > line 2230, in activate
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]
> >> >> > map(declare_namespace,
> self._get_metadata('namespace_packages.txt'))
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> >
> >> >> >
> >> >> >
> "/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py",
> >> >> > line 1827, in declare_namespace
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]
> >> >> > _handle_ns(packageName, path_item)
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> >
> >> >> >
> >> >> >
> "/usr/lib/ckan/default/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py",
> >> >> > line 1797, in _handle_ns
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]
> >> >> > loader.load_module(packageName); module.__path__ = path
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> > "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]     mod =
> >> >> > imp.load_module(fullname, self.file, self.filename, self.etc)
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> >
> >> >> >
> >> >> >
> "/usr/lib/ckan/default/lib/python2.7/site-packages/ckanext_datajson-0.1-py2.7.egg/ckanext/datajson/__init__.py",
> >> >> > line 9, in <module>
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]     from
> plugin
> >> >> > import
> >> >> > DataJsonPlugin
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> >
> >> >> >
> >> >> >
> "/usr/lib/ckan/default/lib/python2.7/site-packages/ckanext_datajson-0.1-py2.7.egg/ckanext/datajson/plugin.py",
> >> >> > line 1, in <module>
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]     import
> >> >> > ckan.plugins as p
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> > "/usr/lib/ckan/default/src/ckan/ckan/plugins/__init__.py", line 5,
> in
> >> >> > <module>
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]     import
> >> >> > toolkit
> >> >> > as
> >> >> > _toolkit
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]   File
> >> >> > "/usr/lib/ckan/default/src/ckan/ckan/plugins/toolkit.py", line 4,
> in
> >> >> > <module>
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]     import
> >> >> > paste.deploy.converters as converters
> >> >> > [Mon Sep 29 05:44:03 2014] [error] [client 127.0.0.1]
> AttributeError:
> >> >> > 'module' object has no attribute 'deploy'
> >> >> >
> >> >> > What am I doing wrong or what am I forgetting to do?
> >> >> >
> >> >> > Thank you in advance.
> >> >> >
> >> >> > Renato Guevara
> >> >> >
> >> >> > _______________________________________________
> >> >> > ckan-dev mailing list
> >> >> > ckan-dev at lists.okfn.org
> >> >> > https://lists.okfn.org/mailman/listinfo/ckan-dev
> >> >> > Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> >> >> >
> >> >> _______________________________________________
> >> >> ckan-dev mailing list
> >> >> ckan-dev at lists.okfn.org
> >> >> https://lists.okfn.org/mailman/listinfo/ckan-dev
> >> >> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> >> >
> >> >
> >> >
> >> > _______________________________________________
> >> > ckan-dev mailing list
> >> > ckan-dev at lists.okfn.org
> >> > https://lists.okfn.org/mailman/listinfo/ckan-dev
> >> > Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> >> >
> >> _______________________________________________
> >> ckan-dev mailing list
> >> ckan-dev at lists.okfn.org
> >> https://lists.okfn.org/mailman/listinfo/ckan-dev
> >> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> >
> >
> >
> > _______________________________________________
> > ckan-dev mailing list
> > ckan-dev at lists.okfn.org
> > https://lists.okfn.org/mailman/listinfo/ckan-dev
> > Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> >
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20141003/29276e60/attachment-0003.html>


More information about the ckan-dev mailing list