GeoNode / geonode

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

Multiple errors #12315

Open vprintempsPei opened 3 months ago

vprintempsPei commented 3 months ago

If I try to deploy the Docker container, I encounter the following error:

114.6 Obtaining file:///usr/src/%7B%7Bproject_name%7D%7D
114.6   Preparing metadata (setup.py): started
114.7   Preparing metadata (setup.py): finished with status 'error'
114.7   error: subprocess-exited-with-error
114.7
114.7   × python setup.py egg_info did not run successfully.
114.7   │ exit code: 1
114.7   ╰─> [1 lines of output]
114.7       error: Invalid distribution name or version syntax: -project_name--4.0.0
114.7       [end of output]
114.7
114.7   note: This error originates from a subprocess, and is likely not a problem with pip.
114.7 error: metadata-generation-failed
114.7
114.7 × Encountered error while generating package metadata.
114.7 ╰─> See above for output.
114.7
114.7 note: This is an issue with the package mentioned above, not pip.
114.7 hint: See above for details.

When I fix the error in setup.py by setting a proper project name, I receive the error: "dependency failed to start: container django4myproject is unhealthy."

How can i fix this error ? I'd like to run the docker to see how geonode database is made

In the end i tried the public demo, but i didn't received any validation mail after signup. Is the project still working / maintened ?

t-book commented 3 months ago

Hi,

which branch are you at when starting/building the container? And is this the demo you tested with https://stable.demo.geonode.org/#/ The project is more than active and a new stable has been released lately ;)

vprintempsPei commented 3 months ago

Hi,

I'm using master branch. I've done following commands on windows :

git clone https://github.com/GeoNode/geonode-project.git cd geonode-project

python3 create-envfile.py

edition of {{project_name}} in the .env because docker doesn't accept {{project_name}} edition of setup.py in /src to change {{project_name}} according to .env file.

docker compose build ==> "dependency failed to start: container django4myproject is unhealthy."

I tried to connect myself on the stable demo

my .env file is the following :

COMPOSE_PROJECT_NAME=myproject
# See https://github.com/containers/podman/issues/13889
# DOCKER_BUILDKIT=0
DOCKER_ENV=production
# See https://github.com/geosolutions-it/geonode-generic/issues/28
# to see why we force API version to 1.24
DOCKER_API_VERSION="1.24"
BACKUPS_VOLUME_DRIVER=local

GEONODE_BASE_IMAGE_VERSION=master
NGINX_BASE_IMAGE_VERSION=1.25.3-latest
LETSENCRYPT_BASE_IMAGE_VERSION=2.6.0-latest
GEOSERVER_BASE_IMAGE_VERSION=2.24.3-latest
GEOSERVER_DATA_BASE_IMAGE_VERSION=2.24.3-latest
POSTGRES_BASE_IMAGE_VERSION=15.3-latest

C_FORCE_ROOT=1
FORCE_REINIT=false
INVOKE_LOG_STDOUT=true

# LANGUAGE_CODE=it-it
# LANGUAGES=(('en-us','English'),('it-it','Italiano'))

DJANGO_SETTINGS_MODULE=myproject.settings
GEONODE_INSTANCE_NAME=geonode

# #################
# backend
# #################
POSTGRES_USER=postgres
POSTGRES_PASSWORD=6cxE6t6QIxYNfOB
GEONODE_DATABASE=myproject
GEONODE_DATABASE_USER=myproject
GEONODE_DATABASE_PASSWORD=TpumqcbpU4qvuS6
GEONODE_GEODATABASE=myproject_data
GEONODE_GEODATABASE_USER=myproject_data
GEONODE_GEODATABASE_PASSWORD=6mCNmY2cQTMgg9G
GEONODE_DATABASE_SCHEMA=public
GEONODE_GEODATABASE_SCHEMA=public
DATABASE_HOST=db
DATABASE_PORT=5432
DATABASE_URL=postgis://myproject:TpumqcbpU4qvuS6@db:5432/myproject
GEODATABASE_URL=postgis://myproject_data:6mCNmY2cQTMgg9G@db:5432/myproject_data
GEONODE_DB_CONN_MAX_AGE=0
GEONODE_DB_CONN_TOUT=5
DEFAULT_BACKEND_DATASTORE=datastore
BROKER_URL=amqp://guest:guest@rabbitmq:5672/
CELERY_BEAT_SCHEDULER=celery.beat:PersistentScheduler
ASYNC_SIGNALS=True

