frappe_docker: ERPNext upgrade makes assets fail

After version change and containers rebuild assets are broken

Context information (for bug reports)

Steps to reproduce the issue

  1. Install ERPNext with version v15.16.2
  2. Finish instalation and go the application
  3. Change version in .env (or docker compose) from v15.16.2 to v15.17.0
  4. Rebuild container
  5. Refresh works - because of cache - try incognito browser
  6. Application works, but all assets are broken (css / js)
  7. Running migrate or build not helping
  8. Fresh install works with database export / import but it’s not the desired upgrade

Expected result: after upgrade to have a fully functional application

Stacktrace / full error message if available

![image](https://github.com/frappe/frappe_docker/assets/2951110/d70c465d-bc6b-4977-be13-788532cc1216)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (5 by maintainers)

Most upvoted comments

So I had to start a new container (from newly built image) with shell, copy the contents of sites/assets/assets.json and sites/assets/assets-rtl.json, then go to my mapped sites/assets volume and update those files in mapped volume, then bench clear-cache && bench clear-website-cache, restarted my containers and now everything works fine.

@oleynikd’s procedure had worked for me also for quite a while, but recently again old .css files were requested in spite of following it, and this time what helped was clearing the Redis cache: docker exec -it -u root redis-cache redis-cli FLUSHALL (redis-cache being the name of the Redis cache container).

Just now see that @ronyantony-ig found this out already 2 hours ahead of me, but the commands seem to be missing the container name.

I had similar issue. On my cicd I havd 5 migaes from deployments and the assetsfrom the first one was being requsted by the browser, despite the running container had the latest in assets.json.

eg: container assets.json: “login.bundle.css”: “/assets/frappe/dist/css/login.bundle.BNLXGCOL.css” broser was trying to fetch login.bundle.VNLPGCOL.css.

The possible issue with my environmnet was the Redis cache holding old stale outdated assets.json data.

Running these commands solved the issue:

docker exec -it <redis-cache-container> redis-cli FLUSHALL docker exec -it <redis-queue-container> redis-cli FLUSHALL