EC2: verifier sandbox fails SSH when it gets the agent sandbox's old IP

Open Beginner friendly
#4,323 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
64/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
aws, python

Research direction

Start by finding where the trial writes and reads its ec2_known_hosts file — search the Python sources for that filename and for the code that passes it into the SSH connection for each environment. Read how the trial dir and per-environment scratch dirs are laid out, then scope the known_hosts path to the environment rather than the trial. Done when both instances of a trial get distinct known_hosts files and the existing sandbox/EC2 tests still pass; reproducing needs a private subnet where AWS reuses the freed private IP.

Written by the indexing model from the issue text.

Description

Once in a while a trial errors on EC2 because its second machine gets the same IP address its first one had, and SSH thinks something is wrong.

For tasks with a separate verifier environment, a trial launches a second instance after the first one is terminated. Both use the same ec2_known_hosts file in the trial dir. Sometimes AWS hands the second instance the private IP the first one just gave up, and then SSH refuses to connect:

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

The trial errors out with "SSH did not become ready". It's rare: I got it once in 226 DeepSWE trials, running 48 at a time in a private subnet.

Using a known_hosts file per environment instead of per trial fixed it for me. Can PR.

Dominant language
Python
Stars
5.6k
Forks
1.9k
Avg merge
1d 17h
Merged PRs (30d)
156

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from harbor-framework/harbor

All issues in harbor-framework/harbor

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.