SITEURL=http://localhost/

ALLOWED_HOSTS="['django', 'localhost']"

# Data Uploader
DEFAULT_BACKEND_UPLOADER=geonode.importer
TIME_ENABLED=True
MOSAIC_ENABLED=False
HAYSTACK_SEARCH=False
HAYSTACK_ENGINE_URL=http://elasticsearch:9200/
HAYSTACK_ENGINE_INDEX_NAME=haystack
HAYSTACK_SEARCH_RESULTS_PER_PAGE=200

# #################
# nginx
# HTTPD Server
# #################
GEONODE_LB_HOST_IP=django
GEONODE_LB_PORT=8000
NGINX_BASE_URL=http://localhost

# IP or domain name and port where the server can be reached on HTTPS (leave HOST empty if you want to use HTTP only)
# port where the server can be reached on HTTPS
HTTP_HOST=localhost
HTTPS_HOST=

HTTP_PORT=80
HTTPS_PORT=443

# Let's Encrypt certificates for https encryption. You must have a domain name as HTTPS_HOST (doesn't work
# with an ip) and it must be reachable from the outside. This can be one of the following :
# disabled : we do not get a certificate at all (a placeholder certificate will be used)
# staging : we get staging certificates (are invalid, but allow to test the process completely and have much higher limit rates)
# production : we get a normal certificate (default)
LETSENCRYPT_MODE=disabled
# LETSENCRYPT_MODE=staging
# LETSENCRYPT_MODE=production

RESOLVER=127.0.0.11

# #################
# geoserver
# #################
GEOSERVER_LB_HOST_IP=geoserver
GEOSERVER_LB_PORT=8080
GEOSERVER_WEB_UI_LOCATION=http://localhost/geoserver/
GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/
GEOSERVER_LOCATION=http://${GEOSERVER_LB_HOST_IP}:${GEOSERVER_LB_PORT}/geoserver/
GEOSERVER_ADMIN_USER=admin
GEOSERVER_ADMIN_PASSWORD=LYgwO5Qslf2G7qT

OGC_REQUEST_TIMEOUT=30
OGC_REQUEST_MAX_RETRIES=1
OGC_REQUEST_BACKOFF_FACTOR=0.3
OGC_REQUEST_POOL_MAXSIZE=10
OGC_REQUEST_POOL_CONNECTIONS=10

# Java Options & Memory
ENABLE_JSONP=true
outFormat=text/javascript
GEOSERVER_JAVA_OPTS=-Djava.awt.headless=true -Xms4G -Xmx4G -Dgwc.context.suffix=gwc -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/jvm.log -XX:PerfDataSamplingInterval=500 -XX:SoftRefLRUPolicyMSPerMB=36000 -XX:-UseGCOverheadLimit -XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=false -DGS-SHAPEFILE-CHARSET=UTF-8 -DGEOSERVER_CSRF_DISABLED=true -DPRINT_BASE_URL=http://localhost/geoserver/pdf -DALLOW_ENV_PARAMETRIZATION=true -Xbootclasspath/a:/usr/local/tomcat/webapps/geoserver/WEB-INF/lib/marlin-0.9.3-Unsafe.jar -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine

# #################
# Security
# #################
# Admin Settings
#
# ADMIN_PASSWORD is used to overwrite the GeoNode admin password **ONLY** the first time
# GeoNode is run. If you need to overwrite it again, you need to set the env var FORCE_REINIT,
# otherwise the invoke updateadmin task will be skipped and the current password already stored
# in DB will honored.

ADMIN_USERNAME=admin
ADMIN_PASSWORD=oOxO3v2WqPbCnd2
ADMIN_EMAIL=None

