Fetch service exits with status 0 when the control port is already in use.
Metadata
Current evaluation
Fixed by merged PR canonical/fetch-service#375 (commit 2b20ef0), which makes startup failures such as control-port conflicts return a non-zero error instead of status 0.
Resolution: closed resolved
Reason: PR #375 was merged as commit 2b20ef0, changing the CLI to return proper error codes when the service fails to start, including when the control port is already in use.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
When the control port is in use, the fetch service exits almost immediately with status code 0 and no indication that there is an issue.
The correct behaviour (exiting with an error and "bind: address already in use") occurs when the proxy port is in use.
This appears to be a repeat-regression of #208
### To Reproduce
Run the following in a Python interactive shell:
```python
import socket
soc = socket.create_server(("localhost", 13444), reuse_port=True)
```
Then run:
```
fetch-service --control-port=13444 --cert=$HOME/snap/fetch-service/common/craft/fetch-certificate/local-ca.pem --key=$HOME/snap/fetch-service/common/craft/fetch-certificate/local-ca.key.pem --proxy-port=13555
```
### Relevant log output
```shell
2025/03/19 15:48:59.946769 INFO : Version 0.6.1-0-g312cf84
2025/03/19 15:48:59.946786 INFO : Loading certificate from /home/lengau/snap/fetch-service/common/craft/fetch-certificate/local-ca.pem
2025/03/19 15:48:59.946846 INFO : Loading key from /home/lengau/snap/fetch-service/common/craft/fetch-certificate/local-ca.key.pem
2025/03/19 15:48:59.946874 INFO : create CA from PEM certificate and key blocks
2025/03/19 15:48:59.947454 INFO : ACL configuration file /etc/fetch/acl.yaml does not exist
2025/03/19 15:48:59.947465 INFO : Inspectors configuration file /etc/fetch/inspectors.yaml does not exist
2025/03/19 15:48:59.947469 INFO : Starting service...
2025/03/19 15:48:59.947653 INFO : Starting the HTTP proxy; listening on :13555
2025/03/19 15:48:59.947689 INFO : Listening on fetchctl socket...
2025/03/19 15:48:59.947896 INFO : control server listening on :13444
2025/03/19 15:48:59.948120 INFO : Server exiting!
2025/03/19 15:48:59.948130 INFO : Stopping service...
2025/03/19 15:48:59.948134 INFO : [session] all sessions finished
2025/03/19 15:48:59.948139 INFO : Shutting down the HTTP proxy...
2025/03/19 15:48:59.948206 INFO : Shutting down fetchctl socket...
2025/03/19 15:48:59.948232 INFO : Shutting down the control API server...
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR canonical/fetch-service#375 (commit 2b20ef0), which makes startup failures such as control-port conflicts return a non-zero error instead of status 0. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR #375 (commit 2b20ef0), making fetch-service return a proper error when startup fails because the control port is already in use. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The control port conflict bug was deferred to internal ticket CRAFT-4410. No code changes or merges were applied. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
canonical/fetch-service#375
(confidence 100%)
Merged fix for returning a non-zero status on service startup errors.
-
Related To:
canonical/fetch-service#208
(confidence 98%)
Earlier control-port regression explicitly cited by issue #369.
Related issues
No related issues found above the similarity threshold.