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

Permission denied to '/app/logs/activity.log' #4048

Closed
1 task done
lutzseverino opened this issue May 9, 2023 · 10 comments
Closed
1 task done

Permission denied to '/app/logs/activity.log' #4048

lutzseverino opened this issue May 9, 2023 · 10 comments

Comments

@lutzseverino
Copy link

⚠️ Search for existing issues first ⚠️

  • I have searched the existing issues, and there is no existing issue for my problem

Which Operating System are you using?

Docker

Which version of Auto-GPT are you using?

Latest Release

GPT-3 or GPT-4?

GPT-3.5

Steps to reproduce 🕹

Follow the installation process with docker (podman) on Fedora 38
Run sudo podman-compose run --rm auto-gpt --gpt3only --continuous

Note that I tried without sudo before, but to no avail, since the problem was with regard to permissions, I tried running as root.

Current behavior 😯

A python error is thrown.

$ sudo podman-compose run --rm auto-gpt --gpt3only --continuous
[sudo] password for lutzseverino: 
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.5.0
** excluding:  {'auto-gpt'}
['podman', 'ps', '--filter', 'label=io.podman.compose.project=auto-gpt', '-a', '--format', '{{ index .Labels "io.podman.compose.config-hash"}}']
['podman', 'network', 'exists', 'auto-gpt_default']
podman run --name=auto-gpt_redis_1 -d --label io.podman.compose.config-hash=afa98e55185e0e046f9a2c8f1b4fdd9315540977becfbf7f4770c61e3ca3d0a6 --label io.podman.compose.project=auto-gpt --label io.podman.compose.version=1.0.6 --label PODMAN_SYSTEMD_UNIT=podman-compose@auto-gpt.service --label com.docker.compose.project=auto-gpt --label com.docker.compose.project.working_dir=/home/lutzseverino/Documents/Projects/Auto-GPT --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=redis --net auto-gpt_default --network-alias redis redis/redis-stack-server:latest
Error: creating container storage: the container name "auto-gpt_redis_1" is already in use by 2365cf6213f0dc93dc1b3440830d69ecd310bf8a53845713e5c50d46df0a9c65. You have to remove that container to be able to reuse that name: that name is already in use
exit code: 125
podman start auto-gpt_redis_1
exit code: 0
** skipping:  auto-gpt_auto-gpt_1
['podman', 'network', 'exists', 'auto-gpt_default']
podman run --name=auto-gpt_auto-gpt_tmp9468 --rm -i --requires=auto-gpt_redis_1 --label io.podman.compose.config-hash=afa98e55185e0e046f9a2c8f1b4fdd9315540977becfbf7f4770c61e3ca3d0a6 --label io.podman.compose.project=auto-gpt --label io.podman.compose.version=1.0.6 --label PODMAN_SYSTEMD_UNIT=podman-compose@auto-gpt.service --label com.docker.compose.project=auto-gpt --label com.docker.compose.project.working_dir=/home/lutzseverino/Documents/Projects/Auto-GPT --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=auto-gpt --env-file /home/lutzseverino/Documents/Projects/Auto-GPT/.env -e MEMORY_BACKEND=redis -e REDIS_HOST=redis -v /home/lutzseverino/Documents/Projects/Auto-GPT/auto_gpt_workspace:/app/auto_gpt_workspace -v /home/lutzseverino/Documents/Projects/Auto-GPT/data:/app/data -v /home/lutzseverino/Documents/Projects/Auto-GPT/logs:/app/logs --net auto-gpt_default --network-alias auto-gpt --tty significantgravitas/auto-gpt --gpt3only --continuous
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/app/autogpt/__main__.py", line 5, in <module>
    autogpt.cli.main()
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1635, in invoke
    rv = super().invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/app/autogpt/cli.py", line 87, in main
    from autogpt.main import run_auto_gpt
  File "/app/autogpt/main.py", line 8, in <module>
    from autogpt.agent.agent import Agent
  File "/app/autogpt/agent/__init__.py", line 1, in <module>
    from autogpt.agent.agent import Agent
  File "/app/autogpt/agent/agent.py", line 5, in <module>
    from autogpt.app import execute_command, get_command
  File "/app/autogpt/app.py", line 5, in <module>
    from autogpt.agent.agent_manager import AgentManager
  File "/app/autogpt/agent/agent_manager.py", line 7, in <module>
    from autogpt.llm import Message, create_chat_completion
  File "/app/autogpt/llm/__init__.py", line 1, in <module>
    from autogpt.llm.api_manager import ApiManager
  File "/app/autogpt/llm/api_manager.py", line 7, in <module>
    from autogpt.logs import logger
  File "/app/autogpt/logs.py", line 251, in <module>
    logger = Logger()
  File "/app/autogpt/singleton.py", line 15, in __call__
    cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
  File "/app/autogpt/logs.py", line 47, in __init__
    self.file_handler = logging.FileHandler(
  File "/usr/local/lib/python3.10/logging/__init__.py", line 1169, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/local/lib/python3.10/logging/__init__.py", line 1201, in _open
    return open_func(self.baseFilename, self.mode,
PermissionError: [Errno 13] Permission denied: '/app/logs/activity.log'
exit code: 1

Expected behavior 🤔

Auto-GPT should start.

Your prompt 📝

No response

Your Logs 📒

No response

@lutzseverino
Copy link
Author

May be related to #1199, #2190 and #3102.

@lutzseverino
Copy link
Author

Changing the volume paths on docker-compose.yml worked around this issue.

    volumes:
      - ./auto_gpt_workspace:/home/lutzseverino/Documents/Projects/Auto-GPT/auto_gpt_workspace
      - ./data:/home/lutzseverino/Documents/Projects/Auto-GPT/data
      - ./logs:/home/lutzseverino/Documents/Projects/Auto-GPT/logs

Now I'm experiencing #3821. The provided docker-compose.yml file on the setup page should be updated, though. If user configuration is necessary. I'm unaware if this behavior is unintended.

@lutzseverino
Copy link
Author

Okay, it seems like the Docker release is having multiple issues. I've seen a couple of issues on this now. I was not able to patch it locally, so I'll wait.

@suparious
Copy link

Tested the docker setup and the default instructions working without problems.
This issue can be closed.

@Riyaz-Patel
Copy link

Okay, it seems like the Docker release is having multiple issues. I've seen a couple of issues on this now. I was not able to patch it locally, so I'll wait.
I had the same error but it worked with "python -m autogpt" instead of "run --rm auto-gpt"

@suparious
Copy link

Sorry, this is a podman issue, not a problem with the docker build on dockerhub, I misunderstood.

Using the docker image from v0.3.0 works with compose and has no issues, but the one currently on master doesn't always work by default.

@jkemp814
Copy link

jkemp814 commented May 16, 2023

I cannot get it to run in podman also. It finishes with error:

podman start -a auto-gpt_auto-gpt_1
/usr/local/bin/python: No module named autogpt
exit code: 1

@ntindle
Copy link
Member

ntindle commented May 16, 2023

Podman isn’t supported currently. If someone wants to attempt to add support for it, that would be lovely but none of the maintainers have the bandwidth to do so currently

@ntindle ntindle closed this as completed May 16, 2023
@jkemp814
Copy link

jkemp814 commented May 16, 2023

okay, thanks for the response. podman-compose is suppose to work just as docker-compose. Haven't had a problem with other docker-compose files.

I will leave this error just in case someone wants to take on the task. A little over my head right now, but will study the docker-compose file to learn or discover what the problem is. Can't see myself installing docker just for this, when I already have podman baked right in Fedora Silverblue.

error:
** skipping: auto-gpt_auto-gpt_1
['podman', 'network', 'exists', 'auto-gpt_default']
podman run --name=auto-gpt_auto-gpt_tmp45976 --rm -i --requires=auto-gpt_redis_1 --label io.podman.compose.config-hash=1928958e75e8cafcf96c4e3ebe7844d2a5770c2107b8a6d71fae8b4a1e857555 --label io.podman.compose.project=auto-gpt --label io.podman.compose.version=1.0.6 --label PODMAN_SYSTEMD_UNIT=podman-compose@auto-gpt.service --label com.docker.compose.project=auto-gpt --label com.docker.compose.project.working_dir=/var/home/james/Auto-GPT --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=auto-gpt --env-file /var/home/james/Auto-GPT/.env -e MEMORY_BACKEND=local -e REDIS_HOST=redis -v /var/home/james/Auto-GPT:/app --net auto-gpt_default --network-alias auto-gpt --tty auto-gpt_auto-gpt
/usr/local/bin/python: No module named autogpt
exit code: 1

@jlovison
Copy link

@lutzseverino @jkemp814

This is because of SELinux in Fedora 38 (and any other distros with it).

The directories should be mounted with :Z after them and it will work fine:

      - ./auto_gpt_workspace:/app/autogpt/auto_gpt_workspace:Z
      - ./data:/app/data:Z
      - ./logs:/app/logs:Z

See more here.

This could cause issues if you are mounting to anything other than local directories within a dedicated folder for AutoGPT though, so make sure to be following the instructions if adding (and given the specific use case, probably shouldn't be a part of the Dockerfile in general).

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

No branches or pull requests

6 participants