question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: ... How to fix Permission denied: '/data'

See original GitHub issue

I’m following the setup instructions using docker-compose.

When I run docker-compose run archivebox init I get

[i] [2020-11-16 13:38:31] ArchiveBox v0.4.21: archivebox init
    > /data

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 123, in main
    run_subcommand(
  File "/app/archivebox/cli/__init__.py", line 63, in run_subcommand
    module.main(args=subcommand_args, stdin=stdin, pwd=pwd)    # type: ignore
  File "/app/archivebox/cli/archivebox_init.py", line 33, in main
    init(
  File "/app/archivebox/util.py", line 113, in typechecked_function
    return func(*args, **kwargs)
  File "/app/archivebox/main.py", line 259, in init
    is_empty = not len(set(os.listdir(out_dir)) - ALLOWED_IN_OUTPUT_DIR)
PermissionError: [Errno 13] Permission denied: '/data'

Please how can I fix this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:27 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
piratecommented, Nov 16, 2020

sudo chmod -R 777 data

2reactions
alanfranzcommented, Jan 18, 2021

I’m experiencing the same issue as @junpet on Ubuntu 18.04, latest docker-ce (20.10.2) and latest docker-compose.

I think that the underlying issue is that the docker entrypoint file https://github.com/ArchiveBox/ArchiveBox/blob/dev/bin/docker_entrypoint.sh tries to do some magic to drop privileges. But it probably gets something wrong and/or sharing the volumes between multiple containers does something bad to the permissions.

My workaround includes using POSIX ACLs, so you can retain access from the current user

id -u
docker run  -it archivebox/archivebox:latest /usr/bin/id -u

Annotate the two uids. They are 122 and 999 on my box, substitute as necessary.

mkdir data
setfacl -R -m u:122:rwx data
setfacl -d -m u:122:rwx data
setfacl -R -m u:999:rwx data
setfacl -d -m u:999:rwx data

Everything should work properly now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Permission denied in data folder under android - XDA Forums
Locate the folder of the app which you get permission denied prompt when pasting files or folders inside. Rename that folder to something ......
Read more >
How to fix permission denied error in python? - Stack Overflow
Use something in your Documents folder. The error message means you don't have write access to the root folder on the C: drive,...
Read more >
Python PermissionError: [errno 13] permission denied Solution
To fix this error, use the chmod or chown command to change the permissions of the file so that the right user and/or...
Read more >
"Access Denied" or other errors when you access or work with ...
Right-click the file or folder, and then click Properties. Click the Security tab. Under Group or user names, click your name to see...
Read more >
How to resolve the "Permission Denied" error in Linux
While using Linux, you may encounter the error, “permission denied”. This error occurs when the user does not have the privileges to make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found