[GeoNode-users] Updatelayers failed

Jose Cáceres jose.atyus at gmail.com
Fri Feb 7 14:50:37 PST 2020


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
:


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:

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

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

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]''

But in the end it showed as expected:

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



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é




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

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

> 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
>
> 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:
>
> docker exec -it geoserver4geonode /bin/bash
>
> The I ran:
>
> python manage.py makemigrations
> python manage.py migrate
>
> python manage.py migrate --run-syncdb
>
>
> Everything went without any issues. Then I tried:
>
> DJANGO_SETTINGS_MODULE=geonode.settings python manage.py updatelayers -w
> geonode --skip-geonode-registered
>
>
> And got the following error:
>
> 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
>
>
> Then I tried passing the flag user to the previous command, like this:
>
> 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.
>
>
> 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: jose.atyus at gmail.com
>


-- 
José David Cáceres
Ingeniero Ambiental
Máster en Tecnologías de la Información Geográfica
e-mail: jose.atyus at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20200207/76a3959d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: layers.jpg
Type: image/jpeg
Size: 273138 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20200207/76a3959d/attachment-0001.jpg>


More information about the geonode-users mailing list