[GeoNode-devel] [GeoNode-users] GeoNode-Project CenTOS7 Installation

1520 gis juliermeopensourcedeveloper at gmail.com
Wed Jul 17 12:42:54 PDT 2019


Hi @Francesco,

I am not sure if I understood the whole command line, but I tried that:

python manage.py updatelayers -w workspace -f layer
--settings=geonode.settings

The response still not good. [1] GeoNode-Project at 2.8 Ubuntu at 18.04LTS [2]
GeoNode-Project at 2.10 CentOS7

Ubuntu at 18.04 [1]

root at 2ff53eacb7e9:/usr/src/my_geonode# python manage.py updatelayers -w
geonode -f previsao_meteorologica_ca_be --settings=geonode.settings
JSONField implementation is: <class 'jsonfield.fields.JSONField'>
Traceback (most recent call last):
  File "manage.py", line 31, in <module>
    execute_from_command_line(sys.argv)
  File
"/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
line 354, in execute_from_command_line
    utility.execute()
  File
"/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File
"/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File
"/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
line 445, in execute
    output = self.handle(*args, **options)
  File
"/usr/src/geonode/geonode/geoserver/management/commands/updatelayers.py",
line 98, in handle
    owner = get_valid_user(user)
  File "/usr/src/geonode/geonode/people/utils.py", line 44, in
get_valid_user
    theuser = get_default_user()
  File "/usr/src/geonode/geonode/people/utils.py", line 35, 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



CentOS [2]

docker exec -it django4my_geonode /bin/bash
root at ae2feb72134c:/usr/src/my_geonode# python manage.py updatelayers -w
geonode -f amazonia_legal --settings=geonode.settings
Inspecting the available layers in GeoServer ...
Found 1 layers, starting processing
/usr/local/lib/python2.7/site-packages/owslib/iso.py:117: FutureWarning:
the .identification and .serviceidentification properties will merge into
.identification being a list of properties.  This is currently implemented
in .identificationinfo.  Please see
https://github.com/geopython/OWSLib/issues/38 for more information
  FutureWarning)
/usr/local/lib/python2.7/site-packages/owslib/iso.py:495: FutureWarning:
The .keywords and .keywords2 properties will merge into the .keywords
property in the future, with .keywords becoming a list of MD_Keywords
instances. This is currently implemented in .keywords2. Please see
https://github.com/geopython/OWSLib/issues/301 for more information
  FutureWarning)
/usr/local/lib/python2.7/site-packages/geoserver/style.py:73:
FutureWarning: The behavior of this method will change in future versions.
Use specific 'len(elem)' or 'elem is not None' test instead.
  if not user_style:
/usr/local/lib/python2.7/site-packages/geoserver/style.py:77:
FutureWarning: The behavior of this method will change in future versions.
Use specific 'len(elem)' or 'elem is not None' test instead.
  if user_style:
... Creating Default Resource Linkks for Layer [geonode:amazonia_legal]
Profile matching query does not exist.
Traceback (most recent call last):
  File "/usr/src/geonode/geonode/layers/utils.py", line 1079, in
create_gs_thumbnail_geonode
    user = get_user_model().objects.get(username=username)
  File
"/usr/local/lib/python2.7/site-packages/django/db/models/manager.py", line
85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py",
line 380, in get
    self.model._meta.object_name
DoesNotExist: Profile matching query does not exist.
... Creating Thumbnail for Layer [geonode:amazonia_legal]
Profile matching query does not exist.
Traceback (most recent call last):
  File "/usr/src/geonode/geonode/layers/utils.py", line 1079, in
create_gs_thumbnail_geonode
    user = get_user_model().objects.get(username=username)
  File
"/usr/local/lib/python2.7/site-packages/django/db/models/manager.py", line
85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py",
line 380, in get
    self.model._meta.object_name
DoesNotExist: Profile matching query does not exist.
[created] Layer amazonia_legal (1/1)


Finished processing 1 layers in 10.0 seconds.

1 Created layers
0 Updated layers
0 Failed layers
10.000000 seconds per layer
root at ae2feb72134c:/usr/src/my_geonode# python manage.py updatelayers -f
amazonia_legal --settings=geonode.settings
Inspecting the available layers in GeoServer ...
Found 1 layers, starting processing
/usr/local/lib/python2.7/site-packages/owslib/iso.py:117: FutureWarning:
the .identification and .serviceidentification properties will merge into
.identification being a list of properties.  This is currently implemented
in .identificationinfo.  Please see
https://github.com/geopython/OWSLib/issues/38 for more information
  FutureWarning)
