A pipeline step had privileged: true but wasn’t configured as trusted so the build got rejected but stills shows as pending, the UI only shows Restart and not Cancel option, even tho I’ve tried to run drone build stop [build-number] I only got 404 error.
If I do drone build queue the pending build stays there.
I’m able to reproduce it with a private repo, tried on a new server with public repo and didn’t reproduce it.
Steps to reproduce it
1.- Private repo
2.- Trigger a build with privileged: true & the repo setting as trusted.
3.- Remove the trusted setting for the repo.
4.- Restart the previous build and the new build will stuck.
ah ok, yes, changing from trusted to untrusted and then re-starting the build caused a problem. The system assumes that a build that previously executed without error can be safely restarted without performing certain bounds checks. Changing the trusted flag to false would cause a linting error on restart. So it looks like you found an edge case where that assumption does not hold true, resulting in an uncaught exception in the code.
Uncaught exceptions, because they are not expected, can put a build in an inconsistent state and therefore prevent it from being cancelled. You can go into the database and run the following command to resolve:
update builds set build_status = 'error'