Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'None' object has no attribute 'replace' or ValueError: The file '...' could not be found with <django.contrib.staticfiles.storage.ManifestStaticFilesStorage. #723

Open
diegueus9 opened this issue Jun 17, 2020 · 0 comments

Comments

@diegueus9
Copy link

diegueus9 commented Jun 17, 2020

Python Versions:

[tool.poetry.dependencies]
python = "^3.6"
celery = "~4.3.0"
dj-database-url = "~0.5.0"
django-admin-interface = "~0.8.0"
django-dynamic-preferences = "~1.8.1"
django-extensions = "~2.1.3"
django-split-settings = "~0.3.0"
django-tabbed-admin = "~1.0.4"
Django = "~2.1.15"
djangorestframework = "~3.9.4"
google-api-python-client = "~1.7.11"
inflection = "~0.3.1"
mozilla-django-oidc = "~1.2.2"
mysqlclient = "~1.3.12"
python-dateutil = "~2.7.3"
python-dotenv = "~0.10.1"
requests = "~2.22.0"
sentry-sdk = "~0.7.3"
uWSGI = "~2.0.18"
newrelic = "~5.6.0"
avro-python3 = "==1.9.1"
channels = "~2.3.1"
channels_redis = "~2.4.2"
django-pipeline = "~2.0.4"
django-redis-cache = "~2.1.0"
async_generator = "^1.10"
scikit-learn = "^0.22.2"

Jquery-confirm version: 3.3.4

When collecting the static I had the error:

Post-processed 'jquery-confirm/demo/libs/bundled.css' as 'jquery-confirm/demo/libs/bundled.2b6c547f6a5d.css'
Traceback (most recent call last):
  File "./manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/core/management/base.py", line 353, in execute
    output = self.handle(*args, **options)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 188, in handle
    collected = self.collect()
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 128, in collect
    for original_path, processed_path, processed in processor:
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 402, in post_process
    yield from super().post_process(*args, **kwargs)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 236, in post_process
    for name, hashed_name, processed, _ in self._post_process(paths, adjustable_paths, hashed_files):
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 293, in _post_process
    content = pattern.sub(converter, content)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 194, in converter
    force=True, hashed_files=hashed_files,
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 131, in _url
    hashed_name = hashed_name_func(*args)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 342, in _stored_name
    cache_name = self.clean_name(self.hashed_name(name))
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 328, in clean_name
    return name.replace('\\', '/')
AttributeError: 'NoneType' object has no attribute 'replace'

After I changed from PipelineCachedStorage to PipelineManifestStorage (as mentioned in #703 the error changed to

Post-processed 'jquery-confirm/demo/libs/bundled.css' as 'jquery-confirm/demo/libs/bundled.2b6c547f6a5d.css'
Post-processing 'jquery-confirm/demo/libs/bs3.css' failed!

Traceback (most recent call last):
  File "./manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/core/management/base.py", line 353, in execute
    output = self.handle(*args, **options)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 188, in handle
    collected = self.collect()
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 134, in collect
    raise processed
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 293, in _post_process
    content = pattern.sub(converter, content)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 194, in converter
    force=True, hashed_files=hashed_files,
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 131, in _url
    hashed_name = hashed_name_func(*args)
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 342, in _stored_name
    cache_name = self.clean_name(self.hashed_name(name))
  File "/home/max/current/virtualenv/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 92, in hashed_name
    raise ValueError("The file '%s' could not be found with %r." % (filename, self))
ValueError: The file 'jquery-confirm/demo/fonts/glyphicons-halflings-regular.eot' could not be found with <django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7fca464db9e8>.

The issue is not related to #95, the only thing worked so far was the suggestion in #302

./manage.py collectstatic --no-input -c -v 3 --ignore=jquery-confirm

Addendum: the ignore flag prevents the error but the file is not collected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant