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

Running aider on Mac M1 in docker with ollama #3078

Open
pavelpp opened this issue Jan 30, 2025 · 4 comments
Open

Running aider on Mac M1 in docker with ollama #3078

pavelpp opened this issue Jan 30, 2025 · 4 comments
Labels
bug Something isn't working fixed

Comments

@pavelpp
Copy link

pavelpp commented Jan 30, 2025

Issue

Is this command supposed to work?

docker run -it --user $(id -u):$(id -g) -e OLLAMA_API_BASE=http://127.0.0.1:11434 --volume $(pwd):/app paulgauthier/aider-full --model ollama_chat/qwen2.5-coder:14b --message "write a hello world python program" --yes

I'm getting an error:

# Uncaught PermissionError in pathlib.py line 1175

Aider version: 0.72.3
Python version: 3.10.16
Platform: Linux-5.10.104-linuxkit-aarch64-with-glibc2.36
Python implementation: CPython
Virtual environment: Yes
OS: Linux 5.10.104-linuxkit (64bit)
Git version: git version 2.39.5

An uncaught exception occurred:


Traceback (most recent call last):
  File "pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/.aider/caches'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
  File "main.py", line 712, in main
    check_version(io, verbose=args.verbose)
  File "versioncheck.py", line 94, in check_version
    VERSION_CHECK_FNAME.parent.mkdir(parents=True, exist_ok=True)
  File "pathlib.py", line 1179, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/.aider'



Please consider reporting this bug to help improve aider!
Open a GitHub Issue pre-filled with the above error in your browser? (Y/n) n
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/.aider/caches'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/venv/bin/aider", line 8, in <module>
    sys.exit(main())
  File "/venv/lib/python3.10/site-packages/aider/main.py", line 712, in main
    check_version(io, verbose=args.verbose)
  File "/venv/lib/python3.10/site-packages/aider/versioncheck.py", line 94, in check_version
    VERSION_CHECK_FNAME.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/local/lib/python3.10/pathlib.py", line 1179, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/local/lib/python3.10/pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/.aider'

Version and model info

Aider: aider 0.72.3 (paulgauthier/aider-full:latest)

@pavelpp
Copy link
Author

pavelpp commented Jan 30, 2025

Running docker run -it --user $(id -u):$(id -g) -e OLLAMA_API_BASE=http://127.0.0.1:11434 --volume $(pwd):/app paulgauthier/aider-full --version

produces output
aider 0.72.3

@pavelpp
Copy link
Author

pavelpp commented Jan 30, 2025

OK, I figured it out. The example in documentation is not functional, because internally Dockerfile creates a user with id 1000 and we can't just pass our user per example provided here https://aider.chat/docs/install/docker.html

This works

docker run -it -e OLLAMA_API_BASE=http://host.docker.internal:11434 --volume $(pwd):/app paulgauthier/aider-full --model ollama_chat/qwen2.5-coder:14b --message "write hello world in python" --yes

@paul-gauthier paul-gauthier added the bug Something isn't working label Jan 30, 2025
@paul-gauthier
Copy link
Collaborator

The fix is available in the :dev build of the docker container.

@pavelpp
Copy link
Author

pavelpp commented Feb 8, 2025

@paul-gauthier can you drop a diff link?

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

No branches or pull requests

2 participants