ADB-SPADE / geonode-spade

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

404 errors in loading chunk.js files #1

Closed ally-ssa closed 1 year ago

ally-ssa commented 1 year ago

Expected Behavior

After starting the Django server following the steps of starting GeoNode locally in development mode, when I open http://localhost:8001/ I should be able to see a blank GeoNode page with a "Welcome to GeoNode" message, as in image

Actual Behavior

http://localhost:8001/ shows a blank container under the navbar (see example below): image

in addition, I see the following in DevTools: image

When I go to another page, for example Maps, the page is stuck on loading screen: image

And I also see 404 errors in DevTools: image

Steps to Reproduce the Problem

  1. I installed Docker and docker-compose using GeoNode documentation as reference
  2. I cloned the geonode-spade repo then checked out the spade-for-isms branch
  3. I loaded the submodules; I was also having problems loading the safeguard-screening-map submodule, though I was able to load it using
    git submodule update --force --recursive --init --remote
  4. I ran the following commands, following Start locally in development mode of README_EGIS.md
    
    docker-compose --env-file .env_dev_egis -f docker-compose.yml -f ./docker-compose.egis-local.dev.yml build

Docker UP

docker-compose --env-file .env_dev_egis -f docker-compose.yml -f ./docker-compose.egis-local.dev.yml up -d

Enter django container shell

docker exec -it django4geonode /bin/bash

Start Django server in development mode

python manage.py runserver 0.0.0.0:8001


  5. I opened http://localhost:8001/ in my browser (tested in Edge and Chrome)

## Specifications
I am on Windows 10, but I run `Docker` and `docker-compose` in WSL 2 with the Ubuntu 22.04 LTS distro. Here are other details about my system:
- Docker Engine version: 23.0.5
- Docker Compose version: 2.17.3
ewsterrenburg commented 1 year ago

@ally-ssa Please let me know if the following works for you:

Prerequisites:

When cloning the private modules, this token functions as the password.

Fetching the source code

Creating a devcontainer

Now VS Code should give the option to "Reopen in Container". Now a docker-compose project will be set up, based on the contents of the .devcontainer folder.

image

Running the application

In the django4geonode container (VS Code terminal should open here automatically), run python manage.py runserver 0.0.0.0:8000

Now the whole application should be available on http://localhost with the integration between Django & GeoServer intact. The Django application should also be available on http://localhost:8000.

Taming the memory

ally-ssa commented 1 year ago

Hi @ewsterrenburg, thanks for the comment. I was able to clone the source code including the submodules without problems this time, but I encounter this error when reopening geonode-spade in a dev container: image There seems to be a permission error, even though the directory where geonode-spade is located has permission 775

ewsterrenburg commented 1 year ago

@ally-ssa https://stackoverflow.com/questions/38882654/docker-entrypoint-running-bash-script-gets-permission-denied, https://stackoverflow.com/questions/72883508/unable-to-start-container-process-permission-denied-unknown, would it help to make the entrypoint shellscript executable?

ally-ssa commented 1 year ago

Thanks, got the permission issue resolved by running

sudo chmod 775 entrypoint.sh

Unfortunately the 404 issue is still there ☹ image

ally-ssa commented 1 year ago

Discovered that the app was encountering issues when run in WSL on port 8000, and using one of these workarounds helped:

  1. In the dev container terminal, I ran the app using
python manage.py runserver 0.0.0.0:9000

which allowed me to access the app using http://localhost:9000. Note from @ewsterrenburg that dev container .env and nginx Dockerfile may have to be updated to change the references to port 8000 to 9000

  1. In the dev container terminal, I ran the app using
python manage.py runserver 0.0.0.0:8000

but I access the app in browser using http://<WSL_IP_ADDRESS>:8000 instead of http://localhost:8000. The WSL IP address can be determined using ip addr show eth0 or hostname -I