Closed ebroda closed 3 months ago
Thank you for sharing your progress with us and documenting this issue. I have also seen this before in one of the currently open PullRequests. It seems quite strange to me. I won't look at it again today, but sure will tomorrow.
My first guess would be that it's either a hickup or a bug in the django restframework package.
The only difference I've found so far is that the installation of the dependency is unexpected.
See the failing install action here:
And compare it with one of the currently functioning ones. (last triggered 3 days ago)
Then I stumbled across this: https://github.com/encode/django-rest-framework/issues/9300
I think the comments are on the wrong issue, each.
From this comment (https://github.com/OpenEnergyPlatform/oeplatform/issues/1623#issuecomment-2004966583):
Currently you can only use the docker image for tag v0.18.0.
That image fails with the same error, also 0.17.2. Seems like the issue, missing step 4, is there already some time.
$ sudo docker-compose up
Pulling oeplatform (ghcr.io/openenergyplatform/oeplatform:0.17.2)...
0.17.2: Pulling from openenergyplatform/oeplatform
0bc3020d05f1: Already exists
...
2e80eb32d142: Pull complete
...
3619674a0500: Pull complete
Digest: sha256:7964b83a9373a3c48af5af4e32d0d1212168685ce4a9b437c32722fb31e2741a
Status: Downloaded newer image for ghcr.io/openenergyplatform/oeplatform:0.17.2
Starting docker-oep_postgres_1 ... done
Recreating docker-oep_oeplatform_1 ... done
Attaching to docker-oep_postgres_1, docker-oep_oeplatform_1
postgres_1 |
postgres_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
...
oeplatform_1 | Checking for Configuration
oeplatform_1 | File /app/oeplatform/securitysettings.py does not exist, copying default configuration.
oeplatform_1 | Migrating Databases...
oeplatform_1 | Migrating Django database...
oeplatform_1 | Traceback (most recent call last):
...
oeplatform_1 | File "/app/factsheet/urls.py", line 2, in <module>
oeplatform_1 | from factsheet import views
oeplatform_1 | File "/app/factsheet/views.py", line 41, in <module>
oeplatform_1 | Path(ONTOLOGY_ROOT, "oeo")
oeplatform_1 | FileNotFoundError: [Errno 2] No such file or directory: '/app/ontologies/oeo'
docker-oep_oeplatform_1 exited with code 1
Oh, that's true. Was a bit late that day :)
Well, due to a docker setting that was overlooked for a long time. This problem goes back to the version where we introduced the ontologies folder years ago ... . Also, I stopped using Docker for a few months now. Thanks again for pointing it out.
In v0.18 i just added the check - so at least devs are guided on the documentation if the folder is missing.
I added a oneliner to Dockerfile which automatizes getting and extracting the latest oeo and put in in #1631 https://github.com/OpenEnergyPlatform/oeplatform/pull/1631/commits/6e6e106bcbd96c533f006763711e374a369df36b
Also did small additions to the docker README.
Description of the issue
I wanted to start the oeplatform from Docker as described in /docker/USAGE.md. Therefore I downloaded the docker-compose.yml file and put in inside a directory. Afterwards I was trying to set up the service by using
(sudo) docker-compose up
. Docker downloaded the two images and all necessary stuff around, but the initialization ofoeplatform_1
fails withFileNotFoundError: [Errno 2] No such file or directory: '/app/ontologies/oeo'
.Looks like image is missing these files which are necessary to execute the oeplatform. I didn't changed anything on the repo and didn't build the images myself. I'm just taking the ones latest provided from GitHub.
Docker Log
Alternative way
I also build the image on my own. Therefore I cloned the repository and then needed to find out how to build the image. Probably it would be a good idea, to add a short section to /docker/USAGE.md as it's not the usualy simple docker build ., but needs the -f flag. I used
sudo docker build -t oeplatform -f docker/Dockerfile .
On first try this also showed a similar error:
Interesting is, that in this case, explicitely a reference to the docs saying oeo missing is given.
I'm not sure, why the docker-build in the CI/GitHub Actions succeeded, when it fails on my side. As I added the files accordingly, the build succeded, but the image still not worked, but with a different error message (see issue #1623).
Steps to Reproduce
Ensure you use the docker images provided from GitHub, not locally build ones.
Ideas of solution
Context and Environment
Workflow checklist