[GH-ISSUE #1553] Bug: zoneinfo._common.ZoneInfoNotFoundError: 'tzlocal() does not support non-zoneinfo timezones like UTC. \nPlease use a timezone in the form of Continent/City' #922

Closed
opened 2026-03-01 14:47:19 +03:00 by kerem · 9 comments
Owner

Originally created by @jvoisin on GitHub (Oct 19, 2024).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1553

Describe the bug

  • The snapshots access aren't working :<

Steps to reproduce

  • Try to access a snapshot
  • Get a stacktrace and a 500

Screenshots or log output

(venv) /media/nfs/archives $ archivebox server 0.0.0.0:8000
[i] [2024-10-19 12:20:15] ArchiveBox v0.7.1: archivebox server 0.0.0.0:8000
    > /media/nfs/archives

[+] Starting ArchiveBox webserver...
    > Logging errors to ./logs/errors.log
Performing system checks...

System check identified no issues (0 silenced).
October 19, 2024 - 12:20:15
Django version 3.1.14, using settings 'core.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Internal Server Error: /admin/core/snapshot/d3cecc42-3029-441a-a2d3-ca9b57b5bdfb/change/
Traceback (most recent call last):
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 204, in _get_response
    response = response.render()
               ^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/response.py", line 105, in render
    self.content = self.rendered_content
                   ^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/response.py", line 83, in rendered_content
    return template.render(context, self._request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 170, in render
    return self._render(context)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 162, in _render
    return self.nodelist.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 162, in _render
    return self.nodelist.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 162, in _render
    return self.nodelist.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 211, in render
    nodelist.append(node.render_annotated(context))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 192, in render
    return template.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 172, in render
    return self._render(context)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 162, in _render
    return self.nodelist.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 211, in render
    nodelist.append(node.render_annotated(context))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 211, in render
    nodelist.append(node.render_annotated(context))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 312, in render
    return nodelist.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 312, in render
    return nodelist.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 988, in render
    output = self.filter_expression.resolve(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 671, in resolve
    obj = self.var.resolve(context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 796, in resolve
    value = self._resolve_lookup(context)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 858, in _resolve_lookup
    current = current()
              ^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/contrib/admin/helpers.py", line 196, in contents
    f, attr, value = lookup_field(field, obj, model_admin)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/contrib/admin/utils.py", line 276, in lookup_field
    attr = getattr(obj, name)
           ^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
                                         ^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/archivebox/core/models.py", line 148, in bookmarked
    return parse_date(self.timestamp)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/archivebox/util.py", line 116, in typechecked_function
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/archivebox/util.py", line 159, in parse_date
    return dateparser(date, settings={'TIMEZONE': 'UTC'}).replace(tzinfo=timezone.utc)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/conf.py", line 100, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/__init__.py", line 79, in parse
    data = parser.get_date_data(date_string, date_formats)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/date.py", line 519, in get_date_data
    parsed_date = _DateLocaleParser.parse(
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/date.py", line 239, in parse
    return instance._parse()
           ^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/date.py", line 243, in _parse
    date_data = self._parsers[parser_name]()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/date.py", line 258, in _try_timestamp
    return self._try_timestamp_parser()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/date.py", line 251, in _try_timestamp_parser
    date_obj=get_date_from_timestamp(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/date.py", line 173, in get_date_from_timestamp
    date_obj = apply_timezone_from_settings(date_obj, settings)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/utils/__init__.py", line 129, in apply_timezone_from_settings
    tz = get_localzone()
         ^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/tzlocal/unix.py", line 219, in get_localzone
    _cache_tz = _get_localzone()
                ^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/tzlocal/unix.py", line 176, in _get_localzone
    tzenv = utils._tz_from_env()
            ^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/tzlocal/utils.py", line 109, in _tz_from_env
    raise zoneinfo.ZoneInfoNotFoundError(
zoneinfo._common.ZoneInfoNotFoundError: 'tzlocal() does not support non-zoneinfo timezones like UTC. \nPlease use a timezone in the form of Continent/City'
"GET /admin/core/snapshot/d3cecc42-3029-441a-a2d3-ca9b57b5bdfb/change/ HTTP/1.1" 500 145

ArchiveBox version

(venv) $ archivebox version 
0.7.1
ArchiveBox v0.7.1 Cpython Linux Linux-6.8.12-2-pve-x86_64-with x86_64
DEBUG=False IN_DOCKER=False IN_QEMU=False IS_TTY=True TZ=UTC FS_ATOMIC=True FS_REMOTE=True FS_USER=1000:1000 FS_PERMS=644 SEARCH_BACKEND=ripgrep

[i] Dependency versions:
 √  PYTHON_BINARY         v3.12.7         valid     /usr/bin/python3.12                                                         
 √  SQLITE_BINARY         v2.6.0          valid     /usr/lib/python3.12/sqlite3/dbapi2.py                                       
 √  DJANGO_BINARY         v3.1.14         valid     /home/archivebox/venv/lib/python3.12/site-packages/django/__init__.py       
 √  ARCHIVEBOX_BINARY     v0.7.1          valid     /home/archivebox/venv/bin/archivebox                                        

 √  CURL_BINARY           v8.10.1         valid     /usr/bin/curl                                                               
 √  WGET_BINARY           v1.24.5         valid     /usr/bin/wget                                                               
 X  NODE_BINARY           ?               invalid   node                                                                        
 X  SINGLEFILE_BINARY     ?               invalid   single-file                                                                 
 X  READABILITY_BINARY    ?               invalid   readability-extractor                                                       
 X  MERCURY_BINARY        ?               invalid   postlight-parser                                                            
 X  GIT_BINARY            ?               invalid   git                                                                         
 √  YOUTUBEDL_BINARY      v2024.10.07     valid     /home/archivebox/venv/bin/yt-dlp                                            
 -  CHROME_BINARY         -               disabled  None                                                                        
 √  RIPGREP_BINARY        v14.1.1         valid     /usr/bin/rg                                                                 

[i] Source-code locations:
 √  PACKAGE_DIR           24 files        valid     /home/archivebox/venv/lib/python3.12/site-packages/archivebox               
 √  TEMPLATES_DIR         4 files         valid     /home/archivebox/venv/lib/python3.12/site-packages/archivebox/templates     
 -  CUSTOM_TEMPLATES_DIR  -               disabled  None                                                                        

[i] Secrets locations:
 -  CHROME_USER_DATA_DIR  -               disabled  None                                                                        
 -  COOKIES_FILE          -               disabled  None                                                                        

[i] Data locations:
 √  OUTPUT_DIR            5 files @       valid     /media/nfs/archives                                                         
 √  SOURCES_DIR           2 files         valid     ./sources                                                                   
 √  LOGS_DIR              1 files         valid     ./logs                                                                      
 √  ARCHIVE_DIR           41 files        valid     ./archive                                                                   
 √  CONFIG_FILE           81.0 Bytes      valid     ./ArchiveBox.conf                                                           
 √  SQL_INDEX             252.0 KB        valid     ./index.sqlite3                                                             

[!] Warning: Missing 5 recommended dependencies
    ! NODE_BINARY: node (unable to detect version)
    ! SINGLEFILE_BINARY: single-file (unable to detect version)
      Hint: To install all packages automatically run: archivebox setup
            or to disable it and silence this warning: archivebox config --set SAVE_SINGLEFILE=False
            
    ! READABILITY_BINARY: readability-extractor (unable to detect version)
      Hint: To install all packages automatically run: archivebox setup
            or to disable it and silence this warning: archivebox config --set SAVE_READABILITY=False
            
    ! MERCURY_BINARY: postlight-parser (unable to detect version)
      Hint: To install all packages automatically run: archivebox setup
            or to disable it and silence this warning: archivebox config --set SAVE_MERCURY=False
            
    ! GIT_BINARY: git (unable to detect version)
$ 

ArchiveBox was installed via pip, on Alpine Linux edge, x64.

Originally created by @jvoisin on GitHub (Oct 19, 2024). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1553 #### Describe the bug - The snapshots access aren't working :< #### Steps to reproduce - Try to access a snapshot - Get a stacktrace and a 500 #### Screenshots or log output ```python (venv) /media/nfs/archives $ archivebox server 0.0.0.0:8000 [i] [2024-10-19 12:20:15] ArchiveBox v0.7.1: archivebox server 0.0.0.0:8000 > /media/nfs/archives [+] Starting ArchiveBox webserver... > Logging errors to ./logs/errors.log Performing system checks... System check identified no issues (0 silenced). October 19, 2024 - 12:20:15 Django version 3.1.14, using settings 'core.settings' Starting development server at http://0.0.0.0:8000/ Quit the server with CONTROL-C. Internal Server Error: /admin/core/snapshot/d3cecc42-3029-441a-a2d3-ca9b57b5bdfb/change/ Traceback (most recent call last): File "/home/archivebox/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 204, in _get_response response = response.render() ^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/response.py", line 105, in render self.content = self.rendered_content ^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/response.py", line 83, in rendered_content return template.render(context, self._request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 170, in render return self._render(context) ^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 162, in _render return self.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 150, in render return compiled_parent._render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 162, in _render return self.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 150, in render return compiled_parent._render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 162, in _render return self.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 62, in render result = block.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 62, in render result = block.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 211, in render nodelist.append(node.render_annotated(context)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 192, in render return template.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 172, in render return self._render(context) ^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 162, in _render return self.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 211, in render nodelist.append(node.render_annotated(context)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 211, in render nodelist.append(node.render_annotated(context)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 312, in render return nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 312, in render return nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) ^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 988, in render output = self.filter_expression.resolve(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 671, in resolve obj = self.var.resolve(context) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 796, in resolve value = self._resolve_lookup(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/template/base.py", line 858, in _resolve_lookup current = current() ^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/contrib/admin/helpers.py", line 196, in contents f, attr, value = lookup_field(field, obj, model_admin) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/contrib/admin/utils.py", line 276, in lookup_field attr = getattr(obj, name) ^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/archivebox/core/models.py", line 148, in bookmarked return parse_date(self.timestamp) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/archivebox/util.py", line 116, in typechecked_function return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/archivebox/util.py", line 159, in parse_date return dateparser(date, settings={'TIMEZONE': 'UTC'}).replace(tzinfo=timezone.utc) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/conf.py", line 100, in wrapper return f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/__init__.py", line 79, in parse data = parser.get_date_data(date_string, date_formats) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/date.py", line 519, in get_date_data parsed_date = _DateLocaleParser.parse( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/date.py", line 239, in parse return instance._parse() ^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/date.py", line 243, in _parse date_data = self._parsers[parser_name]() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/date.py", line 258, in _try_timestamp return self._try_timestamp_parser() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/date.py", line 251, in _try_timestamp_parser date_obj=get_date_from_timestamp( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/date.py", line 173, in get_date_from_timestamp date_obj = apply_timezone_from_settings(date_obj, settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/dateparser/utils/__init__.py", line 129, in apply_timezone_from_settings tz = get_localzone() ^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/tzlocal/unix.py", line 219, in get_localzone _cache_tz = _get_localzone() ^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/tzlocal/unix.py", line 176, in _get_localzone tzenv = utils._tz_from_env() ^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/tzlocal/utils.py", line 109, in _tz_from_env raise zoneinfo.ZoneInfoNotFoundError( zoneinfo._common.ZoneInfoNotFoundError: 'tzlocal() does not support non-zoneinfo timezones like UTC. \nPlease use a timezone in the form of Continent/City' "GET /admin/core/snapshot/d3cecc42-3029-441a-a2d3-ca9b57b5bdfb/change/ HTTP/1.1" 500 145 ``` #### ArchiveBox version ```logs (venv) $ archivebox version 0.7.1 ArchiveBox v0.7.1 Cpython Linux Linux-6.8.12-2-pve-x86_64-with x86_64 DEBUG=False IN_DOCKER=False IN_QEMU=False IS_TTY=True TZ=UTC FS_ATOMIC=True FS_REMOTE=True FS_USER=1000:1000 FS_PERMS=644 SEARCH_BACKEND=ripgrep [i] Dependency versions: √ PYTHON_BINARY v3.12.7 valid /usr/bin/python3.12 √ SQLITE_BINARY v2.6.0 valid /usr/lib/python3.12/sqlite3/dbapi2.py √ DJANGO_BINARY v3.1.14 valid /home/archivebox/venv/lib/python3.12/site-packages/django/__init__.py √ ARCHIVEBOX_BINARY v0.7.1 valid /home/archivebox/venv/bin/archivebox √ CURL_BINARY v8.10.1 valid /usr/bin/curl √ WGET_BINARY v1.24.5 valid /usr/bin/wget X NODE_BINARY ? invalid node X SINGLEFILE_BINARY ? invalid single-file X READABILITY_BINARY ? invalid readability-extractor X MERCURY_BINARY ? invalid postlight-parser X GIT_BINARY ? invalid git √ YOUTUBEDL_BINARY v2024.10.07 valid /home/archivebox/venv/bin/yt-dlp - CHROME_BINARY - disabled None √ RIPGREP_BINARY v14.1.1 valid /usr/bin/rg [i] Source-code locations: √ PACKAGE_DIR 24 files valid /home/archivebox/venv/lib/python3.12/site-packages/archivebox √ TEMPLATES_DIR 4 files valid /home/archivebox/venv/lib/python3.12/site-packages/archivebox/templates - CUSTOM_TEMPLATES_DIR - disabled None [i] Secrets locations: - CHROME_USER_DATA_DIR - disabled None - COOKIES_FILE - disabled None [i] Data locations: √ OUTPUT_DIR 5 files @ valid /media/nfs/archives √ SOURCES_DIR 2 files valid ./sources √ LOGS_DIR 1 files valid ./logs √ ARCHIVE_DIR 41 files valid ./archive √ CONFIG_FILE 81.0 Bytes valid ./ArchiveBox.conf √ SQL_INDEX 252.0 KB valid ./index.sqlite3 [!] Warning: Missing 5 recommended dependencies ! NODE_BINARY: node (unable to detect version) ! SINGLEFILE_BINARY: single-file (unable to detect version) Hint: To install all packages automatically run: archivebox setup or to disable it and silence this warning: archivebox config --set SAVE_SINGLEFILE=False ! READABILITY_BINARY: readability-extractor (unable to detect version) Hint: To install all packages automatically run: archivebox setup or to disable it and silence this warning: archivebox config --set SAVE_READABILITY=False ! MERCURY_BINARY: postlight-parser (unable to detect version) Hint: To install all packages automatically run: archivebox setup or to disable it and silence this warning: archivebox config --set SAVE_MERCURY=False ! GIT_BINARY: git (unable to detect version) $ ``` ArchiveBox was installed via pip, on Alpine Linux edge, x64.
Author
Owner

@pirate commented on GitHub (Oct 19, 2024):

Is your browser's time zone set to UTC?

<!-- gh-comment-id:2424102006 --> @pirate commented on GitHub (Oct 19, 2024): Is your browser's time zone set to UTC?
Author
Owner

@jvoisin commented on GitHub (Oct 19, 2024):

https://webbrowsertools.com/timezone/ shows:

Time on Server	Sat, 19 Oct 2024 21:33:06 GMT
Time on Local Machine	Sat Oct 19 2024 21:33:05 GMT+0000 (Greenwich Mean Time)
Time from Intl.DateTimeFormat #1	Saturday, October 19, 2024 at 9:33:05 PM GMT
Time from Intl.DateTimeFormat #2	Saturday, October 19, 2024 at 9:33:05 PM Greenwich Mean Time
Internet Beat	around @939
Timezone	Atlantic/Reykjavik
Timezone Offset	0 minutes
Numbering System	latn
Locale	en-US
Calendar	gregory
Day	numeric
Month	numeric
Year	numeric
Milliseconds since January 1, 1970	1729373585996
<!-- gh-comment-id:2424222298 --> @jvoisin commented on GitHub (Oct 19, 2024): https://webbrowsertools.com/timezone/ shows: ``` Time on Server Sat, 19 Oct 2024 21:33:06 GMT Time on Local Machine Sat Oct 19 2024 21:33:05 GMT+0000 (Greenwich Mean Time) Time from Intl.DateTimeFormat #1 Saturday, October 19, 2024 at 9:33:05 PM GMT Time from Intl.DateTimeFormat #2 Saturday, October 19, 2024 at 9:33:05 PM Greenwich Mean Time Internet Beat around @939 Timezone Atlantic/Reykjavik Timezone Offset 0 minutes Numbering System latn Locale en-US Calendar gregory Day numeric Month numeric Year numeric Milliseconds since January 1, 1970 1729373585996 ```
Author
Owner

@pirate commented on GitHub (Oct 20, 2024):

Interesting, I've never seen this error before. dateparser explicitly indicates the way we're using it with UTC is supported in the docs:

>>> parse(date, settings={'TIMEZONE': 'UTC'}).replace(tzinfo=timezone.utc)

https://dateparser.readthedocs.io/en/latest/settings.html#timezone-related-configurations

The only thing I can think of is that maybe the underlying tzdata for the system doesn't include UTC, which is pretty wild I cant imagine that it wouldn't be supported.

I can push a fix in the next release but I don't really know how this could happen.

Could you try and test on your system and see if this works:

$ pip install dateparser
$ python3

>>> from dateparser import parse
>>> parse('2012-12-31 19:53:53', settings={'TIMEZONE': 'UTC'})
# Should output: datetime.datetime(2012, 12, 31, 19, 53, 53)
<!-- gh-comment-id:2425273129 --> @pirate commented on GitHub (Oct 20, 2024): Interesting, I've never seen this error before. `dateparser` explicitly indicates the way we're using it with `UTC` is supported in the docs: ```python >>> parse(date, settings={'TIMEZONE': 'UTC'}).replace(tzinfo=timezone.utc) ``` https://dateparser.readthedocs.io/en/latest/settings.html#timezone-related-configurations The only thing I can think of is that maybe the underlying tzdata for the system doesn't include `UTC`, which is pretty wild I cant imagine that it wouldn't be supported. I can push a fix in the next release but I don't really know how this could happen. Could you try and test on your system and see if this works: ```python3 $ pip install dateparser $ python3 >>> from dateparser import parse >>> parse('2012-12-31 19:53:53', settings={'TIMEZONE': 'UTC'}) # Should output: datetime.datetime(2012, 12, 31, 19, 53, 53) ```
Author
Owner

@jvoisin commented on GitHub (Oct 21, 2024):

$ python3

Python 3.12.7 (main, Oct  7 2024, 07:18:03) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dateparser import parse
>>> parse('2012-12-31 19:53:53', settings={'TIMEZONE': 'UTC'})
datetime.datetime(2012, 12, 31, 19, 53, 53)
>>> 
<!-- gh-comment-id:2426908330 --> @jvoisin commented on GitHub (Oct 21, 2024): ```python3 $ python3 Python 3.12.7 (main, Oct 7 2024, 07:18:03) [GCC 14.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from dateparser import parse >>> parse('2012-12-31 19:53:53', settings={'TIMEZONE': 'UTC'}) datetime.datetime(2012, 12, 31, 19, 53, 53) >>> ```
Author
Owner

@pirate commented on GitHub (Oct 21, 2024):

Very strange.

Could you try running this and report back if it upgrades anything or if it reports nothing was upgraded:

pip install pytz --upgrade
pip install tzdata --upgrade
<!-- gh-comment-id:2427876147 --> @pirate commented on GitHub (Oct 21, 2024): Very strange. Could you try running this and report back if it upgrades anything or if it reports nothing was upgraded: ```bash pip install pytz --upgrade pip install tzdata --upgrade ```
Author
Owner

@jvoisin commented on GitHub (Oct 23, 2024):

~ $ source venv/bin/activate
(venv) ~ $ pip install pytz --upgrade
Requirement already satisfied: pytz in ./venv/lib/python3.12/site-packages (2024.2)
(venv) ~ $ pip install tzdata --upgrade
Collecting tzdata
  Downloading tzdata-2024.2-py2.py3-none-any.whl.metadata (1.4 kB)
Downloading tzdata-2024.2-py2.py3-none-any.whl (346 kB)
Installing collected packages: tzdata
Successfully installed tzdata-2024.2
(venv) ~ $ 

Seems like it does, yes

<!-- gh-comment-id:2432551970 --> @jvoisin commented on GitHub (Oct 23, 2024): ``` ~ $ source venv/bin/activate (venv) ~ $ pip install pytz --upgrade Requirement already satisfied: pytz in ./venv/lib/python3.12/site-packages (2024.2) (venv) ~ $ pip install tzdata --upgrade Collecting tzdata Downloading tzdata-2024.2-py2.py3-none-any.whl.metadata (1.4 kB) Downloading tzdata-2024.2-py2.py3-none-any.whl (346 kB) Installing collected packages: tzdata Successfully installed tzdata-2024.2 (venv) ~ $ ``` Seems like it does, yes
Author
Owner

@pirate commented on GitHub (Oct 23, 2024):

Aha ok, after that upgrade does archivebox server 0.0.0.0:8000 still throw the error?

If not, I'll add tzdata to our dependencies to fix it for everyone.

<!-- gh-comment-id:2433567889 --> @pirate commented on GitHub (Oct 23, 2024): Aha ok, after that upgrade does `archivebox server 0.0.0.0:8000` still throw the error? If not, I'll add `tzdata` to our dependencies to fix it for everyone.
Author
Owner

@jvoisin commented on GitHub (Oct 24, 2024):

Yup, it's now working

<!-- gh-comment-id:2435106845 --> @jvoisin commented on GitHub (Oct 24, 2024): Yup, it's now working
Author
Owner

@pirate commented on GitHub (Oct 24, 2024):

Ok I fixed it on dev in 27d5eb23. It'll be out with the next v0.8.5rcXYZ release.

<!-- gh-comment-id:2436397407 --> @pirate commented on GitHub (Oct 24, 2024): Ok I fixed it on dev in 27d5eb23. It'll be out with the next `v0.8.5rcXYZ` release.
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#922
No description provided.