OpenEnergyPlatform / oeplatform

Repository for the code of the Open Energy Platform (OEP) website. The OEP provides an interface to the Open Energy Family
http://openenergyplatform.org/
GNU Affero General Public License v3.0
61 stars 19 forks source link

OfflineGenerationError after starting docker image #1626

Closed ebroda closed 2 months ago

ebroda commented 2 months ago

Description of the issue

As I build the docker image myself and started it, I get a Django error.

OfflineGenerationError at /

You have offline compression enabled but key "788ef1...4ed" is missing from offline manifest. You may need to run "python manage.py compress". Here is the original content:
    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/static/css/jquery-ui.min.css"><!-- //cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.css -->
    <link rel="stylesheet" type="text/css" href="/static/css/base-style.css?md5=d4e024ac45daad057d0191a8f6266156">

Steps to Reproduce

  1. Create docker image
  2. docker-compose up
  3. Visit localhost:8080 in Browser

Fix

$ sudo docker ps --format '{{.Names}}'
docker-oep_oeplatform_1
docker-oep_postgres_1
$ sudo docker exec -ti docker-oep_oeplatform_1 bash
root@ba4bea24f8b9:/app# python manage.py compress
Compressing... done
Compressed 10 block(s) from 131 template(s) for 1 context(s).
root@ba4bea24f8b9:/app# 

Restart docker-container (probably only the Django would be enough, but I don't know how) Then it works.

Ideas of solution

Include python mange.py compress in docker-entrypoint.sh.

Context and Environment

Workflow checklist

ebroda commented 2 months ago

As I'm not part of the repo, I can't ask for Review (step 9). So please have a look :wink: https://github.com/OpenEnergyPlatform/oeplatform/blob/develop/CONTRIBUTING.md?plain=1#L42

jh-RLI commented 2 months ago

Very good tip, didn't realise this wasn't possible via the GitHub UI in this case. Posting a comment like you did is also a good option :)

Also great find, this issue is also due to the overlooked docker setting I mentioned in https://github.com/OpenEnergyPlatform/oeplatform/issues/1622. Basically all docker build used a fixed version of oeplatform SW (v0.9.2) ... now it's set to latest.