GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.41k stars 1.11k forks source link

Error on updatelayers command default to sqlite3 with error #12327

Open imperialbeachca opened 3 weeks ago

imperialbeachca commented 3 weeks ago

Expected Behavior

running python manage.py updatelayers -w geonode on the django4geonode container shell should return log like described on point number 9, Geonode documentation, administering, geonode management commands, loading data into geonode, management command (here) Actual Behavior

DJANGO_SETTINGS_MODULE=geonode.settings python3 manage.py updatelayers -w ibgis returns the following error: Traceback (most recent call last): File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute return Database.Cursor.execute(self, query, params) sqlite3.OperationalError: no such table: people_profile

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/geonode/manage.py", line 29, in execute_from_command_line(sys.argv) File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/core/management/init.py", line 419, in execute_from_command_line utility.execute() File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/core/management/init.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, *cmd_options) File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/core/management/base.py", line 398, in execute output = self.handle(args, **options) File "/opt/geonode/geonode/geoserver/management/commands/updatelayers.py", line 95, in handle owner = get_valid_user(user) File "/opt/geonode/geonode/people/utils.py", line 46, in get_valid_user theuser = get_default_user() File "/opt/geonode/geonode/people/utils.py", line 32, in get_default_user if superusers.exists(): File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/models/query.py", line 808, in exists return self.query.has_results(using=self.db) File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/models/sql/query.py", line 561, in has_results return compiler.has_results() File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1145, in has_results return bool(self.execute_sql(SINGLE)) File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql cursor.execute(sql, params) File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/backends/utils.py", line 98, in execute return super().execute(sql, params) File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/backends/utils.py", line 66, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers return executor(sql, params, many, context) File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/backends/utils.py", line 79, in _execute with self.db.wrap_database_errors: File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/utils.py", line 90, in exit raise dj_exc_value.with_traceback(traceback) from exc_value File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/home/ubuntu/.virtualenvs/geonode/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute return Database.Cursor.execute(self, query, params) django.db.utils.OperationalError: no such table: people_profile

Steps to Reproduce the Problem

Setup Geonode Vanilla
Go to geoserver and import a layer directly from postgis (in my case, a remote postgis server), then publish on ibgis workspace
Access to geonode shell
Run DJANGO_SETTINGS_MODULE=geonode.settings python3 manage.py updatelayers -w ibgis

Specifications

GeoNode version: 4.2.3
Installation method Geonode Vanilla:
Platform: Ubuntu 22.04
Additional details: Server in AWS.  Env variables updated to work on custom domain using https
mattiagiupponi commented 1 week ago

Is the environment file exported in the env? What does env | grep DATABASE_URL return?