Frappe Production Issue: 404 on Randomized website.bundle CSS File

Hello everyone,

I’m experiencing an issue on my Frappe production installation where the browser fails to load a CSS file. The error message in the console is:

Copy

Failed to load resource: the server responded with a status of 404 (Not Found) for the file http://[domain_removed]/assets/frappe/dist/css/website.bundle.J5AG376K.css

I’ve noticed that the filename includes a randomized string (in this case, J5AG376K). When I look in this location in my container the radom part is different.

To troubleshoot, I’ve already tried the following:

  • Running bench build
  • Running bench migrate
  • Clearing the cache

Unfortunately, none of these steps have resolved the issue.

Has anyone encountered a similar problem or have any suggestions on how to address this bundler-related error?

Thank you for your help!

try bench update?

Interesting, this occured:
$ bench update
.ERROR: Command ‘git symbolic-ref -q --short HEAD’ returned non-zero exit status 128.
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
sys.exit(cli())
^^^^^
File “/usr/local/lib/python3.11/site-packages/bench/cli.py”, line 132, in cli
bench_command()
File “/usr/local/lib/python3.11/site-packages/click/core.py”, line 1161, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/click/core.py”, line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/click/core.py”, line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/click/core.py”, line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/click/core.py”, line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/bench/commands/update.py”, line 59, in update
update(
File “/usr/local/lib/python3.11/site-packages/bench/utils/bench.py”, line 458, in update
validate_branch()
File “/usr/local/lib/python3.11/site-packages/bench/utils/bench.py”, line 645, in validate_branch
branch = get_current_branch(app)
^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/bench/utils/app.py”, line 175, in get_current_branch
return get_cmd_output(“git symbolic-ref -q --short HEAD”, cwd=repo_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/bench/utils/init.py”, line 240, in get_cmd_output
output = subprocess.check_output(
^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/subprocess.py”, line 466, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/subprocess.py”, line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘git symbolic-ref -q --short HEAD’ returned non-zero exit status 128.

Maybe this could be the root cause?

There are some issues with your Git configuration. Could you run the command git symbolic-ref -q --short HEAD in the Frappe app (cd apps/frappe)?

$ ls
CODEOWNERS SECURITY.md commitlint.config.jsesbuild node_modules realtime
CODE_OF_CONDUCT.md attributions.md crowdin.ymlfrappe node_utils.js sider.yml
LICENSE babel_extractors.csv cypressgenerate_bootstrap_theme.js package.json socketio.js
README.md codecov.yml cypress.config.jshooks.md pyproject.toml yarn.lock
$ git symbolic-ref -q --short HEAD
fatal: not a git repository (or any of the parent directories): .git
$

How are you trying to set up Frappe? Are you following a tutorial or video? If so, could you share the link? It seems like you haven’t run this command in the Frappe app folder (apps/frappe).

If you’re using containers, clear volume and restart redis cache.

I have it running in docker.

I deleted my cache volume and reinstalled and still have the same issue interesting.

For anyone looking to my solution I figured it out thanks to the help of @revant_one !
I opened the redis docker container in command line and used the following command:

redis-cli FLUSHALL