# EMAIL Notifications
EMAIL_ENABLE=False
DJANGO_EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
DJANGO_EMAIL_HOST=localhost
DJANGO_EMAIL_PORT=25
DJANGO_EMAIL_HOST_USER=
DJANGO_EMAIL_HOST_PASSWORD=
DJANGO_EMAIL_USE_TLS=False
DJANGO_EMAIL_USE_SSL=False
DEFAULT_FROM_EMAIL='None' # eg Company <no-reply@company.org>

# Session/Access Control
LOCKDOWN_GEONODE=False
X_FRAME_OPTIONS="SAMEORIGIN"
SESSION_EXPIRED_CONTROL_ENABLED=True
DEFAULT_ANONYMOUS_VIEW_PERMISSION=True
DEFAULT_ANONYMOUS_DOWNLOAD_PERMISSION=True

CORS_ALLOW_ALL_ORIGINS=True
GEOSERVER_CORS_ENABLED=True
GEOSERVER_CORS_ALLOWED_ORIGINS=*
GEOSERVER_CORS_ALLOWED_METHODS=GET,POST,PUT,DELETE,HEAD,OPTIONS
GEOSERVER_CORS_ALLOWED_HEADERS=*

# Users Registration
ACCOUNT_OPEN_SIGNUP=True
ACCOUNT_EMAIL_REQUIRED=True
ACCOUNT_APPROVAL_REQUIRED=False
ACCOUNT_CONFIRM_EMAIL_ON_GET=False
ACCOUNT_EMAIL_VERIFICATION=none
ACCOUNT_EMAIL_CONFIRMATION_EMAIL=False
ACCOUNT_EMAIL_CONFIRMATION_REQUIRED=False
ACCOUNT_AUTHENTICATION_METHOD=username_email
AUTO_ASSIGN_REGISTERED_MEMBERS_TO_REGISTERED_MEMBERS_GROUP_NAME=True

# OAuth2
OAUTH2_API_KEY=
OAUTH2_CLIENT_ID=QIx2SzvbBsF9UYf
OAUTH2_CLIENT_SECRET=OWpJlmbSXJUT19c

# GeoNode APIs
API_LOCKDOWN=False
TASTYPIE_APIKEY=

# #################
# Production and
# Monitoring
# #################
DEBUG=False

SECRET_KEY='+(M;p^*\EI{a2+{9#kI<oLZTSw(*NOq%@|S-3<x@W;3@+J9@ih'

STATIC_ROOT=/mnt/volumes/statics/static/
MEDIA_ROOT=/mnt/volumes/statics/uploaded/
GEOIP_PATH=/mnt/volumes/statics/geoip.db

CACHE_BUSTING_STATIC_ENABLED=False

MEMCACHED_ENABLED=False
MEMCACHED_BACKEND=django.core.cache.backends.memcached.MemcachedCache
MEMCACHED_LOCATION=memcached:11211
MEMCACHED_LOCK_EXPIRE=3600
MEMCACHED_LOCK_TIMEOUT=10
#
# Options for memcached binary, e.g. -vvv to log all requests and cache hits
#
MEMCACHED_OPTIONS=

MAX_DOCUMENT_SIZE=200
CLIENT_RESULTS_LIMIT=5
API_LIMIT_PER_PAGE=1000

# GIS Client
GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY=mapstore
MAPBOX_ACCESS_TOKEN=
BING_API_KEY=
GOOGLE_API_KEY=

# Monitoring
MONITORING_ENABLED=False
MONITORING_DATA_TTL=365
USER_ANALYTICS_ENABLED=True
USER_ANALYTICS_GZIP=True
CENTRALIZED_DASHBOARD_ENABLED=False
MONITORING_SERVICE_NAME=local-geonode
MONITORING_HOST_NAME=geonode

# Other Options/Contribs
MODIFY_TOPICCATEGORY=True
AVATAR_GRAVATAR_SSL=True
EXIF_ENABLED=True
CREATE_LAYER=True
FAVORITE_ENABLED=True

