Closed twiecki closed 5 months ago
I have the same result. I'm on a m1 mac.
At first it complains that there is no GITHUB_TOKEN, even though it's in the keys.cfg file.
If I export GITHUB_TOKEN as an env variable, I get the error shown above.
Then it's probably arm64 related.
Regarding GITHUB_TOKEN
, this should be fixed soon with #31
I'm on a M1 and cannot reproduce this. This is silly, but did you double check that your docker daemon is running?
I can reproduce this by killing docker and rerunning the command.
So the fix is simply: Make sure that docker is running.
I agree that the error handling could be improved. I'll open a PR for that.
Ensure docker is running
Docker desktop > Settings > Advanced > Allow the default Docker socket to be used (requires password)
needs to be enabled.
Feel free to reopen if issue persists.
I'm positive that Docker is running (docker run
works). So it must be something else. I can't reopen the issue.
Ensure docker is running Docker desktop > Settings > Advanced >
Allow the default Docker socket to be used (requires password)
needs to be enabled.
I'm seeing this issue with Docker Desktop (the recommended way of installing docker according to the docker docs) on Ubuntu 23. This setup uses a different location for the default Docker socket which probably causes the FileNotFoundError thrown by the docker python library. Creating a symlink at the expected location with the following command fixes it:
sudo ln -s -f /home/<user>/.docker/desktop/docker.sock /var/run/docker.sock
Thanks @entuerem, that solved that problem. Now I'm getting:
ERROR Unexpected container setup output: Unable to find image 'swe-agent:latest' locally
docker: Error response from daemon: pull access denied for swe-agent, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
Traceback (most recent call last):
File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/api/client.py", line 265, in _raise_for_status
response.raise_for_status()
File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http+docker://localhost/v1.43/containers/swe-agent-515b31641c/json
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/twiecki/projects/SWE-agent/run.py", line 223, in <module>
main(args)
File "/Users/twiecki/projects/SWE-agent/run.py", line 66, in main
env = SWEEnv(args.environment)
File "/Users/twiecki/projects/SWE-agent/sweagent/environment/swe_env.py", line 101, in __init__
self._reset_container()
File "/Users/twiecki/projects/SWE-agent/sweagent/environment/swe_env.py", line 349, in _reset_container
self._init_container()
File "/Users/twiecki/projects/SWE-agent/sweagent/environment/swe_env.py", line 378, in _init_container
self.container_obj = client.containers.get(self.container_name)
File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/models/containers.py", line 951, in get
resp = self.client.api.inspect_container(container_id)
File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/utils/decorators.py", line 19, in wrapped
return f(self, resource_id, *args, **kwargs)
File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/api/container.py", line 792, in inspect_container
return self._result(
File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/api/client.py", line 271, in _result
self._raise_for_status(response)
File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/api/client.py", line 267, in _raise_for_status
raise create_api_error_from_http_exception(e) from e
File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/errors.py", line 39, in create_api_error_from_http_exception
raise cls(e, response=response, explanation=explanation) from e
docker.errors.NotFound: 404 Client Error for http+docker://localhost/v1.43/containers/swe-agent-515b31641c/json: Not Found ("No such container: swe-agent-515b31641c")
Running docker login
successfully didn't fix it.
Hi @twiecki : Sorry for missing your commend last week! (and I didn't know that you couldn't re-open the issue!)
Thanks for following up with detailed logs.
@timothycarambat @entuerem This is only for using the fully containerized version of the software, right? (i.e., when you mount the docker socket)
@twiecki Could it be that you didn't build/pull the swe-agent
container? (step 2 of the express setup instructions or running setup.sh
with the conda instructions)
Also note that we have updated the images to support arm64 as well as amd64 :)
Hi @twiecki : Sorry for missing your commend last week! (and I didn't know that you couldn't re-open the issue!)
Thanks for following up with detailed logs.
@timothycarambat @entuerem This is only for using the fully containerized version of the software, right? (i.e., when you mount the docker socket)
@twiecki Could it be that you didn't pull the
swe-agent
container (step 2 of the express setup instructions)
No. This happened when I followed the "Setup with conda (development version)" instructions. On Ubuntu 23 this is the only issue I encountered. After creating the symlink it worked. Thx for this. Currently analyzing how you guys wrote this thing :)
The message below is the same problem I'm having when executing commands in Windows docker desctop, is it the same problem? How can i solve it.
Traceback (most recent call last):
File "/app/run.py", line 108, in main
observation, info = env.reset(index)
File "/app/sweagent/environment/swe_env.py", line 216, in reset
self.communicate_with_handling(
File "/app/sweagent/environment/swe_env.py", line 485, in communicate_with_handling
logs = self.communicate(input, timeout_duration=timeout_duration)
File "/app/sweagent/environment/swe_env.py", line 468, in communicate
output = self._communicate(
File "/app/sweagent/environment/swe_env.py", line 437, in _communicate
raise e
File "/app/sweagent/environment/swe_env.py", line 430, in _communicate
buffer = read_with_timeout(self.container, self.get_pids, timeout_duration)
File "/app/sweagent/environment/utils.py", line 128, in read_with_timeout
raise TimeoutError("Timeout reached while reading from subprocess.\nCurrent buffer: {}\nRunning PIDs: {}".format(buffer.decode(), pids))
TimeoutError: Timeout reached while reading from subprocess.
Current buffer:
Running PIDs: [['1994', 'pip']]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/run.py", line 321, in <module>
main(args)
File "/app/run.py", line 157, in main
env.reset_container()
File "/app/sweagent/environment/swe_env.py", line 362, in reset_container
self._reset_container()
File "/app/sweagent/environment/swe_env.py", line 356, in _reset_container
self._init_scripts()
File "/app/sweagent/environment/swe_env.py", line 403, in _init_scripts
self.communicate_with_handling(
File "/app/sweagent/environment/swe_env.py", line 485, in communicate_with_handling
logs = self.communicate(input, timeout_duration=timeout_duration)
File "/app/sweagent/environment/swe_env.py", line 468, in communicate
output = self._communicate(
File "/app/sweagent/environment/swe_env.py", line 437, in _communicate
raise e
File "/app/sweagent/environment/swe_env.py", line 434, in _communicate
exit_code = read_with_timeout(self.container, self.get_pids, 5).strip()
File "/app/sweagent/environment/utils.py", line 128, in read_with_timeout
raise TimeoutError("Timeout reached while reading from subprocess.\nCurrent buffer: {}\nRunning PIDs: {}".format(buffer.decode(), pids))
TimeoutError: Timeout reached while reading from subprocess.
Current buffer: 0
Running PIDs: []
@Amon1412 Please open a separate bug report.
Could it be that you didn't build/pull the swe-agent container? (step 2 of the express setup instructions or running setup.sh with the conda instructions)
@twiecki
Yes, that was indeed the problem and pulling fixed. I now have a different problem for which I'll open a new issue. thanks!
Installed (on arm64) successfully, then running:
INFO š½ Loaded dataset from https://github.com/pymc-devs/pymc/issues/7223 Traceback (most recent call last): File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/urllib3/connectionpool.py", line 793, in urlopen response = self._make_request( File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/urllib3/connectionpool.py", line 496, in _make_request conn.request( File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/urllib3/connection.py", line 400, in request self.endheaders() File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/http/client.py", line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/http/client.py", line 1040, in _send_output self.send(msg) File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/http/client.py", line 980, in send self.connect() File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/transport/unixconn.py", line 27, in connect sock.connect(self.unix_socket) FileNotFoundError: [Errno 2] No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/urllib3/connectionpool.py", line 847, in urlopen retries = retries.increment( File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/urllib3/util/retry.py", line 470, in increment raise reraise(type(error), error, _stacktrace) File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/urllib3/util/util.py", line 38, in reraise raise value.with_traceback(tb) File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/urllib3/connectionpool.py", line 793, in urlopen response = self._make_request( File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/urllib3/connectionpool.py", line 496, in _make_request conn.request( File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/urllib3/connection.py", line 400, in request self.endheaders() File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/http/client.py", line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/http/client.py", line 1040, in _send_output self.send(msg) File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/http/client.py", line 980, in send self.connect() File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/transport/unixconn.py", line 27, in connect sock.connect(self.unix_socket) urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/api/client.py", line 213, in _retrieve_server_version return self.version(api_version=False)["ApiVersion"] File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/api/daemon.py", line 181, in version return self._result(self._get(url), json=True) File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/utils/decorators.py", line 44, in inner return f(self, *args, kwargs) File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/api/client.py", line 236, in _get return self.get(url, self._set_request_timeout(kwargs)) File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/Users/twiecki/projects/SWE-agent/run.py", line 223, in
main(args)
File "/Users/twiecki/projects/SWE-agent/run.py", line 66, in main
env = SWEEnv(args.environment)
File "/Users/twiecki/projects/SWE-agent/sweagent/environment/swe_env.py", line 101, in init
self._reset_container()
File "/Users/twiecki/projects/SWE-agent/sweagent/environment/swe_env.py", line 349, in _reset_container
self._init_container()
File "/Users/twiecki/projects/SWE-agent/sweagent/environment/swe_env.py", line 371, in _init_container
client = docker.from_env()
File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/client.py", line 94, in from_env
return cls(
File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/client.py", line 45, in init
self.api = APIClient(*args, **kwargs)
File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/api/client.py", line 197, in init
self._version = self._retrieve_server_version()
File "/Users/twiecki/micromamba/envs/swe-agent/lib/python3.9/site-packages/docker/api/client.py", line 220, in _retrieve_server_version
raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))