Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Fix: Correctly catch docker connection errors

Kilian Lieret811da5e0b583
diff --git a/sweagent/environment/utils.py b/sweagent/environment/utils.py
index 126494fb..3d679909 100644
--- a/sweagent/environment/utils.py
+++ b/sweagent/environment/utils.py
@@ -271,7 +271,7 @@ def get_container(ctr_name: str, image_name: str, persistent: bool = False) -> T
try:
client = docker.from_env()
except docker.errors.DockerException as e:
- if "connection aborted" in str(e):
+ if "connection aborted" in str(e).lower() or "connection refused" in str(e).lower():
msg = (
"Probably the Docker daemon is not running. Please start the Docker daemon and try again. "
"You might need to allow the use of the docker socket "