GeoNode / geonode-project

A django template project for creating custom GeoNode projects.
http://geonode.org
77 stars 171 forks source link

GeoNode UpdateLayers #84

Open indeOWS opened 5 years ago

indeOWS commented 5 years ago

I am running GeoNode-Project Master installed via Docker and I am facing an issue while updating GeoNode layers (python manage.py updatelayers -w geonode -f cbge_trecho_arruamento) the response is in [1]:

Looking at GeoNode tree, I found updalayers.py file, but I could not find it under GeoNode-Project Master tree https://github.com/GeoNode/geonode/blob/master/geonode/geoserver/management/commands/updatelayers.py

[1] Response for python manage.py updatelayers -w geonode -f cbge_trecho_arruamento

File "manage.py", line 31, in 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/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 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

t-book commented 5 years ago

@juliermegeotube have you tried to run the migrations first?

$ python manage.py makemigrations
$ python manage.py migrate

https://docs.djangoproject.com/en/2.2/topics/migrations/

indeOWS commented 5 years ago

Thank you for reply @t-book. After running python manage.py migrate, I was asked by the system to create a superuser account (createsuperuser). I did so. After creating the superuser account, i am facing the following issue: nspecting 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: /usr/local/lib/python2.7/site-packages/geoserver/style.py:89: 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:93: 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 previsao_meteorologica_acre (1/1)

Finished processing 1 layers in 6.0 seconds.

0 Created layers 1 Updated layers 0 Failed layers 6.000000 seconds per layer

indeOWS commented 5 years ago

@t-book, I forgot to mention that I am running GeoNode-Project on a CentOS7 machine. This could be an issue. I picked all the geonode required packages from an old tutorial, mainly those related to geonode required packages on Ubuntu. sudo yum groupinstall 'Development Tools' sudo yum install -y man vim openssh-clients zip unzip wget sudo yum install -y gdal-python gdal gdal-devel sudo yum install -y python-pip python-devel python-virtualenv python-setuptools python python-tools python-pillow python-lxml python-imaging python-psycopg2 sudo yum install -y libxml2 libxml2-devel libxml2-python libxslt libxslt-devel libxslt-python libjpeg libpng postgresql-libs postgresql-devel zlib zlib-devel geos geos-python geos-devel proj* proj-devel pip install --user virtualenv pip install --user virtualenvwrapper

I am not sure if I got all geonode-project required packages on CentOS7. I am willing to create a tutorial for geonode-project installation on CentOS7 via Docker. I can share what I got so far.

indeOWS commented 5 years ago

@t-book I am installing geonode-project (Docker) on an Unbuntu machine according to the tutorial in here http://docs.geonode.org/en/master/install/project/index.html#packages-installation. If the updatelayers issue does not show up, I will conclude that the problem is related to centOS7.

t-book commented 4 years ago

hi @juliermegeotube This issue got a bit out of my sight. Sorry! Do you still have problems? Otherwise, we could close. Cheers to Brazil ;) Toni