All of a sudden my builds are failing with gcloud failed to load: No module named six

My builds have started failing a few minutes ago after months of being successful. The error is “ERROR: gcloud failed to load: No module named six”. Could anyone point me in the right direction of figuring out how to fix this?

1 Like

Yep, same issue here. It started yesterday. The first time my build uses the gcloud command, it exits with the “ERROR: gcloud failed to load: No module named six” error. Have not figured out a workaround yet.

Ok, looks like changing every invocation of gcloud in my build file to sudo gcloud, and changing the order of my dependencies section to match this order exactly fixed the issue:

https://circleci.com/docs/continuous-deployment-with-google-container-engine/#circleyml

Still not sure what changed on the box in the first place to precipitate this.

1 Like

@klingerf Thank you for sharing you solution here!

@jrthib Could you try and let us know if that fixes it for you?

Best,
Zak

@zzak My commands were already prefixed with sudo. Just now I tried moving them to the dependencies section and everything decided to work. Previously, they were in the deployment section. Same commands, different location. Anyway, things seem to be deploying once again. So all is well!

Thanks for the help @klingerf and @zzak !

One more update. After switching all of the gcloud invocations over to use sudo, I was able to install the kubectl command again. But I didn’t actually try using it. It turns out installing kubectl with sudo results in a permissions issue, that I had to fix in my dependencies section, by adding:

    - sudo chown -R ubuntu:ubuntu /home/ubuntu/.kube

That’s in the doc I linked to yesterday, but I missed it. With that additional change now everything is working.