Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Partial deploy failure loses harness state — can create duplicate resources

Đang mở Phù hợp với người mới
#1,382 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript
Lĩnh vực
cli, cloud

Hướng nghiên cứu

Bắt đầu với HarnessDeployer.deploy() và actions.ts quanh các dòng 531, 541 và 584, theo dõi cách deployedHarnesses và writeDeployedState() được sử dụng khi xảy ra lỗi. Xác nhận rằng một deploy thất bại vẫn lưu trạng thái của harness A đã triển khai thành công trước khi return, để deploy tiếp theo có thể cập nhật nó thay vì tạo một resource trùng lặp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Problem

If deploying harness B fails after harness A succeeds, the partial state (containing harness A's new ID) is never persisted to disk.

Flow:

  1. HarnessDeployer.deploy() returns { success: false, state: resultState } — resultState contains harness A's ID
  2. actions.ts:531 extracts the state into deployedHarnesses
  3. actions.ts:541 returns early with an error — before writeDeployedState() at line 584

On next deploy attempt, the state file doesn't know harness A exists. The deployer takes the CREATE path (createHarness with clientToken: randomUUID()), producing a duplicate cloud resource. The previous harness A is orphaned.

Expected behavior

Partial state should be persisted even on failure, so the next deploy attempt can UPDATE existing harnesses rather than re-creating them.

Possible fix

Write deployed state before the early return at line 541:

if (harnessDeployError) {
  // Persist partial state so successfully-created harnesses aren't orphaned
  await configIO.writeDeployedState(buildDeployedState(...));
  return { success: false, error: harnessDeployError };
}

Context

Found during review of #1341.

Ngôn ngữ chính
TypeScript
Star
291
Fork
96
Merge trung bình
20 giờ 50 phút
Pull request đã merge (30 ngày)
214

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws/agentcore-cli

Tất cả issue của aws/agentcore-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.