[GH-ISSUE #1552] Bug: v0.7.1 on alpine linux OSError: crontab: can't open 'archivebox': No such file or directory #3943

Closed
opened 2026-03-15 01:03:58 +03:00 by kerem · 3 comments
Owner

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

Describe the bug

archivebox schedule --show results in a stacktrace.

Steps to reproduce

(venv) $ archivebox schedule --show
[i] [2024-10-19 11:39:57] ArchiveBox v0.7.1: archivebox schedule --show
    > /media/nfs/archives

Traceback (most recent call last):
  File "/home/archivebox/venv/bin/archivebox", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/archivebox/cli/__init__.py", line 140, in main
    run_subcommand(
  File "/home/archivebox/venv/lib/python3.12/site-packages/archivebox/cli/__init__.py", line 80, in run_subcommand
    module.main(args=subcommand_args, stdin=stdin, pwd=pwd)    # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/archivebox/cli/archivebox_schedule.py", line 92, in main
    schedule(
  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/main.py", line 1169, in schedule
    cron = CronTab(user=True)
           ^^^^^^^^^^^^^^^^^^
  File "/home/archivebox/venv/lib/python3.12/site-packages/crontab.py", line 246, in __init__
    self.read(tabfile)
  File "/home/archivebox/venv/lib/python3.12/site-packages/crontab.py", line 314, in read
    raise IOError(f"Read crontab {self.user}: {process.stderr}")
OSError: Read crontab archivebox: crontab: can't open 'archivebox': No such file or directory

(venv) /media/nfs/archives $ 

Screenshots or log output

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/1552 #### Describe the bug `archivebox schedule --show` results in a stacktrace. #### Steps to reproduce ```console (venv) $ archivebox schedule --show [i] [2024-10-19 11:39:57] ArchiveBox v0.7.1: archivebox schedule --show > /media/nfs/archives Traceback (most recent call last): File "/home/archivebox/venv/bin/archivebox", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/archivebox/cli/__init__.py", line 140, in main run_subcommand( File "/home/archivebox/venv/lib/python3.12/site-packages/archivebox/cli/__init__.py", line 80, in run_subcommand module.main(args=subcommand_args, stdin=stdin, pwd=pwd) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/archivebox/cli/archivebox_schedule.py", line 92, in main schedule( 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/main.py", line 1169, in schedule cron = CronTab(user=True) ^^^^^^^^^^^^^^^^^^ File "/home/archivebox/venv/lib/python3.12/site-packages/crontab.py", line 246, in __init__ self.read(tabfile) File "/home/archivebox/venv/lib/python3.12/site-packages/crontab.py", line 314, in read raise IOError(f"Read crontab {self.user}: {process.stderr}") OSError: Read crontab archivebox: crontab: can't open 'archivebox': No such file or directory (venv) /media/nfs/archives $ ``` #### Screenshots or log output <!-- If applicable, post any relevant screenshots or copy/pasted terminal output from ArchiveBox. If you're reporting a parsing / importing error, **you must paste a copy of your redacted import file here**. --> #### 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.
kerem 2026-03-15 01:03:58 +03:00
Author
Owner

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

It seems you created an archivebox user to run it, but the user has no home folder / crontab folder, perhaps a quirk of alpine?

Can you try creating /etc/crontabs/archivebox manually?

<!-- gh-comment-id:2423969631 --> @pirate commented on GitHub (Oct 19, 2024): It seems you created an archivebox user to run it, but the user has no home folder / crontab folder, perhaps a quirk of alpine? Can you try creating `/etc/crontabs/archivebox` manually?
Author
Owner

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

Running crontab -e as the archivebox user fixed the issue, so it indeed seems that there was something wrong with the file creation.

<!-- gh-comment-id:2423979735 --> @jvoisin commented on GitHub (Oct 19, 2024): Running `crontab -e` as the `archivebox` user fixed the issue, so it indeed seems that there was something wrong with the file creation.
Author
Owner

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

I'm closing this as the v0.8.x and above scheduler doesn't use the system crontab at all, so this issue will go away anyway in future releases.

<!-- gh-comment-id:2427912675 --> @pirate commented on GitHub (Oct 21, 2024): I'm closing this as the v0.8.x and above scheduler doesn't use the system crontab at all, so this issue will go away anyway in future releases.
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#3943
No description provided.