Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PermissionError: Permission denied when writing the file #1949

Open
valarietan opened this issue Nov 30, 2023 · 7 comments
Open

PermissionError: Permission denied when writing the file #1949

valarietan opened this issue Nov 30, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@valarietan
Copy link

Hi there, newbie here. Please, may I get your advice on how to resolve this?

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/Users/valarietan/sherlock/sherlock/main.py", line 22, in
sherlock.main()
File "/Users/valarietan/sherlock/sherlock/sherlock.py", line 697, in main
with open(result_file, "w", encoding="utf-8") as file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied

Saw this reported in 2020 and tried what was provided in the comments. But not successful.

Thank you.

@Pasanlaksitha
Copy link

Pasanlaksitha commented Dec 1, 2023

In Microsoft Windows, disable controlled folder access. or add Python to the list of permitted programs in Microsoft Windows for controlled folder access. I believe that is your problem. try it

@![image](https://github.com/sherlock-project/sherlock/assets/29460924/bad52d07-7430-47f1-b60e-296c9ee7eb35
Screenshot 2023-12-01 170758

@sugo512
Copy link

sugo512 commented Dec 1, 2023

I have the same error, but I'm running under Windows with Vmware and Kali. Controlled folder access is off.

@Pasanlaksitha
Copy link

I have the same error, but I'm running under Windows with Vmware and Kali. Controlled folder access is off.

what is your prompt and used arguments to Sherlock?

and also here are a few things you can check or try to resolve this issue:

File/Directory Permissions:

Make sure that the directory where the script is trying to create the file has the appropriate write permissions for the user running the script.

Run as Administrator/Superuser:

If you're on a Unix-like system (Linux ), try running the script with elevated privileges using sudo.

Specify a Different Output Directory:

If the current directory doesn't have the necessary write permissions, you can try specifying a different directory or providing a complete path where the script has permission to write.

@sugo512
Copy link

sugo512 commented Dec 2, 2023

That did it. I installed with sudo, so the Sherlock dir I was in was root root.

Thanks

@matheusfelipeog
Copy link
Collaborator

Thank you, @Pasanlaksitha, for the helpful instructions to solve the problem.

Did the above instructions work for you as well, @valarietan?

@matheusfelipeog matheusfelipeog added the bug Something isn't working label Dec 3, 2023
@matheusfelipeog matheusfelipeog changed the title Please help: PermissionError [Errno 13] PermissionError: Permission denied when writing the file Dec 3, 2023
@valarietan
Copy link
Author

Hi @Pasanlaksitha

Thank you for the advice. But I'm not able to follow the instructions as I'm on Macbook Air. I used sudo to install as well.
Will appreciate if you can advise how to change the permission?

Thank you.

@matheusfelipeog
Copy link
Collaborator

@valarietan, can you show the permissions you currently have in the directory and files of the cloned sherlock project?

Navigate to the base directory of sherlock and the sherlock package directory and use this command in both directories:

ls -l

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants