[GH-ISSUE #943] Question: Trouble Running add from docker-compose command #583

Closed
opened 2026-03-01 14:44:45 +03:00 by kerem · 3 comments
Owner

Originally created by @stephenmetzger on GitHub (Mar 11, 2022).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/943

Hi all.

Trying to run docker-compose run archivebox add 'http://google.com' and getting the error:

Creating archivebox_archivebox_run ... done
[i] [2022-03-11 04:59:59] ArchiveBox v0.6.2: archivebox add http://google.com --rm
    > /data

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 82, in _execute
    return self.cursor.execute(sql)
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 411, in execute
    return Database.Cursor.execute(self, query)
sqlite3.OperationalError: disk I/O error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/archivebox", line 33, in <module>
    sys.exit(load_entry_point('archivebox', 'console_scripts', 'archivebox')())
  File "/app/archivebox/cli/__init__.py", line 140, in main
    run_subcommand(
  File "/app/archivebox/cli/__init__.py", line 74, in run_subcommand
    setup_django(in_memory_db=subcommand in fake_db, check_db=cmd_requires_db and not init_pending)
  File "/app/archivebox/config.py", line 1152, in setup_django
    current_mode = cursor.execute("PRAGMA journal_mode")
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 82, in _execute
    return self.cursor.execute(sql)
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 411, in execute
    return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: disk I/O error
ERROR: 1 

Not sure what I'm doing wrong here.

Originally created by @stephenmetzger on GitHub (Mar 11, 2022). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/943 Hi all. Trying to run `docker-compose run archivebox add 'http://google.com'` and getting the error: ```root@proxmoxdebian:/data/archivebox/data# docker-compose run archivebox add 'http://google.com' --rm Creating archivebox_archivebox_run ... done [i] [2022-03-11 04:59:59] ArchiveBox v0.6.2: archivebox add http://google.com --rm > /data Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 82, in _execute return self.cursor.execute(sql) File "/usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 411, in execute return Database.Cursor.execute(self, query) sqlite3.OperationalError: disk I/O error The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/bin/archivebox", line 33, in <module> sys.exit(load_entry_point('archivebox', 'console_scripts', 'archivebox')()) File "/app/archivebox/cli/__init__.py", line 140, in main run_subcommand( File "/app/archivebox/cli/__init__.py", line 74, in run_subcommand setup_django(in_memory_db=subcommand in fake_db, check_db=cmd_requires_db and not init_pending) File "/app/archivebox/config.py", line 1152, in setup_django current_mode = cursor.execute("PRAGMA journal_mode") File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers return executor(sql, params, many, context) File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 82, in _execute return self.cursor.execute(sql) File "/usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 411, in execute return Database.Cursor.execute(self, query) django.db.utils.OperationalError: disk I/O error ERROR: 1 ``` Not sure what I'm doing wrong here.
kerem closed this issue 2026-03-01 14:44:46 +03:00
Author
Owner

@pirate commented on GitHub (Mar 13, 2022):

It's an issue with your filesystem. Either the data/ folder is on a failing drive, it's not writable due to permissions, it's a broken symlink, or some other problem outside of ArchiveBox's control.

<!-- gh-comment-id:1066028482 --> @pirate commented on GitHub (Mar 13, 2022): It's an issue with your filesystem. Either the `data/` folder is on a failing drive, it's not writable due to permissions, it's a broken symlink, or some other problem outside of ArchiveBox's control.
Author
Owner

@stephenmetzger commented on GitHub (Mar 16, 2022):

It's an issue with your filesystem. Either the data/ folder is on a failing drive, it's not writable due to permissions, it's a broken symlink, or some other problem outside of ArchiveBox's control.

You are exactly right. Was running low on disk space. Freeing up space solved the problem. Thanks.

This actually brings me to another question now:

How would I set up my docker-compose.yml to use a bind mount for the appdata (ArchiveBox.conf, index.sqlite3, logs, etc) on my hosts local storage, but link the archive folder to a samba share mounted to the ArchiveBox host? Under the archivebox service, would adding a link to /mnt/SAMBAstorage/archivebox/archive from /data/archive work, or, since archive is a subdirectory of data, would this cause issues?

        # build: .                              # for developers working on archivebox
        image: ${DOCKER_IMAGE:-archivebox/archivebox:master}
        command: server --quick-init 0.0.0.0:8000
        ports:
            - 8000:8000
        environment:
            - ALLOWED_HOSTS=*                   # add any config options you want as env vars
            - MEDIA_MAX_SIZE=750m
            # - SEARCH_BACKEND_ENGINE=sonic     # uncomment these if you enable sonic below
            # - SEARCH_BACKEND_HOST_NAME=sonic
            # - SEARCH_BACKEND_PASSWORD=SecretPassword
        volumes:
            - /user/docker/archivebox/data:/data
            - /mnt/SAMBAstorage/archivebox/archive:/data/archive

Edit: Okay, found the relevant option to set in ArchiveBox.conf. But, now I'm getting the error:

   PermissionError: [Errno 13] Permission denied: '/mnt/archivebox/archive/index.sqlite3'
   Check your config for mistakes and try again (your archive data is unaffected).
   For config documentation and examples see:
   https://github.com/ArchiveBox/ArchiveBox/wiki/Configuration

Does Archivebox running in docker (UID/GIDnot specified in docker compose) run as archivebox, root, or something else? What is the recommended way to set permissions? Add the docker user to the /mnt/archivebox directory? Specify users in the docker-compose.yml that already have permissions? Something else?

Another Edit: Not sure if this is the best solution, but I modified by fstab entry to mount the share as 1000:1000, verified correct ownership and permissions, and added the environmental variables PUID=1000 and PGID=1000 to my docker-compose.yml. This seems to have done the trick.

<!-- gh-comment-id:1069132364 --> @stephenmetzger commented on GitHub (Mar 16, 2022): > It's an issue with your filesystem. Either the `data/` folder is on a failing drive, it's not writable due to permissions, it's a broken symlink, or some other problem outside of ArchiveBox's control. You are exactly right. Was running low on disk space. Freeing up space solved the problem. Thanks. This actually brings me to another question now: How would I set up my docker-compose.yml to use a bind mount for the appdata (ArchiveBox.conf, index.sqlite3, logs, etc) on my hosts local storage, but link the archive folder to a samba share mounted to the ArchiveBox host? Under the archivebox service, would adding a link to `/mnt/SAMBAstorage/archivebox/archive` from `/data/archive` work, or, since archive is a subdirectory of data, would this cause issues? ``` archivebox: # build: . # for developers working on archivebox image: ${DOCKER_IMAGE:-archivebox/archivebox:master} command: server --quick-init 0.0.0.0:8000 ports: - 8000:8000 environment: - ALLOWED_HOSTS=* # add any config options you want as env vars - MEDIA_MAX_SIZE=750m # - SEARCH_BACKEND_ENGINE=sonic # uncomment these if you enable sonic below # - SEARCH_BACKEND_HOST_NAME=sonic # - SEARCH_BACKEND_PASSWORD=SecretPassword volumes: - /user/docker/archivebox/data:/data - /mnt/SAMBAstorage/archivebox/archive:/data/archive ``` Edit: Okay, found the relevant option to set in ArchiveBox.conf. But, now I'm getting the error: ```[X] Error while loading configuration value: DATA_LOCATIONS PermissionError: [Errno 13] Permission denied: '/mnt/archivebox/archive/index.sqlite3' Check your config for mistakes and try again (your archive data is unaffected). For config documentation and examples see: https://github.com/ArchiveBox/ArchiveBox/wiki/Configuration ``` Does Archivebox running in docker (UID/GIDnot specified in docker compose) run as `archivebox`, `root`, or something else? What is the recommended way to set permissions? Add the docker user to the /mnt/archivebox directory? Specify users in the docker-compose.yml that already have permissions? Something else? Another Edit: Not sure if this is the best solution, but I modified by fstab entry to mount the share as 1000:1000, verified correct ownership and permissions, and added the environmental variables `PUID=1000` and `PGID=1000` to my docker-compose.yml. This seems to have done the trick.
Author
Owner

@stephenmetzger commented on GitHub (Mar 16, 2022):

Whelp. My fix above isn't working out. Going to close this thread since it solved by initial problem and start a new one with this new issue.

Thanks.

<!-- gh-comment-id:1069441484 --> @stephenmetzger commented on GitHub (Mar 16, 2022): Whelp. My fix above isn't working out. Going to close this thread since it solved by initial problem and start a new one with this new issue. Thanks.
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#583
No description provided.