[GH-ISSUE #1641] Bug: archivebox list --json is broken #2493

Open
opened 2026-03-01 17:59:25 +03:00 by kerem · 1 comment
Owner

Originally created by @blastrock on GitHub (Jan 22, 2025).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1641

Originally assigned to: @pirate on GitHub.

Provide a screenshot and describe the bug

docker exec --user 1000 -i archivebox archivebox list --json

Steps to reproduce

1. Run `archivebox list --json`

Logs or errors

╭──────────────────────────────────────────────────────────────────────────────╮
│ [2025-01-22 20:44:37] ArchiveBox v0.8.5rc51: archivebox list --json          │
╰──────────────────────────────────────────────────────────────────────────────╯

╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /usr/local/bin/archivebox:8 in <module>                                      │
│                                                                              │
│   6 if __name__ == '__main__':                                               │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])     │
│ ❱ 8 │   sys.exit(main())                                                     │
│   9                                                                          │
│                                                                              │
│ /app/archivebox/cli/__init__.py:258 in main                                  │
│                                                                              │
│   256 │                                                                      │
│   257 │   try:                                                               │
│ ❱ 258 │   │   run_subcommand(                                                │
│   259 │   │   │   subcommand=command.subcommand,                             │
│   260 │   │   │   subcommand_args=command.subcommand_args,                   │
│                                                                              │
│ /app/archivebox/cli/__init__.py:184 in run_subcommand                        │
│                                                                              │
│   182 │                                                                      │
│   183module = import_module('.archivebox_{}'.format(subcommand), __pack │
│ ❱ 184 │   module.main(args=subcommand_args, stdin=stdin, pwd=pwd)    # type: │185 │                                                                      │
│   186# wait for webhooks, signals, and other background jobs to finish  │
│                                                                              │
│ /app/archivebox/cli/archivebox_list.py:123 in main                           │
│                                                                              │
│   121 │   │   raise SystemExit(2)                                            │
│   122 │                                                                      │
│ ❱ 123matching_folders = list_all(                                       │
│   124 │   │   filter_patterns=command.filter_patterns,                       │
│   125 │   │   filter_type=command.filter_type,                               │
│                                                                              │
│ /app/archivebox/misc/util.py:163 in typechecked_function                     │
│                                                                              │
│   161 │   │   │   check_argument_type(arg_key, arg_val)                      │
│   162 │   │                                                                  │
│ ❱ 163 │   │   return func(*args, **kwargs)                                   │
│   164 │                                                                      │
│   165return typechecked_function                                        │
│                                                                              │
│ /app/archivebox/main.py:975 in list_all                                      │
│                                                                              │
│    973 │                                                                     │
│    974if json:                                                          │
│ ❱  975 │   │   output = generate_json_index_from_links(folders.values(), wit │
│    976elif html:                                                        │
│    977 │   │   output = generate_index_from_links(folders.values(), with_hea │
│                                                                              │
│ /app/archivebox/misc/util.py:163 in typechecked_function                     │
│                                                                              │
│   161 │   │   │   check_argument_type(arg_key, arg_val)                      │
│   162 │   │                                                                  │
│ ❱ 163 │   │   return func(*args, **kwargs)                                   │
│   164 │                                                                      │
│   165return typechecked_function                                        │
│                                                                              │
│                                                                              │
│ /app/archivebox/index/json.py:36 in generate_json_index_from_links           │
│                                                                              │
│    34 │   │   │   'source': 'https://github.com/ArchiveBox/ArchiveBox',      │
│    35 │   │   │   'issues': 'https://github.com/ArchiveBox/ArchiveBox/issues │
│ ❱  36 │   │   │   'dependencies': settings.BINARIES.to_dict(),               │
│    37 │   │   },                                                             │
│    38 │   }                                                                  │
│                                                                              │
│ /usr/local/lib/python3.11/site-packages/benedict/dicts/keyattr/keyattr_dict. │
│ py:39 in __getattr__                                                         │
│                                                                              │
│   37 │   │   │   │   raise AttributeError(attr_message) from None            │
│   38 │   │   │   if not self._keyattr_dynamic:                               │
│ ❱ 39 │   │   │   │   raise AttributeError(attr_message) from None            │
│   40 │   │   │   self.__setitem__(attr, {})                                  │
│   41 │   │   │   return self.__getitem__(attr)                               │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'benedict' object has no attribute 'to_dict'

ArchiveBox Version

0.8.5rc51
ArchiveBox v0.8.5rc51 COMMIT_HASH=63bf902 BUILD_TIME=2024-10-24 06:32:16 
1729751536
IN_DOCKER=True IN_QEMU=False ARCH=x86_64 OS=Linux 
PLATFORM=Linux-6.8.0-51-generic-x86_64-with-glibc2.36 PYTHON=Cpython
EUID=1000:1000 UID=1000:1000 PUID=1000:1000 FS_UID=1000:1000 FS_PERMS=644 
FS_ATOMIC=True FS_REMOTE=True
DEBUG=False IS_TTY=False SUDO=False ID=723cdf77:b55d28cf SEARCH_BACKEND=ripgrep 
LDAP=False

 Binary Dependencies:
 √  python                3.11.10      sys_pip    /usr/local/bin/python3.11
 √  django                5.1.2        sys_pip    /usr/local/lib/python3.11/site-packages/django/__init__.py
 √  sqlite                2.6.0        sys_pip    /usr/local/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py
 √  pip                   24.0.0       sys_pip    /usr/local/bin/pip
 √  pipx                  1.1.0        sys_pip    /bin/pipx
 √  node                  22.10.0      apt        /usr/bin/node
 √  npm                   10.9.0       apt        /usr/bin/npm
 √  npx                   10.9.0       apt        /usr/bin/npx
 √  playwright            1.48.0       sys_pip    /usr/local/bin/playwright
 √  puppeteer             23.6.0       lib_npm    ~/.npm/bin/puppeteer
 √  ldap                  3.4.4        sys_pip    /usr/local/lib/python3.11/site-packages/ldap/__init__.py
 √  rg                    13.0.0       apt        /usr/bin/rg
 √  sonic                 1.4.9        env        /usr/local/bin/sonic
 √  chrome                130.0.6723   env        /usr/bin/chromium-browser
 √  curl                  8.10.1       apt        /usr/bin/curl
 √  git                   2.39.5       apt        /usr/bin/git
 √  postlight-parser      2.2.3        sys_npm    ~/.npm/bin/postlight-parser
 √  readability-extractor 0.0.11       lib_npm    ~/.npm/bin/readability-extractor
 √  single-file           1.1.54       lib_npm    ~/.npm/bin/single-file
 √  wget                  1.21.3       apt        /usr/bin/wget
 √  yt-dlp                2024.10.22   sys_pip    /usr/local/bin/yt-dlp
 √  ffmpeg                5.1.6        env        /usr/bin/ffmpeg

 Package Managers:
 √  env         /usr/bin/which                                       UID=1000 P…
 √  apt         /usr/bin/apt-get                                     UID=0    P…
 -  brew        not available                                        UID=1000 P…
 √  sys_pip     /usr/local/bin/pip                                   UID=1000 P…
 -  venv_pip    not available                                        UID=1000 P…
 -  lib_pip     not available                                        UID=1000 P…
 √  sys_npm     /usr/bin/npm                                         UID=1000 P…
 -  lib_npm     /usr/bin/npm                                         UID=1000 P…
 √  playwright  /usr/local/bin/playwright                            UID=0    P…
 √  puppeteer   /usr/bin/npx                                         UID=1000 P…

 Code locations:
 √  PACKAGE_DIR           39 files        valid     /app/archivebox             
 √  TEMPLATES_DIR         4 files         valid     /app/archivebox/templates   
 -  CUSTOM_TEMPLATES_DIR  missing         unused    ./user_templates            
 -  USER_PLUGINS_DIR      missing         unused    ./user_plugins              
 √  LIB_DIR               1 files         valid     /usr/share/archivebox/lib   

 Data locations:
 √  DATA_DIR              16 files @      valid     /data                       
 √  CONFIG_FILE           139.0 Bytes     valid     ./ArchiveBox.conf           
 √  SQL_INDEX             8.3 MB          valid     ./index.sqlite3             
 √  QUEUE_DATABASE        92.0 KB         valid     ./queue.sqlite3             
 √  ARCHIVE_DIR           366 files       valid     ./archive                   
 √  SOURCES_DIR           9 files         valid     ./sources                   
 √  PERSONAS_DIR          1 files         valid     ./personas                  
 √  LOGS_DIR              5 files         valid     ./logs                      
 √  TMP_DIR               4 files         valid     /tmp/archivebox

How did you install the version of ArchiveBox you are using?

Docker (or Podman/LXC/K8s/TrueNAS/Proxmox/etc)

What operating system are you running on?

Linux (Ubuntu/Debian/Arch/Alpine/etc.)

What type of drive are you using to store your ArchiveBox data?

  • some of data/ is on a local SSD or NVMe drive
  • some of data/ is on a spinning hard drive or external USB drive
  • some of data/ is on a network mount (e.g. NFS/SMB/Ceph/GlusterFS/etc.)
  • some of data/ is on a FUSE mount (e.g. SSHFS/RClone/S3/B2/Google Drive/Dropbox/etc.)

Docker Compose Configuration


ArchiveBox Configuration


Originally created by @blastrock on GitHub (Jan 22, 2025). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1641 Originally assigned to: @pirate on GitHub. ### Provide a screenshot and describe the bug docker exec --user 1000 -i archivebox archivebox list --json ### Steps to reproduce ```markdown 1. Run `archivebox list --json` ``` ### Logs or errors ```shell ╭──────────────────────────────────────────────────────────────────────────────╮ │ [2025-01-22 20:44:37] ArchiveBox v0.8.5rc51: archivebox list --json │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ /usr/local/bin/archivebox:8 in <module> │ │ │ │ 6 if __name__ == '__main__': │ │ 7 │ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) │ │ ❱ 8 │ sys.exit(main()) │ │ 9 │ │ │ │ /app/archivebox/cli/__init__.py:258 in main │ │ │ │ 256 │ │ │ 257 │ try: │ │ ❱ 258 │ │ run_subcommand( │ │ 259 │ │ │ subcommand=command.subcommand, │ │ 260 │ │ │ subcommand_args=command.subcommand_args, │ │ │ │ /app/archivebox/cli/__init__.py:184 in run_subcommand │ │ │ │ 182 │ │ │ 183 │ module = import_module('.archivebox_{}'.format(subcommand), __pack │ │ ❱ 184 │ module.main(args=subcommand_args, stdin=stdin, pwd=pwd) # type: │ │ 185 │ │ │ 186 │ # wait for webhooks, signals, and other background jobs to finish │ │ │ │ /app/archivebox/cli/archivebox_list.py:123 in main │ │ │ │ 121 │ │ raise SystemExit(2) │ │ 122 │ │ │ ❱ 123 │ matching_folders = list_all( │ │ 124 │ │ filter_patterns=command.filter_patterns, │ │ 125 │ │ filter_type=command.filter_type, │ │ │ │ /app/archivebox/misc/util.py:163 in typechecked_function │ │ │ │ 161 │ │ │ check_argument_type(arg_key, arg_val) │ │ 162 │ │ │ │ ❱ 163 │ │ return func(*args, **kwargs) │ │ 164 │ │ │ 165 │ return typechecked_function │ │ │ │ /app/archivebox/main.py:975 in list_all │ │ │ │ 973 │ │ │ 974 │ if json: │ │ ❱ 975 │ │ output = generate_json_index_from_links(folders.values(), wit │ │ 976 │ elif html: │ │ 977 │ │ output = generate_index_from_links(folders.values(), with_hea │ │ │ │ /app/archivebox/misc/util.py:163 in typechecked_function │ │ │ │ 161 │ │ │ check_argument_type(arg_key, arg_val) │ │ 162 │ │ │ │ ❱ 163 │ │ return func(*args, **kwargs) │ │ 164 │ │ │ 165 │ return typechecked_function │ │ │ │ │ │ /app/archivebox/index/json.py:36 in generate_json_index_from_links │ │ │ │ 34 │ │ │ 'source': 'https://github.com/ArchiveBox/ArchiveBox', │ │ 35 │ │ │ 'issues': 'https://github.com/ArchiveBox/ArchiveBox/issues │ │ ❱ 36 │ │ │ 'dependencies': settings.BINARIES.to_dict(), │ │ 37 │ │ }, │ │ 38 │ } │ │ │ │ /usr/local/lib/python3.11/site-packages/benedict/dicts/keyattr/keyattr_dict. │ │ py:39 in __getattr__ │ │ │ │ 37 │ │ │ │ raise AttributeError(attr_message) from None │ │ 38 │ │ │ if not self._keyattr_dynamic: │ │ ❱ 39 │ │ │ │ raise AttributeError(attr_message) from None │ │ 40 │ │ │ self.__setitem__(attr, {}) │ │ 41 │ │ │ return self.__getitem__(attr) │ │ │ ╰──────────────────────────────────────────────────────────────────────────────╯ AttributeError: 'benedict' object has no attribute 'to_dict' ``` ### ArchiveBox Version ```shell 0.8.5rc51 ArchiveBox v0.8.5rc51 COMMIT_HASH=63bf902 BUILD_TIME=2024-10-24 06:32:16 1729751536 IN_DOCKER=True IN_QEMU=False ARCH=x86_64 OS=Linux PLATFORM=Linux-6.8.0-51-generic-x86_64-with-glibc2.36 PYTHON=Cpython EUID=1000:1000 UID=1000:1000 PUID=1000:1000 FS_UID=1000:1000 FS_PERMS=644 FS_ATOMIC=True FS_REMOTE=True DEBUG=False IS_TTY=False SUDO=False ID=723cdf77:b55d28cf SEARCH_BACKEND=ripgrep LDAP=False Binary Dependencies: √ python 3.11.10 sys_pip /usr/local/bin/python3.11 √ django 5.1.2 sys_pip /usr/local/lib/python3.11/site-packages/django/__init__.py √ sqlite 2.6.0 sys_pip /usr/local/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py √ pip 24.0.0 sys_pip /usr/local/bin/pip √ pipx 1.1.0 sys_pip /bin/pipx √ node 22.10.0 apt /usr/bin/node √ npm 10.9.0 apt /usr/bin/npm √ npx 10.9.0 apt /usr/bin/npx √ playwright 1.48.0 sys_pip /usr/local/bin/playwright √ puppeteer 23.6.0 lib_npm ~/.npm/bin/puppeteer √ ldap 3.4.4 sys_pip /usr/local/lib/python3.11/site-packages/ldap/__init__.py √ rg 13.0.0 apt /usr/bin/rg √ sonic 1.4.9 env /usr/local/bin/sonic √ chrome 130.0.6723 env /usr/bin/chromium-browser √ curl 8.10.1 apt /usr/bin/curl √ git 2.39.5 apt /usr/bin/git √ postlight-parser 2.2.3 sys_npm ~/.npm/bin/postlight-parser √ readability-extractor 0.0.11 lib_npm ~/.npm/bin/readability-extractor √ single-file 1.1.54 lib_npm ~/.npm/bin/single-file √ wget 1.21.3 apt /usr/bin/wget √ yt-dlp 2024.10.22 sys_pip /usr/local/bin/yt-dlp √ ffmpeg 5.1.6 env /usr/bin/ffmpeg Package Managers: √ env /usr/bin/which UID=1000 P… √ apt /usr/bin/apt-get UID=0 P… - brew not available UID=1000 P… √ sys_pip /usr/local/bin/pip UID=1000 P… - venv_pip not available UID=1000 P… - lib_pip not available UID=1000 P… √ sys_npm /usr/bin/npm UID=1000 P… - lib_npm /usr/bin/npm UID=1000 P… √ playwright /usr/local/bin/playwright UID=0 P… √ puppeteer /usr/bin/npx UID=1000 P… Code locations: √ PACKAGE_DIR 39 files valid /app/archivebox √ TEMPLATES_DIR 4 files valid /app/archivebox/templates - CUSTOM_TEMPLATES_DIR missing unused ./user_templates - USER_PLUGINS_DIR missing unused ./user_plugins √ LIB_DIR 1 files valid /usr/share/archivebox/lib Data locations: √ DATA_DIR 16 files @ valid /data √ CONFIG_FILE 139.0 Bytes valid ./ArchiveBox.conf √ SQL_INDEX 8.3 MB valid ./index.sqlite3 √ QUEUE_DATABASE 92.0 KB valid ./queue.sqlite3 √ ARCHIVE_DIR 366 files valid ./archive √ SOURCES_DIR 9 files valid ./sources √ PERSONAS_DIR 1 files valid ./personas √ LOGS_DIR 5 files valid ./logs √ TMP_DIR 4 files valid /tmp/archivebox ``` ### How did you install the version of ArchiveBox you are using? Docker (or Podman/LXC/K8s/TrueNAS/Proxmox/etc) ### What operating system are you running on? Linux (Ubuntu/Debian/Arch/Alpine/etc.) ### What type of drive are you using to store your ArchiveBox data? - [ ] some of `data/` is on a local SSD or NVMe drive - [x] some of `data/` is on a spinning hard drive or external USB drive - [ ] some of `data/` is on a network mount (e.g. NFS/SMB/Ceph/GlusterFS/etc.) - [ ] some of `data/` is on a FUSE mount (e.g. SSHFS/RClone/S3/B2/Google Drive/Dropbox/etc.) ### Docker Compose Configuration ```shell ``` ### ArchiveBox Configuration ```shell ```
Author
Owner

@pirate commented on GitHub (Jan 22, 2025):

yeeeup, it's going to look a little different in v0.8.6 because I'm changing the JSON output schema.

Not finished migrating it though, so you hit a rough unfinished edge of the prereleases.

Will keep this open to track when it's fixed in v0.9.0.

<!-- gh-comment-id:2608285417 --> @pirate commented on GitHub (Jan 22, 2025): yeeeup, it's going to look a little different in v0.8.6 because I'm changing the JSON output schema. Not finished migrating it though, so you hit a rough unfinished edge of the prereleases. Will keep this open to track when it's fixed in v0.9.0.
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#2493
No description provided.