GeoNode / geonode-project

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

After install can't access geonode url "502 bad gateway" #159

Closed evincentoieau closed 4 years ago

evincentoieau commented 4 years ago

Hi I tried for several days to install and run geonode but I Can't. I follow the doc here https://github.com/GeoNode/geonode-project using tha part "Start your server using Docker" I use python 3.8 on a centos 8 The install is ok, no error, but the http://localhost return "502 bad gateway" http://localhost/geoserver/ works, I see the home page of geoserver When I look in the container's log, I see errors on postgresql (see below), do you know what I can do to resolve that ? That must be why geonode is not running ? When I look the nginx configuration, I see geonode can be access on port 8000 via a proxypass, but I don't see any port forward for the django contauinercontainer, is that normal ? Thanks Eric Vincent

1. Here the install step (same on https://github.com/GeoNode/geonode-project). All is ok

git clone https://github.com/GeoNode/geonode-project.git -b source /usr/share/virtualenvwrapper/virtualenvwrapper.sh mkvirtualenv --python=/usr/bin/python3.8 my_geonode pip install Django==2.2.15

django-admin startproject --template=./geonode-project -e py,sh,md,rst,json,yml,ini,env,sample,properties -n monitoring-cron -n Dockerfile my_geonode

cd my_geonode docker-compose build --no-cache docker-compose up -d

2. Here the list of container

docker container ls -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e48c44570f26 geonode/nginx:geoserver "/docker-entrypoint.…" 5 hours ago Up 50 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp nginx4my_geonode 9f6adc3e5a13 geonode/geoserver:2.17.2 "/usr/local/tomcat/t…" 5 hours ago Up 5 hours 8080/tcp geoserver4my_geonode 5f216240cca7 my_geonode_django "/bin/sh -c 'service…" 5 hours ago Up Less than a second django4my_geonode 269d4db6588c my_geonode_celery "/bin/sh -c 'service…" 5 hours ago Up 2 seconds celery4my_geonode 0f1c91be4af8 geonode/geoserver_data:2.17.2 "/bin/true" 5 hours ago Exited (0) 5 hours ago gsconf4my_geonode d62726850db7 geonode/postgis:11 "docker-entrypoint.s…" 5 hours ago Up 5 hours 5432/tcp db4my_geonode dc59593383e7 jenkins/jenkins:lts "/sbin/tini -- /usr/…" 5 hours ago Up 5 hours 0.0.0.0:9080->9080/tcp, 0.0.0.0:9443->9443/tcp, 8080/tcp, 0.0.0.0:50000->50000/tcp jenkins4my_geonode ed85945d403e rabbitmq "docker-entrypoint.s…" 5 hours ago Up 5 hours 4369/tcp, 5671-5672/tcp, 15691-15692/tcp, 25672/tcp rabbitmq4my_geonode 9eb89105b472 geonode/letsencrypt:latest "./docker-entrypoint…" 5 hours ago Up 21 seconds my_geonode_letsencrypt_1_a9bd10cbc697

3. error log with docker-compose log -f

django4my_geonode exited with code 1 django4my_geonode | Starting periodic command scheduler: cron. django4my_geonode | DATABASE_URL=postgis://my_geonode:geonode@db:5432/my_geonode django4my_geonode | GEODATABASE_URL=postgis://my_geonode_data:geonode@db:5432/my_geonode_data django4my_geonode | SITEURL=http://localhost/ django4my_geonode | ALLOWED_HOSTS=['django', 'localhost', 'localhost:None', 'geonode', 'django'] django4my_geonode | GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ django4my_geonode | MONITORING_ENABLED=True django4my_geonode | MONITORING_HOST_NAME=geonode django4my_geonode | MONITORING_SERVICE_NAME=local-geonode django4my_geonode | MONITORING_DATA_TTL=365 django4my_geonode | waitfordbs task done django4my_geonode | running migrations db4my_geonode | 2020-10-26 16:39:31.676 UTC [4365] ERROR: relation "base_region" does not exist at character 341 db4my_geonode | 2020-10-26 16:39:31.676 UTC [4365] STATEMENT: SELECT "base_region"."id", "base_region"."code", "base_region"."name", "base_region"."name_en", "base_region"."parent_id", "base_region"."bbox_x0", "base_region"."bbox_x1", "base_region"."bbox_y0", "base_region"."bbox_y1", "base_region"."srid", "base_region"."lft", "base_region"."rght", "base_region"."tree_id", "base_region"."level" FROM "base_region" WHERE ("base_region"."level" = 0 OR "base_region"."parent_id" IS NULL) ORDER BY "base_region"."tree_id" ASC, "base_region"."lft" ASC db4my_geonode | 2020-10-26 16:39:35.479 UTC [4366] ERROR: relation "base_region" does not exist at character 341 db4my_geonode | 2020-10-26 16:39:35.479 UTC [4366] STATEMENT: SELECT "base_region"."id", "base_region"."code", "base_region"."name", "base_region"."name_en", "base_region"."parent_id", "base_region"."bbox_x0", "base_region"."bbox_x1", "base_region"."bbox_y0", "base_region"."bbox_y1", "base_region"."srid", "base_region"."lft", "base_region"."rght", "base_region"."tree_id", "base_region"."level" FROM "base_region" WHERE ("base_region"."level" = 0 OR "base_region"."parent_id" IS NULL) ORDER BY "base_region"."tree_id" ASC, "base_region"."lft" ASC db4my_geonode | 2020-10-26 16:39:36.417 UTC [4367] ERROR: relation "base_region" does not exist at character 341 db4my_geonode | 2020-10-26 16:39:36.417 UTC [4367] STATEMENT: SELECT "base_region"."id", "base_region"."code", "base_region"."name", "base_region"."name_en", "base_region"."parent_id", "base_region"."bbox_x0", "base_region"."bbox_x1", "base_region"."bbox_y0", "base_region"."bbox_y1", "base_region"."srid", "base_region"."lft", "base_region"."rght", "base_region"."tree_id", "base_region"."level" FROM "base_region" WHERE ("base_region"."level" = 0 OR "base_region"."parent_id" IS NULL) ORDER BY "base_region"."tree_id" ASC, "base_region"."lft" ASC db4my_geonode | 2020-10-26 16:39:36.442 UTC [4366] ERROR: permission denied to create extension "postgis" db4my_geonode | 2020-10-26 16:39:36.442 UTC [4366] HINT: Must be superuser to create this extension. db4my_geonode | 2020-10-26 16:39:36.442 UTC [4366] STATEMENT: CREATE EXTENSION IF NOT EXISTS postgis celery4my_geonode exited with code 1 celery4my_geonode | Restarting periodic command scheduler: cronStopping periodic command scheduler: cron. celery4my_geonode | Starting periodic command scheduler: cron. celery4my_geonode | DATABASE_URL=postgis://my_geonode:geonode@db:5432/my_geonode celery4my_geonode | GEODATABASE_URL=postgis://my_geonode_data:geonode@db:5432/my_geonode_data celery4my_geonode | SITEURL=http://localhost/ celery4my_geonode | ALLOWED_HOSTS=['django', 'localhost', 'localhost:None', 'geonode', 'django'] celery4my_geonode | GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ celery4my_geonode | MONITORING_ENABLED=True celery4my_geonode | MONITORING_HOST_NAME=geonode celery4my_geonode | MONITORING_SERVICE_NAME=local-geonode celery4my_geonode | MONITORING_DATA_TTL=365 celery4my_geonode | waitfordbs task done celery4my_geonode | running migrations ....

t-book commented 4 years ago

Currently there is a known problem with master branch making migrations fail. Until this is fixed please try 3.0 (latest stable) branch.

t-book commented 4 years ago

ping @gannebamm see this is the strange thing a fresh start should use the correct conn string :japanese_ogre:

afabiani commented 4 years ago

@evincentoieau please follow the docs here You can find there more detailed explanation and some troubleshooting

@t-book whenever you have issues with migrations, use the branch 3.x which does not include the spatialdata PR yet

t-book commented 4 years ago

@afabiani I know and can confirm with 3.x. But I'm trying to help solving the issue with master (had a chat at gitter with @gannebamm ) ;)

evincentoieau commented 4 years ago

Thanks

Currently there is a known problem with master branch making migrations fail. Until this is fixed please try 3.0 (latest stable) branch.

Thanks I will retry with git clone https://github.com/GeoNode/geonode-project.git -b 3.0

evincentoieau commented 4 years ago

@evincentoieau please follow the docs here You can find there more detailed explanation and some troubleshooting

@t-book whenever you have issues with migrations, use the branch 3.x which does not include the spatialdata PR yet

Ok I retry with git clone https://github.com/GeoNode/geonode-project.git -b 3.0 and the doc on https://github.com/GeoNode/geonode-project --> still not work

I use the doc on your link https://docs.geonode.org/en/3.x/install/basic/index.html and the branche 3.x and it works. On my centos 8 some lib are not found in the "Packages Installation" part I use: yum -y install epel-release ok yum install -y gdal ok yum install -y python3-pip python3-dev python3-virtualenv python3-venv virtualenvwrapper No match for argument: python3-dev No match for argument: python3-venv No match for argument: virtualenvwrapper pip3 install -U pip ok pip3 install -U virtualenv ok yum install -y libxml2 libxml2-dev gettext No match for argument: libxml2-dev replace by yum install -y libxml2-devel.x86_64 yum install -y libxslt1-dev libjpeg-dev libpng-dev libpq-dev libgdal-dev No match for argument: libxslt1-dev replace by yum install -y libxslt-devel.x86_64 No match for argument: libjpeg-dev ..not found No match for argument: libpng-dev replace by yum install -y libpng-devel.x86_64 No match for argument: libpq-dev replace by yum install -y libpq-devel.x86_64 --> ilmpossible d'installer yum install -y libpq5-devel.x86_64 No match for argument: libgdal-dev replace by yum install -y gdal-devel.x86_64 yum install -y gdal30-devel.x86_64 yum install -y gdal31-devel.x86_64 yum install -y git unzip gcc zlib1g-dev libgeos-dev libproj-dev No match for argument: zlib1g-dev replace by yum install -y zlib-devel.x86_64 No match for argument: libgeos-dev replace by yum install -y geos-devel.x86_64 yum install -y geos37-devel.x86_64 yum install -y geos38-devel.x86_64 No match for argument: libproj-dev replace by yum install -y proj-devel.x86_64 yum install -y proj62-devel.x86_64 yum install -y proj63-devel.x86_64 yum install -y proj70-devel.x86_64 yum install -y proj71-devel.x86_64

  # If the following does not work, you can skip it
  yum install -y libgdal20
    No match for argument: libgdal20
      replace by
        yum install -y gdal30.x86_64
        yum install -y gdal31.x86_64

After the ./docker-build.sh comamnd ends, I wait some minutes and I can load the geonode page

Remark : on the footer, the link "Ajouter un utilisateur" (add a new user) must be hardcoded with localhost, because I use http://geonode and this lionk is still localhost

Thanks