# Advanced Workflow
RESOURCE_PUBLISHING=False
ADMIN_MODERATE_UPLOADS=False

# LDAP
LDAP_ENABLED=False
LDAP_SERVER_URL=ldap://<the_ldap_server>
LDAP_BIND_DN=uid=ldapinfo,cn=users,dc=ad,dc=example,dc=org
LDAP_BIND_PASSWORD=<something_secret>
LDAP_USER_SEARCH_DN=dc=ad,dc=example,dc=org
LDAP_USER_SEARCH_FILTERSTR=(&(uid=%(user)s)(objectClass=person))
LDAP_GROUP_SEARCH_DN=cn=groups,dc=ad,dc=example,dc=org
LDAP_GROUP_SEARCH_FILTERSTR=(|(cn=abt1)(cn=abt2)(cn=abt3)(cn=abt4)(cn=abt5)(cn=abt6))
LDAP_GROUP_PROFILE_MEMBER_ATTR=uniqueMember

# CELERY

# expressed in KB
# CELERY__MAX_MEMORY_PER_CHILD="200000"
# ##
# Note right autoscale value must coincide with worker concurrency value
# CELERY__AUTOSCALE_VALUES="15,10"
# CELERY__WORKER_CONCURRENCY="10"
# ##
# CELERY__OPTS="--without-gossip --without-mingle -Ofair -B -E"
# CELERY__BEAT_SCHEDULE="/mnt/volumes/statics/celerybeat-schedule"
# CELERY__LOG_LEVEL="INFO"
# CELERY__LOG_FILE="/var/log/celery.log"
# CELERY__WORKER_NAME="worker1@%h"

# PostgreSQL
POSTGRESQL_MAX_CONNECTIONS=200

# Common containers restart policy
RESTART_POLICY_CONDITION="on-failure"
RESTART_POLICY_DELAY="5s"
RESTART_POLICY_MAX_ATTEMPTS="3"
RESTART_POLICY_WINDOW=120s

DEFAULT_MAX_UPLOAD_SIZE=5368709120
DEFAULT_MAX_PARALLEL_UPLOADS_PER_USER=5
mattiagiupponi commented 3 months ago

Hi @vprintempsPei As described in the readme, the geonode project is a template and is required to create ur custom geonode project.

If you check the readme and the Docker start, the following action are required to run the project:

  python3.10 -m venv ~/.venvs/project_name
  source ~/.venvs/{{ project_name }}/bin/activate

  pip install Django==4.2.9

  mkdir ~/project_name

  GN_VERSION=master # Define the branch or tag you want to generate the project from
  django-admin startproject --template=https://github.com/GeoNode/geonode-project/archive/refs/heads/$GN_VERSION.zip -e py,sh,md,rst,json,yml,ini,env,sample,properties -n monitoring-cron -n Dockerfile project_name ~/project_name

  cd ~/project_name
  python create-envfile.py 

create-envfile.py accepts the following arguments:

--https: Enable SSL. It's disabled by default --env_type: When set to prod DEBUG is disabled and the creation of a valid SSL is requested to Letsencrypt's ACME server When set to test DEBUG is disabled and a test SSL certificate is generated for local testing When set to dev DEBUG is enabled and no SSL certificate is generated --hostname: The URL that whill serve GeoNode (localhost by default) --email: The administrator's email. Notice that a real email and a valid SMPT configurations are required if --env_type is seto to prod. Letsencrypt uses to email for issuing the SSL certificate --geonodepwd: GeoNode's administrator password. A random value is set if left empty --geoserverpwd: GeoNode's administrator password. A random value is set if left empty --pgpwd: PostgreSQL's administrator password. A random value is set if left empty --dbpwd: GeoNode DB user role's password. A random value is set if left empty --geodbpwd: GeoNode data DB user role's password. A random value is set if left empty --clientid: Client id of Geoserver's GeoNode Oauth2 client. A random value is set if left empty --clientsecret: Client secret of Geoserver's GeoNode Oauth2 client. A random value is set if left empty

  docker compose build
  docker compose up -d

I suggest you revert the changes you have done and follow the readme for create the project successfully