camptocamp / c2cgeoportal

c2cgeoportal application
http://geomapfish.org
Other
63 stars 46 forks source link

Python error with OWSLib when upgraded to 1.4 #876

Closed rbovard closed 10 years ago

rbovard commented 10 years ago

After upgrading to 1.4, I got a 500 error. I don't know if it's related to the upgrade or if it's specific for my case...

Here is the log, maybe something obvious is wrong?

mod_wsgi (pid=15078): Target WSGI script '/var/www/vhosts/nyon_geoportail/private/dev/buildout/parts/modwsgi/wsgi' cannot be loaded as Python module.
mod_wsgi (pid=15078): Exception occurred processing WSGI script '/var/www/vhosts/nyon_geoportail/private/dev/buildout/parts/modwsgi/wsgi'.
Traceback (most recent call last):
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/parts/modwsgi/wsgi", line 119, in <module>
    application = loadapp("config:" + configfile, name=None)
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 272, in loadobj
    return context.create()
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 710, in create
    return self.object_type.invoke(self)
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 203, in invoke
    app = context.app_context.create()
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 710, in create
    return self.object_type.invoke(self)
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 146, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/util.py", line 56, in fix_call
    val = callable(*args, **kw)
  File "/var/www/vhosts/nyon_geoportail/private/dev/nyon/__init__.py", line 23, in main
    config.include('c2cgeoportal')
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/pyramid-1.3.4-py2.6.egg/pyramid/config/__init__.py", line 737, in include
    c(configurator)
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/c2cgeoportal-1.4.0-py2.6.egg/c2cgeoportal/__init__.py", line 342, in includeme
    config.scan(ignore='c2cgeoportal.tests')
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/pyramid-1.3.4-py2.6.egg/pyramid/config/__init__.py", line 912, in scan
    ignore=ignore)
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/venusian-1.0a8-py2.6.egg/venusian/__init__.py", line 199, in scan
    __import__(modname)
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/c2cgeoportal-1.4.0-py2.6.egg/c2cgeoportal/views/entry.py", line 47, in <module>
    from owslib.wms import WebMapService
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/OWSLib-0.8.3-py2.6.egg/owslib/wms.py", line 22, in <module>
    from etree import etree
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/OWSLib-0.8.3-py2.6.egg/owslib/etree.py", line 24, in <module>
    patch_well_known_namespaces(etree)
  File "/var/www/vhosts/nyon_geoportail/private/dev/buildout/eggs/OWSLib-0.8.3-py2.6.egg/owslib/etree.py", line 14, in patch_well_known_namespaces
    etree_module.register_namespace(k, v)
AttributeError: 'module' object has no attribute 'register_namespace'

Thank you

kalbermattenm commented 10 years ago

OWSlib 0.8.3 is not compatible with Python 2.6... Only Python 2.7 and higher...

kalbermattenm commented 10 years ago

See #848

rbovard commented 10 years ago

Hum ok, thanks (again) @kalbermattenm

So it's related to my server...

kalbermattenm commented 10 years ago

Looks like you encounter exactly the same issues as I did ;-)

rbovard commented 10 years ago

Yep :)

Next time we should upgrade "together"

kalbermattenm commented 10 years ago

:+1: :smile:

gnerred commented 10 years ago

Hi @kalbermattenm and @RemiBovard !

I am getting the same problem with OWLIB and Python 2.6... What is next step ? C2C has to solve this issue ?

@kalbermattenm, how did you install and make run 1.4 ?

Thanks

kalbermattenm commented 10 years ago

I changed my version of OWSlib back to 0.7.2 in versions.cfg. You just won't be able to use a WMS-T default time (when setting a time slider), thus the default position of the time slider (I use an awful hack for that directly in sitn\templates\viewer.js...)

I think that C2C should upgrade Python to version 2.7 on our servers (if really you want to make it work)...

As we are on Windows and not using the Debian C2C package, we'll have to do that on our own... thus look with C2C on your side... sorry...

gnerred commented 10 years ago

Thanks @kalbermattenm ! I will go back to OWS 0.7.2. I was affraid to have more bad side effects than the one related to WMS-T. I can wait a bit before using WMS-T.

kalbermattenm commented 10 years ago

Then you're good! I don't think that there is any other side effect. Moreover, I didn't come across any other...

rbovard commented 10 years ago

Hi @gnerred

I also changed versions.cfg:

#OWSLib = 0.8.3 FIXME Not compatible with Python 2.6
OWSLib = 0.7.2

For information, I'm on a C2C server.

sbrunner commented 10 years ago

Yes, the Debian squeeze (oldstable) have Python 2.6, the Debian wheezy (stable) have Python 2.7 see: http://packages.debian.org/search?keywords=python You should get a new server with the new Debian version ! For the next GeoMapFish release we will probably use PostGis 2 and MapServer 6.4 (and Python 3). I you don't needs to get the default value of WMS-time it can be good to wait a little bit to escape to do two migration in a row. @kalbermattenm is it ok I we start to use Python3 or is it a too big challenge for your shared server ?

kalbermattenm commented 10 years ago

@sbrunner, hmmm.... That's going to be challenging...

Do you have any idea when this might occur (some kind of release date, it might just be a period, like "end of 2014" or something like that...) ?

sbrunner commented 10 years ago

Difficult do say it now, we target to do a release in the middle of 2014 !

For you it's to early ? it better at the end of 2014 ?

kalbermattenm commented 10 years ago

Hmmm... Can't say that right now... I have to investigate a bit what this implies.

I'm coming to your offices on Friday afternoon (to see Emmanuel), if you're around, it would be good if we could have a quick talk about it...

rbovard commented 10 years ago

Why did you come back? PR #879

sbrunner commented 10 years ago

Because on too many host we steal have the version 2.6 of Python, but no problem if anybody use the new version :-) Does it make an issue for you ?

rbovard commented 10 years ago

It was just a question :)

So for now the standard use is OWSLib 0.7.2, with no support for WMS-T default time?

sbrunner commented 10 years ago

yes :-)

rbovard commented 10 years ago

Ok, so you can close this issue, fixed by #879