[GH-ISSUE #1036] Bug: nohup not working #3670

Closed
opened 2026-03-14 23:58:32 +03:00 by kerem · 2 comments
Owner

Originally created by @green1052 on GitHub (Oct 13, 2022).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1036

Describe the bug

Steps to reproduce

nohup archivebox update --resume=1665638787.247505 &

Screenshots or log output

    > /home/ubuntu/archivebox

Traceback (most recent call last):
  File "/usr/local/bin/archivebox", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/archivebox/cli/__init__.py", line 140, in main
    run_subcommand(
  File "/usr/local/lib/python3.10/dist-packages/archivebox/cli/__init__.py", line 80, in run_subcommand
    module.main(args=subcommand_args, stdin=stdin, pwd=pwd)    # type: ignore
  File "/usr/local/lib/python3.10/dist-packages/archivebox/cli/archivebox_update.py", line 117, in main
    filter_patterns_str = accept_stdin(stdin)
  File "/usr/local/lib/python3.10/dist-packages/archivebox/logging_util.py", line 128, in accept_stdin
    stdin_str = stdin.read()
OSError: [Errno 9] Bad file descriptor
[1]+  Exit 1                  nohup archivebox update --resume=1665638787.247505

ArchiveBox version

ArchiveBox v0.6.2
Cpython Linux Linux-5.15.0-1019-oracle-aarch64-with-glibc2.35 aarch64
IN_DOCKER=False DEBUG=False IS_TTY=True TZ=UTC SEARCH_BACKEND_ENGINE=ripgrep

[i] Dependency versions:
 √  ARCHIVEBOX_BINARY     v0.6.2          valid     /usr/local/bin/archivebox   
 √  PYTHON_BINARY         v3.10.6         valid     /usr/bin/python3.10         
 √  DJANGO_BINARY         v3.1.14         valid     /usr/local/lib/python3.10/dist-packages/django/bin/django-admin.py
 √  CURL_BINARY           v7.81.0         valid     /usr/bin/curl               
 √  WGET_BINARY           v1.21.2         valid     /usr/bin/wget               
 √  NODE_BINARY           v12.22.9        valid     /usr/bin/node               
 √  SINGLEFILE_BINARY     v1.0.13         valid     ./node_modules/single-file/cli/single-file
 -  READABILITY_BINARY    -               disabled  ./node_modules/readability-extractor/readability-extractor
 -  MERCURY_BINARY        -               disabled  ./node_modules/@postlight/mercury-parser/cli.js
 -  GIT_BINARY            -               disabled  /usr/bin/git                
 √  YOUTUBEDL_BINARY      v2021.12.17     valid     /usr/local/bin/youtube-dl   
 √  CHROME_BINARY         v106.0.5249.91  valid     /usr/bin/chromium-browser   
 √  RIPGREP_BINARY        v13.0.0         valid     /usr/bin/rg                 

[i] Source-code locations:
 √  PACKAGE_DIR           23 files        valid     /usr/local/lib/python3.10/dist-packages/archivebox
 √  TEMPLATES_DIR         3 files         valid     /usr/local/lib/python3.10/dist-packages/archivebox/templates
 -  CUSTOM_TEMPLATES_DIR  -               disabled                              

[i] Secrets locations:
 √  CHROME_USER_DATA_DIR  32 files        valid     ./chrome-profile            
 -  COOKIES_FILE          -               disabled                              

[i] Data locations:
 √  OUTPUT_DIR            9 files         valid     /home/ubuntu/archivebox     
 √  SOURCES_DIR           3 files         valid     ./sources                   
 √  LOGS_DIR              1 files         valid     ./logs                      
 √  ARCHIVE_DIR           668 files       valid     ./archive                   
 √  CONFIG_FILE           685.0 Bytes     valid     ./ArchiveBox.conf           
 √  SQL_INDEX             24.7 MB         valid     ./index.sqlite3             


Originally created by @green1052 on GitHub (Oct 13, 2022). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1036 <!-- Please fill out the following information, feel free to delete sections if they're not applicable or if long issue templates annoy you. (the only required section is the version information) --> #### Describe the bug <!-- A description of what the bug is, what you expected to happen, and any relevant context about issue. --> #### Steps to reproduce <!-- For example: 1. Ran ArchiveBox with the following config '...' 2. Saw this output during archiving '....' 3. UI didn't show the thing I was expecting '....' --> ``` nohup archivebox update --resume=1665638787.247505 & ``` #### 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**. --> ``` > /home/ubuntu/archivebox Traceback (most recent call last): File "/usr/local/bin/archivebox", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.10/dist-packages/archivebox/cli/__init__.py", line 140, in main run_subcommand( File "/usr/local/lib/python3.10/dist-packages/archivebox/cli/__init__.py", line 80, in run_subcommand module.main(args=subcommand_args, stdin=stdin, pwd=pwd) # type: ignore File "/usr/local/lib/python3.10/dist-packages/archivebox/cli/archivebox_update.py", line 117, in main filter_patterns_str = accept_stdin(stdin) File "/usr/local/lib/python3.10/dist-packages/archivebox/logging_util.py", line 128, in accept_stdin stdin_str = stdin.read() OSError: [Errno 9] Bad file descriptor [1]+ Exit 1 nohup archivebox update --resume=1665638787.247505 ``` #### ArchiveBox version <!-- Run the `archivebox version` command locally then copy paste the result here: --> ```logs ArchiveBox v0.6.2 Cpython Linux Linux-5.15.0-1019-oracle-aarch64-with-glibc2.35 aarch64 IN_DOCKER=False DEBUG=False IS_TTY=True TZ=UTC SEARCH_BACKEND_ENGINE=ripgrep [i] Dependency versions: √ ARCHIVEBOX_BINARY v0.6.2 valid /usr/local/bin/archivebox √ PYTHON_BINARY v3.10.6 valid /usr/bin/python3.10 √ DJANGO_BINARY v3.1.14 valid /usr/local/lib/python3.10/dist-packages/django/bin/django-admin.py √ CURL_BINARY v7.81.0 valid /usr/bin/curl √ WGET_BINARY v1.21.2 valid /usr/bin/wget √ NODE_BINARY v12.22.9 valid /usr/bin/node √ SINGLEFILE_BINARY v1.0.13 valid ./node_modules/single-file/cli/single-file - READABILITY_BINARY - disabled ./node_modules/readability-extractor/readability-extractor - MERCURY_BINARY - disabled ./node_modules/@postlight/mercury-parser/cli.js - GIT_BINARY - disabled /usr/bin/git √ YOUTUBEDL_BINARY v2021.12.17 valid /usr/local/bin/youtube-dl √ CHROME_BINARY v106.0.5249.91 valid /usr/bin/chromium-browser √ RIPGREP_BINARY v13.0.0 valid /usr/bin/rg [i] Source-code locations: √ PACKAGE_DIR 23 files valid /usr/local/lib/python3.10/dist-packages/archivebox √ TEMPLATES_DIR 3 files valid /usr/local/lib/python3.10/dist-packages/archivebox/templates - CUSTOM_TEMPLATES_DIR - disabled [i] Secrets locations: √ CHROME_USER_DATA_DIR 32 files valid ./chrome-profile - COOKIES_FILE - disabled [i] Data locations: √ OUTPUT_DIR 9 files valid /home/ubuntu/archivebox √ SOURCES_DIR 3 files valid ./sources √ LOGS_DIR 1 files valid ./logs √ ARCHIVE_DIR 668 files valid ./archive √ CONFIG_FILE 685.0 Bytes valid ./ArchiveBox.conf √ SQL_INDEX 24.7 MB valid ./index.sqlite3 ``` <!-- Tickets without full version info will closed until it is provided, we need the full output here to help you solve your issue -->
Author
Owner

@pirate commented on GitHub (Oct 26, 2022):

Interesting edge case, haven't seen this before. Can probably just wrap stdin_str = stdin.read() in a try: ... except OSError: and ignore it for this case.

<!-- gh-comment-id:1292654396 --> @pirate commented on GitHub (Oct 26, 2022): Interesting edge case, haven't seen this before. Can probably just wrap `stdin_str = stdin.read()` in a `try: ... except OSError:` and ignore it for this case.
Author
Owner

@yadayada commented on GitHub (Dec 29, 2022):

One can run
nohup archivebox < /dev/null &

<!-- gh-comment-id:1367380563 --> @yadayada commented on GitHub (Dec 29, 2022): One can run `nohup archivebox < /dev/null &`
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#3670
No description provided.