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: [Errno 13] Permission denied: '../logs' #1328

Closed
mahmoudrabie opened this issue Apr 14, 2023 · 15 comments
Closed

PermissionError: [Errno 13] Permission denied: '../logs' #1328

mahmoudrabie opened this issue Apr 14, 2023 · 15 comments

Comments

@mahmoudrabie
Copy link

mahmoudrabie commented Apr 14, 2023

Dear Auto-GPT Team,

When I tried to run the following command
python scripts/main.py --debug

I got the following error

Traceback (most recent call last):
File "scripts/main.py", line 3, in
import commands as cmd
File "/workspaces/Auto-GPT/scripts/commands.py", line 3, in
from memory import get_memory
File "/workspaces/Auto-GPT/scripts/memory/init.py", line 9, in
from memory.redismem import RedisMemory
File "/workspaces/Auto-GPT/scripts/memory/redismem.py", line 10, in
from logger import logger
File "/workspaces/Auto-GPT/scripts/logger.py", line 192, in
logger = Logger()
File "/workspaces/Auto-GPT/scripts/config.py", line 20, in call
cls._instances[cls] = super(
File "/workspaces/Auto-GPT/scripts/logger.py", line 29, in init
os.makedirs(log_dir)
File "/usr/local/lib/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '../logs'

I would appreciate your help

Kind regards
Mahmoud

@ronneldavis
Copy link

I'm facing the same error when running it on a dev container in vscode. It's running on a Macbook Pro with M1 if it helps

@yglory
Copy link

yglory commented Apr 14, 2023

same experience.
I'm using Dev Container on Windows.

@mahmoudrabie
Copy link
Author

I think there is some ongoing development to fix the issue

@DanielSLucas
Copy link

Same issue here. (Windows + DevContainer)

@rryke
Copy link

rryke commented Apr 14, 2023

+1

stuszynski added a commit to stuszynski/Auto-GPT that referenced this issue Apr 14, 2023
- Fixes issues with `PermissionError: [Errno 13] Permission denied: '../logs'` 
- Use the built-in `env_file` option instead of copying the `.env` file to the container.

Fixes Significant-Gravitas#1328
@kathekon
Copy link

kathekon commented Apr 14, 2023

+1 (DevContainer on Mac)

@zjschiller
Copy link

+1 (DevContainer on Mac M2)

@mahmoudrabie
Copy link
Author

mahmoudrabie commented Apr 14, 2023

As a temporary workaround to do my PoC, I did the following update
image

@JakeHartnell
Copy link

As a temporary workaround to do my PoC, I did the following update image

Nice and simple, works great.

@ScrambledBits
Copy link

I did something similar to @mahmoudrabie but instead I am changing the way the path is concatenated:

# create log directory if it doesn't exist
this_files_dir_path = os.path.dirname(__file__)
log_dir = f"{this_files_dir_path}/../logs"
if not os.path.exists(log_dir):
    os.makedirs(log_dir)

@reouno
Copy link

reouno commented Apr 15, 2023

I'm running docker container on macOS.
Another workaround I did is edit Dockerfile:

# RUN chown appuser:appuser /home/appuser
RUN chown appuser:appuser /home

@mahmoudrabie
Copy link
Author

mahmoudrabie commented Apr 15, 2023

Dear @stuszynski

What are the steps to resolve it completely

@stuszynski
Copy link

@mahmoudrabie I think it's now resolved by #1199

@mahmoudrabie
Copy link
Author

Thanks @stuszynski for your prompt response

So after reverting the workaround change I made above in my already cloned and updated copy, would you please guide me what to do

@ntindle
Copy link
Member

ntindle commented Apr 23, 2023

Please update your versions

@ntindle ntindle closed this as completed Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.