[GeoNode-users] how to debug geonode

Ariel Nunez ingenieroariel at gmail.com
Mon Nov 2 05:23:13 PST 2015


Eugenio,

On a high level, what is going on is that GeoNode serializes the ma
information into json, puts it back in the database and when you are about
to view it, it tries to deserialize it and identify where GeoServer is.
That whole line where it plays with the index[1] seems like a weak point
and something that can be improved. That seems to be failing in your use
case, both when saving and when viewing, not sure what is different in your
installation but I believe it would be great to improve that part of the
codebase to accommodate your setup.

To debug the issue, you do not need to worry about Apache, just replicate
what it is doing:

python manage.py shell

from django.contrib.auth.models import User
from geonode.maps.models import Map
user = User.objects.get(username='yournamehere')
map_obj = Map.objects.get(id=<mapid>)
config = map_obj.viewer_json(user)

With this, you should be able to see the same error. If that is not the
case, then you can still open up the file /dati/geonode/geonode/utils.py in
line 265 and start breaking that line of code into smaller lines that do
the same thing and see where it is that it breaks. In particular, what is
in the keys object, printing it to the error log, etc.

-a

[1]  ... str(int(keys[-1]) + 1)] = settings.MAP_BASELAYERS[0]['source']

On Mon, Nov 2, 2015 at 5:08 AM, Eugenio Trumpy <frippe12573 at hotmail.com>
wrote:

> Sorry I sent this email before finish it.
>
> Following the last line:
>
> then I run: python -m ipdb manage.py runserver
>
> I entered in the ipdb shell, but now I don't know what I have to do to
> understand what does produce the error.
> Can you help me?
>
> Just to give you some more info, my sistem is ubuntu 14.04 server, apache
> is 2.4.7, tomcat is 7 and geonode* 2.4.dev20151029080001*.
> Running my installation with the DEV server everythings works fine.
>
> thank you
>
> best
>
> Eugenio
>
>
>
> ------------------------------
> From: frippe12573 at hotmail.com
> To: geonode-users at lists.osgeo.org
> Subject: how to debug geonode
> Date: Mon, 2 Nov 2015 10:38:36 +0100
>
>
> Hello everybody,
>
> unfortunately something is going wrong onmy geonode installation (it's a
> custom installation from git).
> Actually almost all the functions are working, but the only one that gives
> me problem is the map save (I wrote the days before here in the list but
> any answer was good to solve this issue), so geonode developers suggested
> me to work with the IPDB debugger.
>
> My issues is on the function to save maps. I got a generic 500 internal
> server error on saving from the geonode interface. Apache error log stated
> a segmentation fault on wsgi module. Although I got this error on saving
> maps, the application insert a record in the geonode DB, in fact I can see
> the map listed on the portal, however if I choose such map I got a page
> error reporting an error like: list index out of range. The apache error
> log reports:
> [:error] [pid 30692] Internal Server Error: /maps/116
> [Mon Oct 12 17:44:22.050107 2015] [:error] [pid 30692] Traceback (most
> recent call last):
> [Mon Oct 12 17:44:22.050114 2015] [:error] [pid 30692]   File
> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line
> 112, in get_response
> [Mon Oct 12 17:44:22.050120 2015] [:error] [pid 30692]     response =
> wrapped_callback(request, *callback_args, **callback_kwargs)
> [Mon Oct 12 17:44:22.050125 2015] [:error] [pid 30692]   File
> "/dati/geonode/geonode/maps/views.py", line 112, in map_detail
> [Mon Oct 12 17:44:22.050130 2015] [:error] [pid 30692]     config =
> map_obj.viewer_json(request.user)
> [Mon Oct 12 17:44:22.050135 2015] [:error] [pid 30692]   File
> "/dati/geonode/geonode/utils.py", line 265, in viewer_json
> [Mon Oct 12 17:44:22.050140 2015] [:error] [pid 30692]
> str(int(keys[-1]) + 1)] = settings.MAP_BASELAYERS[0]['source']
> [Mon Oct 12 17:44:22.050145 2015] [:error] [pid 30692] IndexError: list
> index out of range
>
> That's why I would like to debug geonode.
> Unfortunately I never did it, reading something on the web I did as follow:
>
> I put this line in the utils.py file after the lines which report
> BASELAYERS:
>
> import ipdb; ipdb.set_trace()
>
>
>
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geonode-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20151102/7e8a1209/attachment-0001.html>


More information about the geonode-users mailing list