[GeoNode-users] Updatelayers failed

Florian Hoedt florian.hoedt at thuenen.de
Mon Feb 10 00:15:02 PST 2020


Hello José, 

The line: " Could not ADD GeoServer User 'admin' Rule for Layer 'termicas': ''Duplicate Rule Rule[id:null pri:3742 user:admin srv:WPS ws:geonode l:termicas acc:ALLOW]'' " 
means there was already a rule with the same content in place. There shouldn´t be any upcoming issues. 

-- 
MSc Florian Hoedt 
Coordinator Geoinformatics | OpenData Representative 
Thünen Institute, Centre for Information Management 
Bundesallee 44 
38116 Braunschweig 

Tel: +49 531 596-1428 
Fax: +49 531 596-1499 
Mail: florian.hoedt at thuenen.de 
Web: www.thuenen.de 

The Johann Heinrich von Thünen Institute, Federal Research Institute for Rural Areas, Forestry and Fisheries – Thünen Institute in brief – consists of 14 specialized institutes that carry out research and provide policy advice in the fields of economy, ecology and technology. 


Von: "Jose Cáceres" <jose.atyus at gmail.com> 
An: "geonode-users" <geonode-users at lists.osgeo.org> 
Gesendet: Freitag, 7. Februar 2020 23:50:37 
Betreff: Re: [GeoNode-users] Updatelayers failed 

Hi again, 
Sorry but just as a followed up, I did the following lines as suggested here [ http://osgeo-org.1560.x6.nabble.com/Command-updatelayers-and-createsuperuser-in-docker-compose-td5393949.html | http://osgeo-org.1560.x6.nabble.com/Command-updatelayers-and-createsuperuser-in-docker-compose-td5393949.html ] : 



mkdir -p /usr/src/app/; \ 
source $HOME/.override_env; \ 
echo DATABASE_URL=$DATABASE_URL; \ 
echo GEODATABASE_URL=$GEODATABASE_URL; \ 
echo SITEURL=$SITEURL; \ 
echo ALLOWED_HOSTS=$ALLOWED_HOSTS; \ 
echo GEOSERVER_PUBLIC_LOCATION=$GEOSERVER_PUBLIC_LOCATION; \ 
django-admin createsuperuser 




Then I created the superuser and ran again: 

BQ_BEGIN

DJANGO_SETTINGS_MODULE=geonode.settings python manage.py updatelayers -w geonode 


BQ_END
This time it ran ok, although for every layer I got the following message: 

BQ_BEGIN

Could not ADD GeoServer User 'admin' Rule for Layer 'termicas': ''Duplicate Rule Rule[id:null pri:3742 user:admin srv:WPS ws:geonode l:termicas acc:ALLOW]'' 


BQ_END
But in the end it showed as expected: 

BQ_BEGIN

113 Created layers 
1 Updated layers 
0 Failed layers 
10.98 seconds per layer 

BQ_END


I can see my layers just fine in Geonode, but I'm not sure if the error that I got is gonna mess everything, so I would like to know why was that about. 

Again thanks for your help. 

Kind regards, 

José 




[ https://mailtrack.io/?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5& | 
                        
                     ] 	Remitente notificado con 
[ https://mailtrack.io/?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5& | Mailtrack ] 07/02/20 16:48:26 	

On Fri, Feb 7, 2020 at 1:42 PM Jose Cáceres < [ mailto:jose.atyus at gmail.com | jose.atyus at gmail.com ] > wrote: 

BQ_BEGIN

Hi everyone, 
Hope everything is well. 

I'm running geonode 2.10 using docker instance as per this instructions: [ http://docs.geonode.org/en/2.10.x/install/core/#docker | http://docs.geonode.org/en/2.10.x/install/core/#docker ] 

I'm running it on a local IP, not localhost directly, but I thought everything went well with the installation since I could load the page, load geoserver, uploading a layer using the upload function form the site, I could dump me own database into geonode_data and I could see my layers in geoserver, all as shown in the screenshots attached. 

However, when I try to import my data to geonode from geoserver, using the updatelayers command I get the following error message. 

So I enter the container running: 

BQ_BEGIN

docker exec -it geoserver4geonode /bin/bash 

BQ_END

The I ran: 

BQ_BEGIN

python manage.py makemigrations
python manage.py migrate 
python manage.py migrate --run-syncdb 

BQ_END


Everything went without any issues. Then I tried: 

BQ_BEGIN

DJANGO_SETTINGS_MODULE=geonode.settings python manage.py updatelayers -w geonode --skip-geonode-registered 

BQ_END


And got the following error: 

BQ_BEGIN

Traceback (most recent call last): 
File "manage.py", line 29, in <module> 
execute_from_command_line(sys.argv) 
File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line 
utility.execute() 
File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute 
self.fetch_command(subcommand).run_from_argv(self.argv) 
File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv 
self.execute(*args, **cmd_options) 
File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute 
output = self.handle(*args, **options) 
File "/usr/src/app/geonode/geoserver/management/commands/updatelayers.py", line 98, in handle 
owner = get_valid_user(user) 
File "/usr/src/app/geonode/people/utils.py", line 46, in get_valid_user 
theuser = get_default_user() 
File "/usr/src/app/geonode/people/utils.py", line 37, in get_default_user 
raise GeoNodeException('You must have an admin account configured ' 
geonode.GeoNodeException: You must have an admin account configured before importing data. Try: django-admin.py createsuperuser 

BQ_END


Then I tried passing the flag user to the previous command, like this: 

BQ_BEGIN

DJANGO_SETTINGS_MODULE=geonode.settings python manage.py updatelayers -u admin -w geonode --skip-geonode-registered 

Traceback (most recent call last): 
File "manage.py", line 29, in <module> 
execute_from_command_line(sys.argv) 
File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line 
utility.execute() 
File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute 
self.fetch_command(subcommand).run_from_argv(self.argv) 
File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv 
self.execute(*args, **cmd_options) 
File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute 
output = self.handle(*args, **options) 
File "/usr/src/app/geonode/geoserver/management/commands/updatelayers.py", line 98, in handle 
owner = get_valid_user(user) 
File "/usr/src/app/geonode/people/utils.py", line 48, in get_valid_user 
theuser = get_user_model().objects.get(username=user) 
File "/usr/local/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method 
return getattr(self.get_queryset(), name)(*args, **kwargs) 
File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 408, in get 
self.model._meta.object_name 
geonode.people.models.DoesNotExist: Profile matching query does not exist. 

BQ_END


No luck either, I can log to the site using the default credentials, but I haven't created any other users, is that necesary in order to use the updatelayers? 

Thanks in advance for all your help! 

José 

-- 
José David Cáceres 
Ingeniero Ambiental 
Máster en Tecnologías de la Información Geográfica 
e-mail: [ mailto:jose.atyus at gmail.com | jose.atyus at gmail.com ] 

BQ_END



-- 
José David Cáceres 
Ingeniero Ambiental 
Máster en Tecnologías de la Información Geográfica 
e-mail: [ mailto:jose.atyus at gmail.com | jose.atyus at gmail.com ] 

_______________________________________________ 
geonode-users mailing list 
geonode-users at lists.osgeo.org 
https://lists.osgeo.org/mailman/listinfo/geonode-users 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20200210/a1385628/attachment.html>


More information about the geonode-users mailing list