/usr/local/lib/python2.7/site-packages/owslib/iso.py:495: FutureWarning:
The .keywords and .keywords2 properties will merge into the .keywords
property in the future, with .keywords becoming a list of MD_Keywords
instances. This is currently implemented in .keywords2. Please see
https://github.com/geopython/OWSLib/issues/301 for more information
  FutureWarning)
/usr/local/lib/python2.7/site-packages/geoserver/style.py:73:
FutureWarning: The behavior of this method will change in future versions.
Use specific 'len(elem)' or 'elem is not None' test instead.
  if not user_style:
/usr/local/lib/python2.7/site-packages/geoserver/style.py:77:
FutureWarning: The behavior of this method will change in future versions.
Use specific 'len(elem)' or 'elem is not None' test instead.
  if user_style:
[updated] Layer amazonia_legal (1/1)


Finished processing 1 layers in 4.0 seconds.

0 Created layers
1 Updated layers
0 Failed layers
4.000000 seconds per layer
root at ae2feb72134c:/usr/src/my_geonode# python manage.py updatelayers -w
geonode -f amazonia_legal --settings=geonode.settings



On Wed, Jul 17, 2019 at 3:57 PM Francesco Bartoli <xbartolone at gmail.com>
wrote:

> You are still not passing the settings option
> Il 17 lug 2019, 20:47 +0200, 1520 gis <
> juliermeopensourcedeveloper at gmail.com>, ha scritto:
>
> Yes, you are right. We got close, but still an issue. See bellow please
> with django-admin and manage.py
>
> root at bdeea2347fe6:/usr/src/my_geonode# django-admin updatelayers
> Traceback (most recent call last):
>   File "/usr/local/bin/django-admin", line 10, in <module>
>     sys.exit(execute_from_command_line())
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 364, in execute_from_command_line
>     utility.execute()
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 356, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 283, in run_from_argv
>     self.execute(*args, **cmd_options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 330, in execute
>     output = self.handle(*args, **options)
>   File
> "/usr/local/lib/python2.7/site-packages/geonode/geoserver/management/commands/updatelayers.py",
> line 98, in handle
>     owner = get_valid_user(user)
>   File "/usr/local/lib/python2.7/site-packages/geonode/people/utils.py",
> line 44, in get_valid_user
>     theuser = get_default_user()
>   File "/usr/local/lib/python2.7/site-packages/geonode/people/utils.py",
> line 31, in get_default_user
>     if superusers.count() > 0:
>   File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py",
> line 364, in count
>     return self.query.get_count(using=self.db)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
> line 499, in get_count
>     number = obj.get_aggregation(using, ['__count'])['__count']
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
> line 480, in get_aggregation
>     result = compiler.execute_sql(SINGLE)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
> line 899, in execute_sql
>     raise original_exception
> django.db.utils.OperationalError: no such table: people_profile
> root at bdeea2347fe6:/usr/src/my_geonode# python manage.py updatelayers
> Traceback (most recent call last):
>   File "manage.py", line 31, in <module>
>     execute_from_command_line(sys.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 364, in execute_from_command_line
>     utility.execute()
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 356, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 283, in run_from_argv
>     self.execute(*args, **cmd_options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 330, in execute
>     output = self.handle(*args, **options)
>   File
> "/usr/local/lib/python2.7/site-packages/geonode/geoserver/management/commands/updatelayers.py",
> line 98, in handle
>     owner = get_valid_user(user)
>   File "/usr/local/lib/python2.7/site-packages/geonode/people/utils.py",
> line 44, in get_valid_user
>     theuser = get_default_user()
>   File "/usr/local/lib/python2.7/site-packages/geonode/people/utils.py",
> line 31, in get_default_user
>     if superusers.count() > 0:
>   File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py",
> line 364, in count
>     return self.query.get_count(using=self.db)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
> line 499, in get_count
>     number = obj.get_aggregation(using, ['__count'])['__count']
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
> line 480, in get_aggregation
>     result = compiler.execute_sql(SINGLE)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
> line 899, in execute_sql
>     raise original_exception
> django.db.utils.OperationalError: no such table: people_profile
>
> On Wed, Jul 17, 2019 at 2:59 PM Ran L. <kula009 at gmail.com> wrote:
>
> But you are getting a different error message this time. Could you try the
> simple command:
>
> 'django-admin updatelayers'
>
> And see how it goes?
>
> Ran
>
> On Wed, Jul 17, 2019 at 10:30 AM 1520 gis <
> juliermeopensourcedeveloper at gmail.com> wrote:
>
> Thank you very much Ran, but the issue remains.
>
> 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;
> DATABASE_URL=postgres://geonode:geonode@db:5432/geonode
> GEODATABASE_URL=postgis://geonode_data:geonode_data@db:5432/geonode_data
> SITEURL=http://cgticgeo.sipam.gov.br/
> ALLOWED_HOSTS=['cgticgeo.sipam.gov.br', 'cgticgeo.sipam.gov.br', '
> cgticgeo.sipam.gov.br:80', 'geonode', 'django']
> GEOSERVER_PUBLIC_LOCATION=http://cgticgeo.sipam.gov.br/geoserver/
> root at 2ff53eacb7e9:/usr/src/my_geonode# python manage.py updatelayers -w
> geonode -f previsao_meteorologica_aml
> JSONField implementation is: <class 'jsonfield.fields.JSONField'>
> Inspecting the available layers in GeoServer ...
> Found 1 layers, starting processing
> Could not retrieve GeoFence Rules count.
> Could not retrieve GeoFence Rules count.
> ... Creating Thumbnail for Layer [geonode:previsao_meteorologica_aml]
> Could not retrieve GeoFence Rules count.
> Could not retrieve GeoFence Rules count.
> Stopping process because --ignore-errors was not set and an error was
> found.
> Traceback (most recent call last):
>   File "manage.py", line 31, in <module>
>     execute_from_command_line(sys.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 354, in execute_from_command_line
>     utility.execute()
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 346, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 394, in run_from_argv
>     self.execute(*args, **cmd_options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 445, in execute
>     output = self.handle(*args, **options)
>   File
> "/usr/src/geonode/geonode/geoserver/management/commands/updatelayers.py",
> line 124, in handle
>     execute_signals=True)
>   File "/usr/src/geonode/geonode/geoserver/helpers.py", line 630, in
> gs_slurp
>     layer.set_permissions(perm_spec)
>   File "/usr/src/geonode/geonode/security/models.py", line 205, in
> set_permissions
>     sync_geofence_with_guardian(self.layer, perms, user=geofence_user)
>   File "/usr/src/geonode/geonode/decorators.py", line 48, in wrapper
>     return func(*args, **kwargs)
>   File "/usr/src/geonode/geonode/security/utils.py", line 448, in
> sync_geofence_with_guardian
>     _update_geofence_rule(layer.name, layer.workspace, service,
> user=_user)
>   File "/usr/src/geonode/geonode/security/utils.py", line 592, in
> _update_geofence_rule
>     raise RuntimeError(msg)
> Exception: ('Failed to process previsao_meteorologica_aml',
> RuntimeError('Could not ADD GeoServer User \'admin\' Rule for Layer
> u\'previsao_meteorologica_aml\': \'u\'<!doctype html><html
> lang="en"><head><title>HTTP Status 404 \\u2013 Not Found</title><style
> type="text/css">h1
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
> h2
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
> h3
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
> body
> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
> p
> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
> a {color:black;} a.name {color:black;} .line
> {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP
> Status 404 \\u2013 Not Found</h1><hr class="line" /><p><b>Type</b> Status
> Report</p><p><b>Description</b> The origin server did not find a current
> representation for the target resource or is not willing to disclose that
> one exists.</p><hr class="line" /><h3>Apache
> Tomcat/9.0.19</h3></body></html>\'\'',))
>
> Kind regards
>
> Julierme
>
> On Wed, Jul 17, 2019 at 2:23 PM Ran L. <kula009 at gmail.com> wrote:
>
> Hi Julierme,
>
> I had the problem you described before. The reason you are getting this is
> because the env variables are not set properly. Run this command before
> running any other commands:
>
> 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;
>
> You should be able to run the commands then.
>
> I
>
>
>
> On Wed, Jul 17, 2019 at 10:19 AM 1520 gis <
> juliermeopensourcedeveloper at gmail.com> wrote:
>
> Hi Ran,
>
> Thank you very much for your reply. Yes, I just installed a brand new
> version of GeoNode-Project at 2.8 and updatelayers did not work. See the
> response in [1]. I then ran
>
> python manage.py makemigrations
> python manage.py migrate
>
> However, the problem remains. I am now asked for a superuser [2]. I did
> create a superuser for GeoNode-Project in a CenTOS7, but did not solve the
> problem. The issue also happens in GeoNode-Project at 2.10.
> Any help would be appreciated.
>
> Kind regards
>
> Julierme
>
> [1]
> root at 2ff53eacb7e9:/usr/src/my_geonode# python manage.py updatelayers -s
> metoc -f previsao_meteorologica_aml
> JSONField implementation is: <class 'jsonfield.fields.JSONField'>
> Traceback (most recent call last):
>   File "manage.py", line 31, in <module>
>     execute_from_command_line(sys.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 354, in execute_from_command_line
>     utility.execute()
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 346, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 394, in run_from_argv
>     self.execute(*args, **cmd_options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 445, in execute
>     output = self.handle(*args, **options)
>   File
> "/usr/src/geonode/geonode/geoserver/management/commands/updatelayers.py",
> line 98, in handle
>     owner = get_valid_user(user)
>   File "/usr/src/geonode/geonode/people/utils.py", line 44, in
> get_valid_user
>     theuser = get_default_user()
>   File "/usr/src/geonode/geonode/people/utils.py", line 31, in
> get_default_user
>     if superusers.count() > 0:
>   File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py",
> line 318, in count
>     return self.query.get_count(using=self.db)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
> line 466, in get_count
>     number = obj.get_aggregation(using, ['__count'])['__count']
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
> line 447, in get_aggregation
>     result = compiler.execute_sql(SINGLE)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
> line 840, in execute_sql
>     cursor.execute(sql, params)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line
> 79, in execute
>     return super(CursorDebugWrapper, self).execute(sql, params)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line
> 64, in execute
>     return self.cursor.execute(sql, params)
>   File "/usr/local/lib/python2.7/site-packages/django/db/utils.py", line
> 98, in __exit__
>     six.reraise(dj_exc_type, dj_exc_value, traceback)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line
> 64, in execute
>     return self.cursor.execute(sql, params)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py",
> line 318, in execute
>     return Database.Cursor.execute(self, query, params)
> django.db.utils.OperationalError: no such table: people_profile
>
> [2]
> root at 2ff53eacb7e9:/usr/src/my_geonode# python manage.py updatelayers -f
> previsao_meteorologica_aml
> JSONField implementation is: <class 'jsonfield.fields.JSONField'>
> Traceback (most recent call last):
>   File "manage.py", line 31, in <module>
>     execute_from_command_line(sys.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 354, in execute_from_command_line
>     utility.execute()
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 346, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 394, in run_from_argv
>     self.execute(*args, **cmd_options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 445, in execute
>     output = self.handle(*args, **options)
>   File
> "/usr/src/geonode/geonode/geoserver/management/commands/updatelayers.py",
> line 98, in handle
>     owner = get_valid_user(user)
>   File "/usr/src/geonode/geonode/people/utils.py", line 44, in
> get_valid_user
>     theuser = get_default_user()
>   File "/usr/src/geonode/geonode/people/utils.py", line 35, 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
>
> On Wed, Jul 17, 2019 at 2:06 PM Ran L. <kula009 at gmail.com> wrote:
>
> Hello Julierme,
>
> I also had issues with the geonode "updatelayers" command yesterday, and
> might have found a possible solution for it:
>
> I'm also using geonode-project with docker on a Ubuntu machine. I couldn't
> run the command successfully after building the service. You can see the
> details here: https://github.com/GeoNode/geonode/issues/4650
>
> *A fix:* I took my own customized files (templates, python files,
> statics, etc.) and dump them into a newly created geonode-project. The
> command worked after that.
>
> My speculation is that the geonode-project files I had were not compatible
> with the current geonode, since I haven't updated them for a long while.
>
> Hope this provides some insights.
>
> Thanks!
>
> Ran
>
>
>
>
>
> On Wed, Jul 17, 2019 at 9:47 AM 1520 gis <
> juliermeopensourcedeveloper at gmail.com> wrote:
>
> Dear users and developers,
>
> I am not sure if it is on the scope of future work, but I have already
> started a tutorial to install GeoNode-Project via Docker on a CentOS7
> server. I got it installed, but not sure that I got all required geonode
> packages on a CenTOS7. Also, I had an issue while using python manage.py
> updatelayers.
>
> I am making myself a volunteer to help on this theme. I would like to
> share the command lines and have someones' contribution to improve what I
> got so far.
>
> Kind regards,
>
> Julierme
>
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geonode-users
>
> _______________________________________________
> geonode-devel mailing list
> geonode-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geonode-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-devel/attachments/20190717/018cfd39/attachment-0001.html>


More information about the geonode-devel mailing list