How to use Voyage process custom data for `/tmp/index_store` using
Dear tool developer, your tool moatless is very helpful to me!!!
After trying to use moatless-tool to solve the data of swe-bench, I want to use moatless-tool on similar datasets collected by myself, but I found that the code needs to use Voyage to pre-process each corresponding data (for example, each instance in swe-bench is downloaded from https://github.com/aorwall/moatless-tools/blob/main/moatless/index/code_index.py#L169).
I want to know if there is a script that can process my own data (like swe-bench does) to get the corresponding files to ensure the successful operation of the entire code?
The data that I want to generate as described above is as follows:
django__django-16255/
|-- blocks_by_class_name.json
|-- blocks_by_function_name.json
|-- docstore.json
|-- settings.json
|-- vector_index.faiss
`-- vector_index.json
Suppose I now have a django__django-custom1 data, how to get these files?
You should be able to do this by running ingestion and set persist_dir to /your/path/to/django__django-custom1.
index_settings = IndexSettings(
embed_model="voyage-code-3", # or OpenAI's "text-embedding-3-small",
dimensions = 1024 # or 1536 for text-embedding-3-small
)
repo_dir = "/path/to/repo"
persist_dir = "/path/to/index-dir
file_repo = FileRepository(repo_path=repo_dir)
code_index = CodeIndex(file_repo=file_repo, settings=index_settings)
nodes, tokens = code_index.run_ingestion()
print(f"Indexed {nodes} nodes and {tokens} tokens")
code_index.persist(persist_dir)
I'm working on a new Dockerized version of Moatless Tools also where you can also track the agent's trajectories in a UI and run and evaluate the instances in docker containers on your local machine. So if you're currently using Moatless, you could try following the instructions in the docker branch and see if you get it working. Feel free to DM me on Discord if you want help setting up your own setup with your own test instances https://discord.gg/W4yTenxm
Thank you very much for your detailed reply !!! :)
I just noticed that the ingest_index.py script is already available under scripts. Apologies for overlooking it, and sorry for the bother!
Wow, the UI now visualizes the agent process much more clearly — that's a really useful feature! I'm going to try it out in Docker right away. 👍
Hello! :) I am trying the docker version you mentioned recently and want to experience the UI. However, I encountered a series of problems after installing the environment according to the instructions.
Core questions:
1. How to run the test case script correctly (should I use uv run, path issues, etc.)?
2. Why did the Redis connection fail (trying localhost instead of the redis container name by default)?
3. Why can't I find the swebench_tools flow (do I need to add it manually, is the configuration not synchronized, etc.)?
- I have successfully run make run
make run
Starting all services for amd64 with environment: .env...
[+] Building 0.0s (0/0) docker:default
[+] Running 4/4
✔ Network moatless-network Created 0.1s
✔ Container moatless-tools-redis-1 Healthy 0.2s
✔ Container moatless-tools-moatless-api-1 Healthy 8.3s
✔ Container moatless-tools-moatless-ui-1 Started 0.3s
- I used uv run always reports an error when I run the provided command
uv run python scripts/docker_run.py --flow swebench_tools --model-id gpt-4o-mini-2024-07-18 --instance-id django__django-11099 --evaluation-name testing_setupto test a single case.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'opentelemetry'
so I modified the command and did not use uv run. python docker_run.py --flow swebench_tools --model-id deepseek/deepseek-chat --instance-id django__django-11099 --evaluation-name testing_setup and also docker_run.py must be in root path of repo
Traceback (most recent call last):
File "/workspace/code/moatless-tools/scripts/docker_run.py", line 20, in <module>
from moatless.runner.job_wrappers import run_evaluation_instance
ModuleNotFoundError: No module named 'moatless.runner
After moving the script to the root directory of the warehouse and not using uv, I encountered two problems.
One is that the redis connection failed, but I have tested it using nslookup in the started moatless-tools-moatless-api-1 to test that the redis service can be connected.
Here is nslookup result:
nslookup redis
Server: 127.0.0.11
Address: 127.0.0.11#53
Non-authoritative answer:
Name: redis
Address: 172.23.0.2
Here is python result:
2025-06-09 12:53:02,427 - moatless.eventbus.redis_bus - WARNING - Redis connection failed: Error Multiple exceptions: [Errno 111] Connect call failed ('::1', 6379, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6379) connecting to localhost:6379.
2025-06-09 12:53:02,427 - moatless.eventbus.redis_bus - WARNING - Redis connection failed: Error Multiple exceptions: [Errno 111] Connect call failed ('::1', 6379, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6379) connecting to localhost:6379.
the other is that available config only has simple_codeing
ValueError: Flow config swebench_tools not found. Available configs: ['simple_coding']
2025-06-09 12:53:02,458 - moatless.runner.scheduler - INFO - Job scheduler task cancelled
flows.json
[
{
"id": "simple_coding",
"description": "A streamlined coding flow utilizing the code_and_test_react agent, which combines React development with testing capabilities. Features a strict single-action workflow pattern for precise control, automatic test execution after code changes, and thorough test coverage management. Ideal for React/frontend development tasks that require both implementation and testing verification.",
"max_iterations": 20,
"max_cost": 1.0,
"agent_id": "code_and_test_react",
"max_expansions": 1,
"max_depth": 20,
"min_finished_nodes": 1,
"max_finished_nodes": 1,
"reward_threshold": 0.0,
"selector": {
"selector_class": "moatless.selector.simple.SimpleSelector"
},
"expander": {
"max_expansions": 1,
"expander_class": "moatless.expander.expander.Expander"
},
"value_function": null,
"feedback_generator": null,
"discriminator": null,
"flow_class": "moatless.flow.search_tree.SearchTree"
}
]
The complete running results of command python docker_run.py --flow swebench_tools --model-id deepseek/deepseek-chat --instance-id django__django-11099 --evaluation-name testing_setup are as follows:
python docker_run.py --flow swebench_tools --model-id deepseek/deepseek-chat --instance-id django__django-11099 --evaluation-name testing_setup
/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/pydantic/_internal/_config.py:345: UserWarning: Valid config keys have changed in V2:
* 'fields' has been removed
warnings.warn(message, UserWarning)
2025-06-09 12:53:02,176 - datasets - INFO - PyTorch version 2.7.0 available.
2025-06-09 12:53:02,386 - __main__ - INFO - Loading environment variables
2025-06-09 12:53:02,386 - __main__ - INFO - Setting MOATLESS_DIR to /workspace/code/moatless-tools/.moatless
2025-06-09 12:53:02,389 - moatless.storage.file_storage - INFO - File storage initialized in /workspace/code/moatless-tools/.moatless
2025-06-09 12:53:02,389 - moatless.settings - INFO - Storage initialized: FileStorage(base_dir=/workspace/code/moatless-tools/.moatless)
2025-06-09 12:53:02,393 - moatless.settings - INFO - Use Redis Event Bus with redis url: redis://localhost:6379
2025-06-09 12:53:02,425 - moatless.eventbus.redis_bus - INFO - Initialized RedisEventBus with Redis URL: redis://localhost:6379, worker ID: worker-3940534-8b130df0
2025-06-09 12:53:02,425 - moatless.eventbus.redis_bus - INFO - Connecting to Redis at redis://localhost:6379 with worker ID worker-3940534-8b130df0
2025-06-09 12:53:02,427 - moatless.eventbus.redis_bus - WARNING - Redis connection failed: Error Multiple exceptions: [Errno 111] Connect call failed ('::1', 6379, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6379) connecting to localhost:6379.
2025-06-09 12:53:02,427 - moatless.eventbus.redis_bus - WARNING - Redis connection failed: Error Multiple exceptions: [Errno 111] Connect call failed ('::1', 6379, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6379) connecting to localhost:6379.
2025-06-09 12:53:02,427 - moatless.eventbus.redis_bus - INFO - Connecting to Redis at redis://localhost:6379 with worker ID worker-3940534-8b130df0
2025-06-09 12:53:02,429 - moatless.eventbus.redis_bus - WARNING - Redis connection failed: Error Multiple exceptions: [Errno 111] Connect call failed ('::1', 6379, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6379) connecting to localhost:6379.
2025-06-09 12:53:02,429 - moatless.eventbus.redis_bus - WARNING - Redis unavailable, events will be local only
2025-06-09 12:53:02,433 - moatless.runner.docker_runner - INFO - Docker runner initialized with:
2025-06-09 12:53:02,433 - moatless.runner.docker_runner - INFO - - Source dir:
2025-06-09 12:53:02,433 - moatless.runner.docker_runner - INFO - - Components path:
2025-06-09 12:53:02,434 - moatless.runner.docker_runner - INFO - - Moatless dir: /workspace/code/moatless-tools/.moatless
2025-06-09 12:53:02,434 - moatless.runner.docker_runner - INFO - - Network: moatless-network
2025-06-09 12:53:02,434 - moatless.runner.docker_runner - INFO - - Host architecture: AMD64
2025-06-09 12:53:02,434 - moatless.runner.docker_runner - INFO - - Image architecture: x86_64
2025-06-09 12:53:02,434 - moatless.runner.docker_runner - INFO - - Platform strategy: Will use Docker default platform
2025-06-09 12:53:02,434 - moatless.runner.docker_runner - INFO - - Update on start: True (branch: main)
2025-06-09 12:53:02,434 - moatless.runner.scheduler - INFO - Started job scheduler
2025-06-09 12:53:02,434 - moatless.settings - INFO - Runner initialized: SchedulerRunner
2025-06-09 12:53:02,436 - moatless.settings - INFO - Initializing manager singletons...
2025-06-09 12:53:02,446 - moatless.component - INFO - Found 4 classes in [moatless.completion] for [completion_model]: ['moatless.completion.json.JsonCompletionModel', 'moatless.completion.multi_tool_call.MultiToolCallCompletionModel', 'moatless.completion.react.ReActCompletionModel', 'moatless.completion.tool_call.ToolCallCompletionModel']
2025-06-09 12:53:02,446 - moatless.agent.manager - INFO - Loading agent configs
2025-06-09 12:53:02,447 - moatless.runner.scheduler - INFO - Job scheduler started
2025-06-09 12:53:02,449 - moatless.agent.manager - INFO - Loading 6 agent configs
2025-06-09 12:53:02,450 - moatless.runner.scheduler - ERROR - Error syncing jobs with runner: Error Multiple exceptions: [Errno 111] Connect call failed ('::1', 6379, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6379) connecting to localhost:6379.
Traceback (most recent call last):
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/connection.py", line 302, in connect_check_health
await self.retry.call_with_retry(
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/retry.py", line 71, in call_with_retry
return await do()
^^^^^^^^^^
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/connection.py", line 755, in _connect
reader, writer = await asyncio.open_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/asyncio/streams.py", line 48, in open_connection
transport, _ = await loop.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/asyncio/base_events.py", line 1094, in create_connection
raise OSError('Multiple exceptions: {}'.format(
OSError: Multiple exceptions: [Errno 111] Connect call failed ('::1', 6379, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6379)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/workspace/code/moatless-tools/moatless/runner/scheduler.py", line 561, in _sync_jobs_with_runner
all_jobs = await self.storage.get_jobs()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/code/moatless-tools/moatless/runner/storage/redis.py", line 104, in get_jobs
keys = await self._redis.keys(pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/client.py", line 672, in execute_command
conn = self.connection or await pool.get_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/connection.py", line 1141, in get_connection
await self.ensure_connection(connection)
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/connection.py", line 1174, in ensure_connection
await connection.connect()
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/connection.py", line 296, in connect
await self.connect_check_health(check_health=True)
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/connection.py", line 310, in connect_check_health
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error Multiple exceptions: [Errno 111] Connect call failed ('::1', 6379, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6379) connecting to localhost:6379.
2025-06-09 12:53:02,453 - moatless.flow.manager - INFO - Copied global config to individual flow files
2025-06-09 12:53:02,453 - moatless.evaluation.manager - INFO - EvaluationManager subscribed to events
2025-06-09 12:53:02,453 - moatless.settings - INFO - All manager singletons accessed successfully
2025-06-09 12:53:02,453 - __main__ - INFO - Using local moatless source code from: /workspace/code
2025-06-09 12:53:02,453 - moatless.runner.docker_runner - INFO - Docker runner initialized with:
2025-06-09 12:53:02,453 - moatless.runner.docker_runner - INFO - - Source dir: /workspace/code
2025-06-09 12:53:02,453 - moatless.runner.docker_runner - INFO - - Components path:
2025-06-09 12:53:02,453 - moatless.runner.docker_runner - INFO - - Moatless dir: /workspace/code/moatless-tools/.moatless
2025-06-09 12:53:02,453 - moatless.runner.docker_runner - INFO - - Network: moatless-network
2025-06-09 12:53:02,453 - moatless.runner.docker_runner - INFO - - Host architecture: AMD64
2025-06-09 12:53:02,453 - moatless.runner.docker_runner - INFO - - Image architecture: x86_64
2025-06-09 12:53:02,453 - moatless.runner.docker_runner - INFO - - Platform strategy: Will use Docker default platform
2025-06-09 12:53:02,453 - moatless.runner.docker_runner - INFO - - Update on start: True (branch: main)
2025-06-09 12:53:02,453 - moatless.evaluation.manager - INFO - Creating evaluation: testing_setup
2025-06-09 12:53:02,453 - moatless.flow.manager - INFO - Flow config swebench_tools not found. Migrating legacy configs if needed.
2025-06-09 12:53:02,454 - moatless.runner.scheduler - ERROR - Error cleaning up terminal jobs: Error Multiple exceptions: [Errno 111] Connect call failed ('::1', 6379, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6379) connecting to localhost:6379.
Traceback (most recent call last):
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/connection.py", line 302, in connect_check_health
await self.retry.call_with_retry(
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/retry.py", line 71, in call_with_retry
return await do()
^^^^^^^^^^
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/connection.py", line 755, in _connect
reader, writer = await asyncio.open_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/asyncio/streams.py", line 48, in open_connection
transport, _ = await loop.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/asyncio/base_events.py", line 1094, in create_connection
raise OSError('Multiple exceptions: {}'.format(
OSError: Multiple exceptions: [Errno 111] Connect call failed ('::1', 6379, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6379)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/workspace/code/moatless-tools/moatless/runner/scheduler.py", line 436, in _cleanup_terminal_jobs
all_jobs = await self.storage.get_jobs()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/code/moatless-tools/moatless/runner/storage/redis.py", line 104, in get_jobs
keys = await self._redis.keys(pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/client.py", line 672, in execute_command
conn = self.connection or await pool.get_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/connection.py", line 1141, in get_connection
await self.ensure_connection(connection)
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/connection.py", line 1174, in ensure_connection
await connection.connect()
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/connection.py", line 296, in connect
await self.connect_check_health(check_health=True)
File "/root/miniconda3/envs/moatless-tool/lib/python3.11/site-packages/redis/asyncio/connection.py", line 310, in connect_check_health
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error Multiple exceptions: [Errno 111] Connect call failed ('::1', 6379, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 6379) connecting to localhost:6379.
2025-06-09 12:53:02,455 - moatless.flow.manager - INFO - Copied global config to individual flow files
2025-06-09 12:53:02,456 - moatless.flow.manager - ERROR - Flow config swebench_tools not found. Available configs: ['simple_coding']
2025-06-09 12:53:02,456 - __main__ - ERROR - Error running Docker evaluation: Flow config swebench_tools not found. Available configs: ['simple_coding']
Traceback (most recent call last):
File "/workspace/code/moatless-tools/moatless/flow/manager.py", line 310, in get_flow_config
config = await self._storage.read(flow_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/code/moatless-tools/moatless/storage/base.py", line 46, in read
content = await self.read_raw(path)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/code/moatless-tools/moatless/storage/file_storage.py", line 92, in read_raw
raise KeyError(f"No data found for path: {path}")
KeyError: 'No data found for path: flows/swebench_tools.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/workspace/code/moatless-tools/moatless/flow/manager.py", line 324, in get_flow_config
config = await self._storage.read(flow_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/code/moatless-tools/moatless/storage/base.py", line 46, in read
content = await self.read_raw(path)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/code/moatless-tools/moatless/storage/file_storage.py", line 92, in read_raw
raise KeyError(f"No data found for path: {path}")
KeyError: 'No data found for path: flows/swebench_tools.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/workspace/code/moatless-tools/docker_run.py", line 100, in run_docker_evaluation
evaluation = await eval_manager.create_evaluation(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/code/moatless-tools/moatless/evaluation/manager.py", line 93, in create_evaluation
flow = await self._flow_manager.build_flow(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/code/moatless-tools/moatless/flow/manager.py", line 88, in build_flow
flow = await self.get_flow_config(flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/code/moatless-tools/moatless/flow/manager.py", line 333, in get_flow_config
raise ValueError(f"Flow config {id} not found. Available configs: {available_flows}")
ValueError: Flow config swebench_tools not found. Available configs: ['simple_coding']
2025-06-09 12:53:02,458 - moatless.runner.scheduler - INFO - Job scheduler task cancelled
I added a missing dependency now so you could try to fetch the latest version and run uv sync . Then it should work with uv run python scripts/docker_run.py --flow swebench_tools --model-id gpt-4o-mini-2024-07-18 --instance-id django__django-11099 --evaluation-name testing_setup if you run it from the moatless-tools directory. It should read the flow config .moatless/flows/swebench_tools.json.
The latest version is indeed useful, but still need to move "redis<6.0.0,>=5.2.1", to dependencies to successfully run uv run, but there is only problem with redis being unable to connect. The current run command is uv run python scripts/docker_run.py --flow swebench_tools --model-id deepseek-chat --instance-id django__django-11099 --evaluation-name testing_setup.
I will check the redis connection problem again. Thank you very much for your timely and useful reply! ! !
I added redis to the default dependencies and also changed so the evaluation can start without it.
Hello! Sorry to bother you again, now I have no problem using uv run, but there are still two problems I can't solve.
My environment
OS: Ubuntu 22.04.3 LTS
Python: Python 3.11.11
Docker: 26.1.3
Docker Compose version v2.22.0
Running on a remote Linux server
❓ Question 1. moatless-tools-moatless-ui-1 cannot start normally and always displays restarting. I used docker logs moatless-tools-moatless-ui-1 and found that the nginx service startup error
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
88a92efe35d6 docker.1ms.run/aorwall/moatless-ui:latest "/docker-entrypoint.…" About a minute ago Restarting (1) 25 seconds ago moatless-tools-moatless-ui-1
===================================================================================
docker logs moatless-tools-moatless-ui-1
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2025/06/12 06:12:21 [emerg] 1#1: host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
nginx: [emerg] host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2025/06/12 06:12:22 [emerg] 1#1: host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
nginx: [emerg] host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2025/06/12 06:12:22 [emerg] 1#1: host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
nginx: [emerg] host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2025/06/12 06:12:23 [emerg] 1#1: host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
nginx: [emerg] host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2025/06/12 06:12:24 [emerg] 1#1: host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
nginx: [emerg] host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2025/06/12 06:12:26 [emerg] 1#1: host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
nginx: [emerg] host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2025/06/12 06:12:30 [emerg] 1#1: host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
nginx: [emerg] host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2025/06/12 06:12:37 [emerg] 1#1: host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
nginx: [emerg] host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2025/06/12 06:12:50 [emerg] 1#1: host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
nginx: [emerg] host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2025/06/12 06:13:16 [emerg] 1#1: host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
nginx: [emerg] host not found in upstream "moatless-tools-api" in /etc/nginx/conf.d/default.conf:21
So, I modified "moatless-tools-api" to "moatless-api" in /etc/nginx/conf.d/default.conf (line 21) inside the container to match docker-compose.yaml. Then I committed the change as moatless-ui-fixed and updated the docker-compose.yaml accordingly. The container still keeps restarting, but docker logs show no errors. Running /docker-entrypoint.sh nginx -g "daemon off;" manually inside the container works fine. Not sure how to fix this.
❓ Question 2. When ignoring moatless-ui, directly running uv run python scripts/docker_run.py --flow swebench_tools --model-id deepseek-chat --instance-id django__django-11099 --evaluation-name testing_setup always results in an error
2025-06-12 06:20:26,316 | ERROR | moatless.eventbus.redis_bus | Error publishing event to Redis: Error -2 connecting to host.docker.internal:6379. Name or service not known.
Traceback (most recent call last):
File "/opt/moatless/.venv/lib/python3.12/site-packages/redis/asyncio/connection.py", line 290, in connect
await self.retry.call_with_retry(
File "/opt/moatless/.venv/lib/python3.12/site-packages/redis/asyncio/retry.py", line 59, in call_with_retry
return await do()
^^^^^^^^^^
File "/opt/moatless/.venv/lib/python3.12/site-packages/redis/asyncio/connection.py", line 723, in _connect
reader, writer = await asyncio.open_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/share/uv/python/cpython-3.12.10-linux-x86_64-gnu/lib/python3.12/asyncio/streams.py", line 48, in open_connection
transport, _ = await loop.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/share/uv/python/cpython-3.12.10-linux-x86_64-gnu/lib/python3.12/asyncio/base_events.py", line 1083, in create_connection
infos = await self._ensure_resolved(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/share/uv/python/cpython-3.12.10-linux-x86_64-gnu/lib/python3.12/asyncio/base_events.py", line 1466, in _ensure_resolved
return await loop.getaddrinfo(host, port, family=family, type=type,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/share/uv/python/cpython-3.12.10-linux-x86_64-gnu/lib/python3.12/asyncio/base_events.py", line 905, in getaddrinfo
return await self.run_in_executor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/share/uv/python/cpython-3.12.10-linux-x86_64-gnu/lib/python3.12/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/share/uv/python/cpython-3.12.10-linux-x86_64-gnu/lib/python3.12/socket.py", line 978, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/moatless/moatless/moatless/eventbus/redis_bus.py", line 237, in publish
await self._redis.publish(self._channel, serialized)
File "/opt/moatless/.venv/lib/python3.12/site-packages/redis/asyncio/client.py", line 641, in execute_command
conn = self.connection or await pool.get_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/moatless/.venv/lib/python3.12/site-packages/redis/asyncio/connection.py", line 1100, in get_connection
await self.ensure_connection(connection)
File "/opt/moatless/.venv/lib/python3.12/site-packages/redis/asyncio/connection.py", line 1133, in ensure_connection
await connection.connect()
File "/opt/moatless/.venv/lib/python3.12/site-packages/redis/asyncio/connection.py", line 298, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error -2 connecting to host.docker.internal:6379. Name or service not known.
It seems that the url was replaced at this location
https://github.com/aorwall/moatless-tools/blob/main/moatless/runner/docker_runner.py#L952
, but host.docker.internal is not supported by default in the Linux environment, resulting in moatless-tools-moatless-api-1 not being able to connect to redis. So I added in docker-compose.yml:
services:
your_service:
extra_hosts:
- "host.docker.internal:host-gateway"
But it seems that the problem still exists and I don't know how to solve it.
At the same time, in order to enable the local machine to connect to REDIS_URL=redis://localhost:6379, I have added in docker-compose.yaml
redis:
image: docker.1ms.run/redis:7-alpine
networks:
- moatless-network
volumes:
- redis-data:/data
ports:
- "6379:6379" //added
-
I pushed changes to the docker-compose files to use the name "moatless-tools-api" instead now to fix the nginx issue.
-
The issue is that the redis server cant be reached from inside the docker container then. Try to just remove the
REDIS_URLenv var. Redis is only used for event handling and automatic updates in the UI. Indocker_run.pyit will just check the docker status every 5 seconds until its completed. The error you see is also only about publishing events also so it should still work