Ticket #915 (closed defect: invalid)

Opened 16 months ago

Last modified 3 months ago

Upload failure (data_dbid, 'NoneType' object has no attribute 'text')

Reported by: ingenieroariel Owned by: groldan
Priority: minor Milestone: 1.x
Component: Upload Version: 1.0
Keywords: Cc:
Total Hours: 0.0 Blocked By:
Sensitive: no Estimated Hours: 0
Blocking:

Description

Today while uploading a file to GeoNode I had this problem:

ubuntu@ip-10-243-119-129:~$ tail -f /var/log/apache2/error.log
[Mon Jan 31 07:29:15 2011] [error]     instance.save_to_geonetwork()
[Mon Jan 31 07:29:15 2011] [error]   File "/var/www/geonode/wsgi/geonode/src/GeoNodePy/geonode/maps/models.py", line 877, in save_to_geonetwork
[Mon Jan 31 07:29:15 2011] [error]     md_link = gn.create_from_layer(self)
[Mon Jan 31 07:29:15 2011] [error]   File "/var/www/geonode/wsgi/geonode/src/GeoNodePy/geonode/geonetwork.py", line 91, in create_from_layer
[Mon Jan 31 07:29:15 2011] [error]     self.set_metadata_privs(layer.uuid, {"all":  {"view": True}})
[Mon Jan 31 07:29:15 2011] [error]   File "/var/www/geonode/wsgi/geonode/src/GeoNodePy/geonode/geonetwork.py", line 135, in set_metadata_privs
[Mon Jan 31 07:29:15 2011] [error]     data_dbid = doc.find('metadata/{http://www.fao.org/geonetwork}info/id').text
[Mon Jan 31 07:29:15 2011] [error] AttributeError: 'NoneType' object has no attribute 'text'
[Mon Jan 31 07:29:15 2011] [error] no explicit link from the resource to [test2], bah
[Mon Jan 31 07:29:16 2011] [error] Finished cleanup after failed GeoNetwork/Django import for layer: test2

I commented this line:

 https://github.com/GeoNode/geonode/blob/master/src/GeoNodePy/geonode/geonetwork.py#L135

data_dbid = doc.find('metadata/{http://www.fao.org/geonetwork}info/id').text

and then changed this line for:

 https://github.com/GeoNode/geonode/blob/master/src/GeoNodePy/geonode/geonetwork.py#L145

"uuid": uuid,

I am not completely sure what the implications of this are, it might allow the upload of a record without being properly saved in GeoNetwork but in my case it fixed the issue and the layer uploaded correctly.

Attachments

provincia.tar.gz Download (422.1 KB) - added by mmiranda 7 months ago.
Data
Screen Shot 2011-10-19 at 3.08.38 PM.png Download (151.0 KB) - added by mmiranda 7 months ago.
Screenshot 1
Screen Shot 2011-10-19 at 3.12.52 PM.png Download (145.4 KB) - added by mmiranda 7 months ago.
Screenshot 2

Change History

Changed 7 months ago by mmiranda

We are also getting this error in GeoNode 1.1 RC2

Is there any well known solution?

Changed 7 months ago by mmiranda

Data

Changed 7 months ago by mmiranda

Screenshot 1

Changed 7 months ago by mmiranda

Screenshot 2

Changed 7 months ago by mmiranda

  • component changed from GeoNetwork to Upload

When I try to upload a shapefile without .prj, GeoNode returns an error (Screenshot 1) and it seems to crash Geonetwork because I can't upload any other file. After that, I get another error every time I try to upload a new file (Screenshot 2).

Environment:
* GeoNode 1.1 RC2
* Debian 6 (Squeeze)

Steps to reproduce:

1. Import attached shape file

http://dev.geonode.org/trac/attachment/ticket/915/provincia.tar.gz

2. You should get an error like this one:

http://dev.geonode.org/trac/attachment/ticket/915/Screen%20Shot%202011-10-19%20at%203.08.38%20PM.png
Note: no matter the error, datastore and layer are created in Geoserver anyway, I guess this shouldn't happen.

3. Try to upload same file or any other
4. Now, you should get this error:

http://dev.geonode.org/trac/attachment/ticket/915/Screen%20Shot%202011-10-19%20at%203.12.52%20PM.png


Note: The problem dissapears when Geonetwork is reloaded through Tomcat manager.

Changed 3 months ago by dwinslow

  • status changed from new to closed
  • resolution set to invalid
Note: See TracTickets for help on using tickets.