Skip to content

Whitenoise is failing to find font files during Docker build #338

Closed

Description

I'm getting the following error when attempting a local installation in Docker:


> [8/9] RUN DATABASE_URL=postgres://none REDIS_URL=none /venv/bin/python manage.py collectstatic --noinput:                                              
#12 0.238 /venv/lib/python3.9/site-packages/dotenv.py:56: UserWarning: Not reading /code/.env - it doesn't exist.                                         
#12 0.238   warnings.warn("Not reading {0} - it doesn't exist.".format(dotenv))                                                                           
#12 0.865 Post-processing 'css/bootstrap.min.css' failed!                                                                                                 
#12 0.865                                                                                                                                                 
#12 0.865 Traceback (most recent call last):
#12 0.865   File "/code/manage.py", line 15, in <module>
#12 0.865 WARNING: DJANGO_SECRET_KEY not found in os.environ. Generating ephemeral SECRET_KEY.
#12 0.865     execute_from_command_line(sys.argv)
#12 0.865   File "/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
#12 0.865     utility.execute()
#12 0.865   File "/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 440, in execute
#12 0.866     self.fetch_command(subcommand).run_from_argv(self.argv)
#12 0.866   File "/venv/lib/python3.9/site-packages/django/core/management/base.py", line 414, in run_from_argv
#12 0.866     self.execute(*args, **cmd_options)
#12 0.866   File "/venv/lib/python3.9/site-packages/django/core/management/base.py", line 460, in execute
#12 0.866     output = self.handle(*args, **options)
#12 0.866   File "/venv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle
#12 0.866     collected = self.collect()
#12 0.866   File "/venv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 154, in collect
#12 0.867     raise processed
#12 0.867 whitenoise.storage.MissingFileError: The file 'fonts/glyphicons-halflings-regular.eot' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0xffff8cf5dc70>.
#12 0.867 
#12 0.867 The CSS file 'css/bootstrap.min.css' references a file which could not be found:
#12 0.867   fonts/glyphicons-halflings-regular.eot
#12 0.867 
#12 0.867 Please check the URL references in this CSS file, particularly any
#12 0.867 relative paths which might be pointing to the wrong location.
#12 0.867 
------
executor failed running [/bin/sh -c DATABASE_URL=postgres://none REDIS_URL=none /venv/bin/python manage.py collectstatic --noinput]: exit code: 1
ERROR: Service 'app' failed to build : Build failed

I tested a few variations on the URL paths and they seem to be correct. So I'm not sure why Whitenoise isn't detecting the font files. Some initial research suggests there might be something new about the Whitenoise storage classes. I'll poke around some more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions