<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Guys, I believe you were going to use the wrong context for env variables in a container perspective, in fact the error message is referring to a local sqlite database which should not be used in the docker-compose deployment.
<div dir="auto"><br /></div>
<div dir="auto">Defining the specific settings should do the tr  </div>
</div>
</div>
<div name="messageReplySection">Il 17 lug 2019, 19:59 +0200, Ran L. <kula009@gmail.com>, ha scritto:<br />
<blockquote type="cite" class="spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div dir="ltr">But you are getting a different error message this time. Could you try the simple command:
<div><br /></div>
<div>'django-admin updatelayers'<br /></div>
<div><br /></div>
<div>And see how it goes?</div>
<div><br /></div>
<div>Ran</div>
</div>
<br />
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Jul 17, 2019 at 10:30 AM 1520 gis <<a href="mailto:juliermeopensourcedeveloper@gmail.com">juliermeopensourcedeveloper@gmail.com</a>> wrote:<br /></div>
<blockquote class="gmail_quote spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div dir="ltr">
<div>Thank you very much Ran, but the issue remains.<br /></div>
<div><br /></div>
<div>mkdir -p /usr/src/app/; \<br />
> source $HOME/.override_env; \<br />
> echo DATABASE_URL=$DATABASE_URL; \<br />
> echo GEODATABASE_URL=$GEODATABASE_URL; \<br />
> echo SITEURL=$SITEURL; \<br />
> echo ALLOWED_HOSTS=$ALLOWED_HOSTS; \<br />
> echo GEOSERVER_PUBLIC_LOCATION=$GEOSERVER_PUBLIC_LOCATION;<br />
DATABASE_URL=postgres://geonode:geonode@db:5432/geonode<br />
GEODATABASE_URL=postgis://geonode_data:geonode_data@db:5432/geonode_data<br />
SITEURL=<a href="http://cgticgeo.sipam.gov.br/" target="_blank">http://cgticgeo.sipam.gov.br/</a><br />
ALLOWED_HOSTS=['<a href="http://cgticgeo.sipam.gov.br" target="_blank">cgticgeo.sipam.gov.br</a>', '<a href="http://cgticgeo.sipam.gov.br" target="_blank">cgticgeo.sipam.gov.br</a>', '<a href="http://cgticgeo.sipam.gov.br:80" target="_blank">cgticgeo.sipam.gov.br:80</a>', 'geonode', 'django']<br />
GEOSERVER_PUBLIC_LOCATION=<a href="http://cgticgeo.sipam.gov.br/geoserver/" target="_blank">http://cgticgeo.sipam.gov.br/geoserver/</a><br />
root@2ff53eacb7e9:/usr/src/my_geonode# python manage.py updatelayers -w geonode -f previsao_meteorologica_aml<br />
JSONField implementation is: <class 'jsonfield.fields.JSONField'><br />
Inspecting the available layers in GeoServer ...<br />
Found 1 layers, starting processing<br />
Could not retrieve GeoFence Rules count.<br />
Could not retrieve GeoFence Rules count.<br />
... Creating Thumbnail for Layer [geonode:previsao_meteorologica_aml]<br />
Could not retrieve GeoFence Rules count.<br />
Could not retrieve GeoFence Rules count.<br />
Stopping process because --ignore-errors was not set and an error was found.<br />
Traceback (most recent call last):<br />
  File "manage.py", line 31, in <module><br />
    execute_from_command_line(sys.argv)<br />
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line<br />
    utility.execute()<br />
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute<br />
    self.fetch_command(subcommand).run_from_argv(self.argv)<br />
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv<br />
    self.execute(*args, **cmd_options)<br />
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute<br />
    output = self.handle(*args, **options)<br />
  File "/usr/src/geonode/geonode/geoserver/management/commands/updatelayers.py", line 124, in handle<br />
    execute_signals=True)<br />
  File "/usr/src/geonode/geonode/geoserver/helpers.py", line 630, in gs_slurp<br />
    layer.set_permissions(perm_spec)<br />
  File "/usr/src/geonode/geonode/security/models.py", line 205, in set_permissions<br />
    sync_geofence_with_guardian(self.layer, perms, user=geofence_user)<br />
  File "/usr/src/geonode/geonode/decorators.py", line 48, in wrapper<br />
    return func(*args, **kwargs)<br />
  File "/usr/src/geonode/geonode/security/utils.py", line 448, in sync_geofence_with_guardian<br />
    _update_geofence_rule(<a href="http://layer.name" target="_blank">layer.name</a>, layer.workspace, service, user=_user)<br />
  File "/usr/src/geonode/geonode/security/utils.py", line 592, in _update_geofence_rule<br />
    raise RuntimeError(msg)<br />
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 href="http://a.name" target="_blank">a.name</a> {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>\'\'',))</div>
<div><br /></div>
<div>Kind regards</div>
<div><br /></div>
<div>Julierme<br /></div>
</div>
<br />
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Jul 17, 2019 at 2:23 PM Ran L. <<a href="mailto:kula009@gmail.com" target="_blank">kula009@gmail.com</a>> wrote:<br /></div>
<blockquote class="gmail_quote spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;">
<div dir="ltr">
<div>Hi Julierme,</div>
<div><br /></div>
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:
<div><br /></div>
<div><font color="#FF0000">mkdir -p /usr/src/app/; \<br />
source $HOME/.override_env; \<br />
echo DATABASE_URL=$DATABASE_URL; \<br />
echo GEODATABASE_URL=$GEODATABASE_URL; \<br />
echo SITEURL=$SITEURL; \<br />
echo ALLOWED_HOSTS=$ALLOWED_HOSTS; \<br />
echo GEOSERVER_PUBLIC_LOCATION=$GEOSERVER_PUBLIC_LOCATION;</font><br />
<div><br /></div>
<div>You should be able to run the commands then.</div>
<div><br /></div>
<div>I<br />
<div><br /></div>
<div><br /></div>
</div>
</div>
</div>
<br />
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Jul 17, 2019 at 10:19 AM 1520 gis <<a href="mailto:juliermeopensourcedeveloper@gmail.com" target="_blank">juliermeopensourcedeveloper@gmail.com</a>> wrote:<br /></div>
<blockquote class="gmail_quote spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #d35400;">
<div dir="ltr">
<div>Hi Ran,</div>
<div><br /></div>
<div>Thank you very much for your reply. Yes, I just installed a brand new version of GeoNode-Project@2.8 and updatelayers did not work. See the response in [1]. I then ran<br />
<pre><code>python manage.py makemigrations
python manage.py migrate
</code></pre></div>
<div>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@2.10.</div>
<div>Any help would be appreciated.</div>
<div><br /></div>
<div>Kind regards</div>
<div><br /></div>
<div>Julierme<br /></div>
<div><br /></div>
<div>[1]</div>
<div>root@2ff53eacb7e9:/usr/src/my_geonode# python manage.py updatelayers -s metoc -f previsao_meteorologica_aml<br />
JSONField implementation is: <class 'jsonfield.fields.JSONField'><br />
Traceback (most recent call last):<br />
  File "manage.py", line 31, in <module><br />
    execute_from_command_line(sys.argv)<br />
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line<br />
    utility.execute()<br />
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute<br />
    self.fetch_command(subcommand).run_from_argv(self.argv)<br />
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv<br />
    self.execute(*args, **cmd_options)<br />
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute<br />
    output = self.handle(*args, **options)<br />
  File "/usr/src/geonode/geonode/geoserver/management/commands/updatelayers.py", line 98, in handle<br />
    owner = get_valid_user(user)<br />
  File "/usr/src/geonode/geonode/people/utils.py", line 44, in get_valid_user<br />
    theuser = get_default_user()<br />
  File "/usr/src/geonode/geonode/people/utils.py", line 31, in get_default_user<br />
    if superusers.count() > 0:<br />
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 318, in count<br />
    return self.query.get_count(using=self.db)<br />
  File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 466, in get_count<br />
    number = obj.get_aggregation(using, ['__count'])['__count']<br />
  File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 447, in get_aggregation<br />
    result = compiler.execute_sql(SINGLE)<br />
  File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql<br />
    cursor.execute(sql, params)<br />
  File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute<br />
    return super(CursorDebugWrapper, self).execute(sql, params)<br />
  File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute<br />
    return self.cursor.execute(sql, params)<br />
  File "/usr/local/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__<br />
    six.reraise(dj_exc_type, dj_exc_value, traceback)<br />
  File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute<br />
    return self.cursor.execute(sql, params)<br />
  File "/usr/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 318, in execute<br />
    return Database.Cursor.execute(self, query, params)<br />
