[GH-ISSUE #1324] OSError: [Errno 36] File name too long #2323

Closed
opened 2026-03-01 17:58:11 +03:00 by kerem · 1 comment
Owner

Originally created by @Cyberes on GitHub (Jan 15, 2024).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1324

Describe the bug

Filename is too long so the server fails to start.

Steps to reproduce

  1. Archive a website that has a very long URL.
  2. Server fails to start with Server Error (500)

Screenshots or log output

Internal Server Error: /public/
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/core/handlers/base.py", line 204, in _get_response
    response = response.render()
               ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/response.py", line 105, in render
    self.content = self.rendered_content
                   ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/response.py", line 83, in rendered_content
    return template.render(context, self._request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 170, in render
    return self._render(context)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 162, in _render
    return self.nodelist.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 162, in _render
    return self.nodelist.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/defaulttags.py", line 211, in render
    nodelist.append(node.render_annotated(context))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/loader_tags.py", line 192, in render
    return template.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 172, in render
    return self._render(context)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 162, in _render
    return self.nodelist.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/defaulttags.py", line 305, in render
    match = condition.eval(context)
            ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/defaulttags.py", line 889, in eval
    return self.value.resolve(context, ignore_failures=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 671, in resolve
    obj = self.var.resolve(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 796, in resolve
    value = self._resolve_lookup(context)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 858, in _resolve_lookup
    current = current()
              ^^^^^^^^^
  File "/srv/archivebox/.local/lib/python3.11/site-packages/archivebox/core/models.py", line 139, in icons
    return snapshot_icons(self)
           ^^^^^^^^^^^^^^^^^^^^
  File "/srv/archivebox/.local/lib/python3.11/site-packages/archivebox/index/html.py", line 192, in snapshot_icons
    return cache.get_or_set(cache_key, calc_snapshot_icons)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django/core/cache/backends/base.py", line 171, in get_or_set
    default = default()
              ^^^^^^^^^
  File "/srv/archivebox/.local/lib/python3.11/site-packages/archivebox/index/html.py", line 130, in calc_snapshot_icons
    canon = link.canonical_outputs()
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/archivebox/.local/lib/python3.11/site-packages/archivebox/index/schema.py", line 427, in canonical_outputs
    'wget_path': wget_output_path(self),
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/archivebox/.local/lib/python3.11/site-packages/archivebox/util.py", line 116, in typechecked_function
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/srv/archivebox/.local/lib/python3.11/site-packages/archivebox/extractors/wget.py", line 170, in wget_output_path
    if search_dir.exists():
       ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/pathlib.py", line 1236, in exists
    self.stat()
  File "/usr/lib/python3.11/pathlib.py", line 1014, in stat
    return os.stat(self, follow_symlinks=follow_symlinks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 36] File name too long: '/srv/archivebox/archivebox/archive/XXXXXXXXXXXXXXXXX/XXXXXXXXXXXXXX/XXXXXX/XXXXXX/XXXXXXX/XX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
"GET /public/ HTTP/1.0" 500 145

ArchiveBox version

v0.7.2

Originally created by @Cyberes on GitHub (Jan 15, 2024). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1324 #### Describe the bug Filename is too long so the server fails to start. #### Steps to reproduce 1. Archive a website that has a very long URL. 2. Server fails to start with `Server Error (500)` #### Screenshots or log output ``` Internal Server Error: /public/ Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/core/handlers/base.py", line 204, in _get_response response = response.render() ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/response.py", line 105, in render self.content = self.rendered_content ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/response.py", line 83, in rendered_content return template.render(context, self._request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 170, in render return self._render(context) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 162, in _render return self.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/loader_tags.py", line 150, in render return compiled_parent._render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 162, in _render return self.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/loader_tags.py", line 62, in render result = block.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/defaulttags.py", line 211, in render nodelist.append(node.render_annotated(context)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/loader_tags.py", line 192, in render return template.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 172, in render return self._render(context) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 162, in _render return self.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/defaulttags.py", line 305, in render match = condition.eval(context) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/defaulttags.py", line 889, in eval return self.value.resolve(context, ignore_failures=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 671, in resolve obj = self.var.resolve(context) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 796, in resolve value = self._resolve_lookup(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/template/base.py", line 858, in _resolve_lookup current = current() ^^^^^^^^^ File "/srv/archivebox/.local/lib/python3.11/site-packages/archivebox/core/models.py", line 139, in icons return snapshot_icons(self) ^^^^^^^^^^^^^^^^^^^^ File "/srv/archivebox/.local/lib/python3.11/site-packages/archivebox/index/html.py", line 192, in snapshot_icons return cache.get_or_set(cache_key, calc_snapshot_icons) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/core/cache/backends/base.py", line 171, in get_or_set default = default() ^^^^^^^^^ File "/srv/archivebox/.local/lib/python3.11/site-packages/archivebox/index/html.py", line 130, in calc_snapshot_icons canon = link.canonical_outputs() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/archivebox/.local/lib/python3.11/site-packages/archivebox/index/schema.py", line 427, in canonical_outputs 'wget_path': wget_output_path(self), ^^^^^^^^^^^^^^^^^^^^^^ File "/srv/archivebox/.local/lib/python3.11/site-packages/archivebox/util.py", line 116, in typechecked_function return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/srv/archivebox/.local/lib/python3.11/site-packages/archivebox/extractors/wget.py", line 170, in wget_output_path if search_dir.exists(): ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/pathlib.py", line 1236, in exists self.stat() File "/usr/lib/python3.11/pathlib.py", line 1014, in stat return os.stat(self, follow_symlinks=follow_symlinks) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: [Errno 36] File name too long: '/srv/archivebox/archivebox/archive/XXXXXXXXXXXXXXXXX/XXXXXXXXXXXXXX/XXXXXX/XXXXXX/XXXXXXX/XX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' "GET /public/ HTTP/1.0" 500 145 ``` #### ArchiveBox version v0.7.2
kerem closed this issue 2026-03-01 17:58:11 +03:00
Author
Owner

@pirate commented on GitHub (Jan 15, 2024):

Duplicate of https://github.com/ArchiveBox/ArchiveBox/issues/1107

Instructions for how to fix are in that issue

<!-- gh-comment-id:1892738620 --> @pirate commented on GitHub (Jan 15, 2024): Duplicate of https://github.com/ArchiveBox/ArchiveBox/issues/1107 Instructions for how to fix are in that issue
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#2323
No description provided.