Ticket #915 (closed defect: invalid)
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
Change History
Note: See
TracTickets for help on using
tickets.