django.db.utils.OperationalError: no such table: people_profile<br /></div>
<div><br /></div>
<div>[2]</div>
<div>root@2ff53eacb7e9:/usr/src/my_geonode# python manage.py updatelayers -f previsao_meteorologica_aml<br />
JSONField implementation is: <class 'jsonfield.fields.JSONField'><br />
Traceback (most recent call last):<br />
  File "manage.py", line 31, in <module><br />
    execute_from_command_line(sys.argv)<br />
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line<br />
    utility.execute()<br />
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute<br />
    self.fetch_command(subcommand).run_from_argv(self.argv)<br />
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv<br />
    self.execute(*args, **cmd_options)<br />
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute<br />
    output = self.handle(*args, **options)<br />
  File "/usr/src/geonode/geonode/geoserver/management/commands/updatelayers.py", line 98, in handle<br />
    owner = get_valid_user(user)<br />
  File "/usr/src/geonode/geonode/people/utils.py", line 44, in get_valid_user<br />
    theuser = get_default_user()<br />
  File "/usr/src/geonode/geonode/people/utils.py", line 35, in get_default_user<br />
    raise GeoNodeException('You must have an admin account configured '<br />
geonode.GeoNodeException: You must have an admin account configured before importing data. Try: django-admin.py createsuperuser<br /></div>
</div>
<br />
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Jul 17, 2019 at 2:06 PM Ran L. <<a href="mailto:kula009@gmail.com" target="_blank">kula009@gmail.com</a>> wrote:<br /></div>
<blockquote class="gmail_quote spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #34495e;">
<div dir="ltr">Hello Julierme,
<div><br /></div>
<div>I also had issues with the geonode "updatelayers" command yesterday, and might have found a possible solution for it:</div>
<div><br /></div>
<div>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: <a href="https://github.com/GeoNode/geonode/issues/4650" target="_blank">https://github.com/GeoNode/geonode/issues/4650</a></div>
<div><br /></div>
<div><b>A fix:</b> 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.</div>
<div><br /></div>
<div>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. </div>
<div><br /></div>
<div>Hope this provides some insights.</div>
<div><br /></div>
<div>Thanks!</div>
<div><br /></div>
<div>Ran</div>
<div><br /></div>
<div><br /></div>
<div><br /></div>
<div><br /></div>
</div>
<br />
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Jul 17, 2019 at 9:47 AM 1520 gis <<a href="mailto:juliermeopensourcedeveloper@gmail.com" target="_blank">juliermeopensourcedeveloper@gmail.com</a>> wrote:<br /></div>
<blockquote class="gmail_quote spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #2ecc71;">
<div dir="ltr">
<div>Dear users and developers,</div>
<div><br /></div>
<div>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.</div>
<div><br /></div>
<div>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.</div>
<div><br /></div>
<div>Kind regards,</div>
<div><br /></div>
<div>Julierme<br /></div>
<div><br /></div>
<div><br /></div>
</div>
_______________________________________________<br />
geonode-users mailing list<br />
<a href="mailto:geonode-users@lists.osgeo.org" target="_blank">geonode-users@lists.osgeo.org</a><br />
<a href="https://lists.osgeo.org/mailman/listinfo/geonode-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/geonode-users</a><br /></blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
_______________________________________________<br />
geonode-devel mailing list<br />
geonode-devel@lists.osgeo.org<br />
https://lists.osgeo.org/mailman/listinfo/geonode-devel<br /></blockquote>
</div>
</body>
</html>