Fairly recently, these jobs have all been failing with the following error:
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
Exited with code 100
I am about to update that job to start with while sudo fuser /var/lib/apt/lists/lock >/dev/null 2>&1 ; do sleep 1; done or something similar, but this behavior is strange enough I figured it was worth a post here. It seems that the instance fires up and then, what, runs apt update on its own? Does it upgrade things as well? Either way, it feels like the commands shouldn’t execute until the instance is completely setup, and having apt still running implies that the instance is not completely setup. Thoughts?
Indeed, I see some posts, but no solutions (just more workarounds). The general feeling I get from those posts is that the machine executor doesn’t get much love, which is unfortunate. I’ll add the sleep workaround, but I don’t consider that a solution. I think CircleCI needs some image tweaks for their machine executor.