apple / apple/container

[Bug]: container build will reconnect like crazy when registry connect returns error

Open
#918 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
49.9k
Forks
1.8k
Avg merge
1d 20h
Merged PRs (30d)
22

Description

### I have done the following

- [x] I have searched the existing issues
- [ ] If possible, I've reproduced the issue using the 'main' branch of this project

### Steps to reproduce

run container build with private base image
private registry returns error, maybe token expired or whatever reason 4xx response
build process looks like stuck but reconnects like crazy ( 10+ times / seconds)

### Current behavior

build process looks like stuck but reconnects like crazy ( 10+ times / seconds)

https://private-user-images.githubusercontent.com/31364/513367728-6b9c59a4-43e4-46a5-9369-a15f2e9d0db3.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjQzOTc3MzUsIm5iZiI6MTc2NDM5NzQzNSwicGF0aCI6Ii8zMTM2NC81MTMzNjc3MjgtNmI5YzU5YTQtNDNlNC00NmE1LTkzNjktYTE1ZjJlOWQwZGIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTExMjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMTI5VDA2MjM1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRmZTUxOTMyZWFiN2U1OTY3MGZkMDI4ZTA0OTNiOWU0N2NmY2EwYmRhNjhiNTg1ODA3ZGRmY2UwN2M5YzQ1YjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Vc6fx0UL3-NPLQQ2oug2KWyB60y8OYwEPOIKmZ3Y7eg

I don't know why the registry failed but looks like a container registry login helps fixed this. During the fail the registry always returns 401, that maybe another issue.

### Expected behavior

Show connection error
print error message and abort after n tries
slow down retry like sleep 1 second before next try to prevent a spam to the server?

### Environment

```markdown
- OS: 26.0.1 (25A362)
- Go:
- Xcode:
- container CLI version 0.6.0 (build: release, commit: a23bcf0)
```

### Relevant log output

```shell
[+] Building 0.0s (0/1)
=> [resolver] fetching image...xswitch......
[then STUCK forever]
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start by reproducing a container build with a private base image and a registry returning 401 or another 4xx response, while observing the resolver output. No file or test is named in the issue, so locate the container-build registry retry path first; done means the failure reports a connection error and stops or retries with a bounded, non-spamming policy.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
cli, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.