canonical / canonical/testflinger
Agents stuck when allocated
- Dominant language
- Python
- Stars
- 26
- Forks
- 49
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 16
Description
## Description
Observed that agents stuck at `allocated` with the following message in the log.
A schema check for `parent_job_id` in the job when `"allocate_data": {"allocate": true}` might be helpful?
```
[25-09-09 22:43:06] INFO: (client.py:275)| Submitting job outcome for job: 42982367-2265-4a7f-b5a0-a1225d77d1b3
[25-09-09 22:43:14] INFO: (agent.py:304)| Starting job 891e1589-3c40-44d7-a630-ed1a012b5662
[25-09-09 22:43:16] INFO: (job.py:89)| Running setup_command: tf-setup
[25-09-09 22:43:23] INFO: (job.py:89)| Running provision_command: tf-provision
[25-09-10 00:03:18] INFO: (job.py:76)| No firmware_update_data defined in job data, skipping...
[25-09-10 00:03:20] INFO: (job.py:76)| No test_data defined in job data, skipping...
[25-09-10 00:03:21] INFO: (job.py:89)| Running allocate_command: tf-allocate
[25-09-10 00:03:29] WARNING: (job.py:224)| No parent job ID found while allocated
[25-09-10 00:03:29] WARNING: (job.py:224)| No parent job ID found while allocated
...
```
Also, `allocate.log` shows the method signature error.
```
*****************************************************
* Starting testflinger allocate phase on rpi4b1g001 *
*****************************************************
2025-09-10 00:03:26,123 rpi4b1g001 ERROR: DEVICE CONNECTOR: DefaultDevice.allocate() takes 1 positional argument but 2 were given
```
This could be fixed by either way, depending on how the allocate method being used by multi-device jobs.
1. update the allocate method as `def allocate(self, args):` in [device connector](https://github.com/canonical/testflinger/blob/main/device-connectors/src/testflinger_device_connectors/devices/__init__.py#L259)
2. remove tailing arguments in [tf-cmd-scripts/tf-allocate](https://github.com/canonical/testflinger/blame/main/agent/charms/testflinger-agent-host-charm/src/tf-cmd-scripts/tf-allocate#L12-L14)
## Logs
For more information, check the [detail logs](https://pastebin.canonical.com/p/px2bNyDrd5/) on the agent host.
Contributor guide
Assessment
This issue has not been assessed yet.