[GH-ISSUE #1284] Question: Permission denied when placing archive subfolder onto CIFS share #3809

Closed
opened 2026-03-15 00:32:04 +03:00 by kerem · 4 comments
Owner

Originally created by @NanoBaker on GitHub (Dec 13, 2023).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1284

Hello, I've been trying for a while to get this to work but I am unsure what is going wrong. I have my data folder mounted locally on my machine and my archive subfolder mounted onto a remote CIFS share on my NAS. Initializing it works just fine, and I can access the web GUI, but whenever I attempt to download anything it gives this permission denied error:

[*] [2023-12-13 16:00:34] Archiving 1/1 URLs from added set...
archivebox_1  | Internal Server Error: /add/
archivebox_1  | Traceback (most recent call last):
archivebox_1  |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 47, in inner
archivebox_1  |     response = get_response(request)
archivebox_1  |                ^^^^^^^^^^^^^^^^^^^^^
archivebox_1  |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 181, in _get_response
archivebox_1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
archivebox_1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox_1  |   File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 70, in view
archivebox_1  |     return self.dispatch(request, *args, **kwargs)
archivebox_1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox_1  |   File "/usr/local/lib/python3.11/site-packages/django/utils/decorators.py", line 43, in _wrapper
archivebox_1  |     return bound_method(*args, **kwargs)
archivebox_1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox_1  |   File "/usr/local/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
archivebox_1  |     return view_func(*args, **kwargs)
archivebox_1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox_1  |   File "/usr/local/lib/python3.11/site-packages/django/contrib/auth/mixins.py", line 109, in dispatch
archivebox_1  |     return super().dispatch(request, *args, **kwargs)
archivebox_1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox_1  |   File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 98, in dispatch
archivebox_1  |     return handler(request, *args, **kwargs)
archivebox_1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox_1  |   File "/usr/local/lib/python3.11/site-packages/django/views/generic/edit.py", line 142, in post
archivebox_1  |     return self.form_valid(form)
archivebox_1  |            ^^^^^^^^^^^^^^^^^^^^^
archivebox_1  |   File "/app/archivebox/core/views.py", line 288, in form_valid
archivebox_1  |     add(**input_kwargs)
archivebox_1  |   File "/app/archivebox/util.py", line 116, in typechecked_function
archivebox_1  |     return func(*args, **kwargs)
archivebox_1  |            ^^^^^^^^^^^^^^^^^^^^^
archivebox_1  |   File "/app/archivebox/main.py", line 667, in add
archivebox_1  |     archive_links(new_links, overwrite=False, **archive_kwargs)
archivebox_1  |   File "/app/archivebox/util.py", line 116, in typechecked_function
archivebox_1  |     return func(*args, **kwargs)
archivebox_1  |            ^^^^^^^^^^^^^^^^^^^^^
archivebox_1  |   File "/app/archivebox/extractors/__init__.py", line 236, in archive_links
archivebox_1  |     archive_link(to_archive, overwrite=overwrite, methods=methods, out_dir=Path(link.link_dir))
archivebox_1  |   File "/app/archivebox/util.py", line 116, in typechecked_function
archivebox_1  |     return func(*args, **kwargs)
archivebox_1  |            ^^^^^^^^^^^^^^^^^^^^^
archivebox_1  |   File "/app/archivebox/extractors/__init__.py", line 130, in archive_link
archivebox_1  |     os.makedirs(out_dir)
archivebox_1  |   File "<frozen os>", line 225, in makedirs
archivebox_1  | PermissionError: [Errno 13] Permission denied: '/data/archive/1702483234.440642'
archivebox_1  | "POST /add/ HTTP/1.1" 500 145`

On the server, I already set the access level for that share to 777, but checking it from archive-box gives a different response:
(Server side)

total 8
drwxrwsrwx 2 Arr_Suite users 4096 Dec 13 11:12 .
drwxrwsrwx 3 root      users 4096 Dec 13 10:47 ..

(Archive-box)

total 4.0K
drwxr-xr-x 2       1000 users         0 Dec 13 16:12 .
drwxr-xr-x 5 archivebox archivebox 4.0K Dec 13 16:00 ..

I am not the most experienced with docker, and I am unsure what is going wrong here. If it helps, here are the relevant pieces of my docker-compose:

services:
    archivebox:
        image: ${DOCKER_IMAGE:-archivebox/archivebox:dev}
        command: server --quick-init 0.0.0.0:8000
        ports:
            - 8000:8000
        volumes:
            - ./data:/data
            - archivebox-archive:/data/archive:z
volumes:
  archivebox-archive:
    driver: local
    driver_opts:
      type: cifs
      device: //192.168.1.66/Web_Archives/ArchiveBox
      o: "username=Arr_Suite,password=[removed],vers=3.0,uid=1000,gid=100"

Any suggestions or recommended changes?

Originally created by @NanoBaker on GitHub (Dec 13, 2023). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1284 Hello, I've been trying for a while to get this to work but I am unsure what is going wrong. I have my data folder mounted locally on my machine and my archive subfolder mounted onto a remote CIFS share on my NAS. Initializing it works just fine, and I can access the web GUI, but whenever I attempt to download anything it gives this permission denied error: ``` [*] [2023-12-13 16:00:34] Archiving 1/1 URLs from added set... archivebox_1 | Internal Server Error: /add/ archivebox_1 | Traceback (most recent call last): archivebox_1 | File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 47, in inner archivebox_1 | response = get_response(request) archivebox_1 | ^^^^^^^^^^^^^^^^^^^^^ archivebox_1 | File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 181, in _get_response archivebox_1 | response = wrapped_callback(request, *callback_args, **callback_kwargs) archivebox_1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox_1 | File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 70, in view archivebox_1 | return self.dispatch(request, *args, **kwargs) archivebox_1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox_1 | File "/usr/local/lib/python3.11/site-packages/django/utils/decorators.py", line 43, in _wrapper archivebox_1 | return bound_method(*args, **kwargs) archivebox_1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox_1 | File "/usr/local/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view archivebox_1 | return view_func(*args, **kwargs) archivebox_1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox_1 | File "/usr/local/lib/python3.11/site-packages/django/contrib/auth/mixins.py", line 109, in dispatch archivebox_1 | return super().dispatch(request, *args, **kwargs) archivebox_1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox_1 | File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 98, in dispatch archivebox_1 | return handler(request, *args, **kwargs) archivebox_1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox_1 | File "/usr/local/lib/python3.11/site-packages/django/views/generic/edit.py", line 142, in post archivebox_1 | return self.form_valid(form) archivebox_1 | ^^^^^^^^^^^^^^^^^^^^^ archivebox_1 | File "/app/archivebox/core/views.py", line 288, in form_valid archivebox_1 | add(**input_kwargs) archivebox_1 | File "/app/archivebox/util.py", line 116, in typechecked_function archivebox_1 | return func(*args, **kwargs) archivebox_1 | ^^^^^^^^^^^^^^^^^^^^^ archivebox_1 | File "/app/archivebox/main.py", line 667, in add archivebox_1 | archive_links(new_links, overwrite=False, **archive_kwargs) archivebox_1 | File "/app/archivebox/util.py", line 116, in typechecked_function archivebox_1 | return func(*args, **kwargs) archivebox_1 | ^^^^^^^^^^^^^^^^^^^^^ archivebox_1 | File "/app/archivebox/extractors/__init__.py", line 236, in archive_links archivebox_1 | archive_link(to_archive, overwrite=overwrite, methods=methods, out_dir=Path(link.link_dir)) archivebox_1 | File "/app/archivebox/util.py", line 116, in typechecked_function archivebox_1 | return func(*args, **kwargs) archivebox_1 | ^^^^^^^^^^^^^^^^^^^^^ archivebox_1 | File "/app/archivebox/extractors/__init__.py", line 130, in archive_link archivebox_1 | os.makedirs(out_dir) archivebox_1 | File "<frozen os>", line 225, in makedirs archivebox_1 | PermissionError: [Errno 13] Permission denied: '/data/archive/1702483234.440642' archivebox_1 | "POST /add/ HTTP/1.1" 500 145` ``` On the server, I already set the access level for that share to 777, but checking it from archive-box gives a different response: (Server side) ``` total 8 drwxrwsrwx 2 Arr_Suite users 4096 Dec 13 11:12 . drwxrwsrwx 3 root users 4096 Dec 13 10:47 .. ``` (Archive-box) ``` total 4.0K drwxr-xr-x 2 1000 users 0 Dec 13 16:12 . drwxr-xr-x 5 archivebox archivebox 4.0K Dec 13 16:00 .. ``` I am not the most experienced with docker, and I am unsure what is going wrong here. If it helps, here are the relevant pieces of my docker-compose: ``` services: archivebox: image: ${DOCKER_IMAGE:-archivebox/archivebox:dev} command: server --quick-init 0.0.0.0:8000 ports: - 8000:8000 volumes: - ./data:/data - archivebox-archive:/data/archive:z volumes: archivebox-archive: driver: local driver_opts: type: cifs device: //192.168.1.66/Web_Archives/ArchiveBox o: "username=Arr_Suite,password=[removed],vers=3.0,uid=1000,gid=100" ``` Any suggestions or recommended changes?
kerem closed this issue 2026-03-15 00:32:09 +03:00
Author
Owner

@pirate commented on GitHub (Dec 13, 2023):

Can you try using uid=901 and gid=901 for your CIFS mount, those are the defaults that archivebox uses

Also mount the volume with :rw, :z mode sometimes causes weird permissions issues.

<!-- gh-comment-id:1854386292 --> @pirate commented on GitHub (Dec 13, 2023): Can you try using uid=901 and gid=901 for your CIFS mount, those are the defaults that archivebox uses Also mount the volume with `:rw`, `:z` mode sometimes causes weird permissions issues.
Author
Owner

@NanoBaker commented on GitHub (Dec 13, 2023):

That doesn't seem to work, as it gives the same error as before.

<!-- gh-comment-id:1854411815 --> @NanoBaker commented on GitHub (Dec 13, 2023): That doesn't seem to work, as it gives the same error as before.
Author
Owner

@pirate commented on GitHub (Dec 14, 2023):

Sorry I made a mistake above try 911 not 901 for uid and gid.

If that doesn't work I'll investigate further and push a fix when I'm back from travel next week.

<!-- gh-comment-id:1856129635 --> @pirate commented on GitHub (Dec 14, 2023): Sorry I made a mistake above try 911 not 901 for uid and gid. If that doesn't work I'll investigate further and push a fix when I'm back from travel next week.
Author
Owner

@NanoBaker commented on GitHub (Dec 14, 2023):

Sorry I made a mistake above try 911 not 901 for uid and gid.

If that doesn't work I'll investigate further and push a fix when I'm back from travel next week.

That worked for me, thanks!

<!-- gh-comment-id:1856139627 --> @NanoBaker commented on GitHub (Dec 14, 2023): > Sorry I made a mistake above try 911 not 901 for uid and gid. > > If that doesn't work I'll investigate further and push a fix when I'm back from travel next week. That worked for me, 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#3809
No description provided.