A failed build does not necessarily return an artifact.
- Dominant language
- Python
- Stars
- 140
- Forks
- 45
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
[See original issue on GitLab](https://gitlab.com/BuildStream/buildstream/-/issues/1304)
In GitLab by [[Gitlab user @BenjaminSchubert]](https://gitlab.com/BenjaminSchubert) on May 9, 2020, 17:16
## Summary
[//]: # (Summarize the bug encountered concisely)
A failed build might not return any artifact at all. We need to be able to handle this for `retry` operations for example.
## Steps to reproduce
[//]: # (How one can reproduce the issue - this is very important)
There is probably simpler, but here is how I have hit it:
- Setup a bogus RE-execution server (the one from CI, then rm buildbox-run-bubblewrap)
- Try building anything using the RE server
- hit `retry` when it fails
## Relevant logs and/or screenshots
[//]: # (Paste any relevant logs - please use code blocks ``` to format console output, logs, and code as it's hard to read otherwise. You can also add a Snippet and link it here. Check the markdown giude on Gitlab for further tips)
```
[00:00:06][dade3a10][ build:libhello.bst ] FAILURE Running commands
[00:00:06][dade3a10][ build:libhello.bst ] FAILURE System error when attempting to execute Action: [std::runtime_error exception thrown at [buildboxworker_worker.cpp:109], errMsg = "Could not find runner command "buildbox-run""]
Printing the last 20 lines from log file:
/home/buildstream/.cache/buildstream/logs/integration-commands/libhello/dade3a10-build.1479.log
======================================================================
USERNAME: tomjon
LOGNAME: tomjon
LC_ALL: C
HOME: /tmp
TZ: UTC
SOURCE_DATE_EPOCH: '1320937200'
[--:--:--] INFO libhello.bst: Using a remote sandbox for artifact libhello.bst with directory '/home/buildstream/.cache/buildstream/build/libhello-z9lucqrt'
[--:--:--] START libhello.bst: Staging dependencies
[--:--:--] START base/alpine.bst: Staging base/alpine.bst/b795a72d
[00:00:00] SUCCESS base/alpine.bst: Staging base/alpine.bst/b795a72d
[--:--:--] START base.bst: Staging base.bst/c51be276
[00:00:00] SUCCESS base.bst: Staging base.bst/c51be276
[00:00:00] SUCCESS libhello.bst: Staging dependencies
[--:--:--] START libhello.bst: Running commands
ldconfig "/usr/lib"
[--:--:--] START : Waiting for the remote build to complete
[00:00:01] SUCCESS: Waiting for the remote build to complete
[00:00:06] FAILURE libhello.bst: Running commands
[00:00:06] FAILURE libhello.bst: System error when attempting to execute Action: [std::runtime_error exception thrown at [buildboxworker_worker.cpp:109], errMsg = "Could not find runner command "buildbox-run""]
======================================================================
[--:--:--][ ][ main:core activity ] BUG 'NoneType' object has no attribute 'was_workspaced'
Traceback (most recent call last):
File "/usr/lib64/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/home/buildstream/workspace/buildstream/src/buildstream/_scheduler/scheduler.py", line 458, in real_schedule
self._sched_queue_jobs()
File "/home/buildstream/workspace/buildstream/src/buildstream/_scheduler/scheduler.py", line 406, in _sched_queue_jobs
queue.enqueue(elements)
File "/home/buildstream/workspace/buildstream/src/buildstream/_scheduler/queues/queue.py", line 184, in enqueue
self._enqueue_element(elt)
File "/home/buildstream/workspace/buildstream/src/buildstream/_scheduler/queues/queue.py", line 367, in _enqueue_element
status = self.status(element)
File "/home/buildstream/workspace/buildstream/src/buildstream/_scheduler/queues/artifactpushqueue.py", line 39, in status
if element._skip_push():
File "/home/buildstream/workspace/buildstream/src/buildstream/element.py", line 1767, in _skip_push
if self.__get_tainted():
File "/home/buildstream/workspace/buildstream/src/buildstream/element.py", line 2407, in __get_tainted
workspaced = self.__artifact.get_metadata_workspaced()
File "/home/buildstream/workspace/buildstream/src/buildstream/_artifact.py", line 341, in get_metadata_workspaced
self._metadata_workspaced = artifact.was_workspaced
AttributeError: 'NoneType' object has no attribute 'was_workspaced'
```
----
Contributor guide
Research direction
Start with the traceback path in src/buildstream/element.py, src/buildstream/_artifact.py, and src/buildstream/_scheduler/queues/artifactpushqueue.py, then reproduce the failed remote build and retry flow described in the issue. Done means a failed build with no artifact can be retried without the NoneType was_workspaced error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100