Sudo times out waiting for password on Ubuntu 12.04

We use sudo to add the JDK unlimited strength security policy files to the JVM so we can use strong encryption in Java:

sudo unzip -jo security-api/src/test/resources/UnlimitedJCEPolicyJDK7.zip -d /usr/lib/jvm/jdk1.7.0/jre/lib/security/ 

When this command ran this morning (this has been the first build of this repo in a few weeks), sudo prompted for a password:

[sudo] password for ubuntu: 
command sudo unzip -jo security-api/src/test/resources/UnlimitedJCEPolicyJDK7.zip -d /usr/lib/jvm/jdk1.7.0/jre/lib/security/ took more than 10 minutes since last output

This command ran successfully earlier – I wonder if this is related to the recent image updates for Ubuntu? We’re running this on the 12.04 image.

sudo does not ask for a password on Ubuntu 14.04.

Hi,

It’s hard for me to say if it really should be running that long without knowing what your entire build is doing and the zip file contents. How long did that line use to take?

This may only be a bandaid but based on the problem showed here, using the timeout modifier for that line might help. By default CircleCI kills commands that hit 10 minutes. You can increase that timeout. Here’s the referenced doc.

I hope that helps.

Thank you for your response, but I think you misunderstood the problem.

Per this post on the CircleCI blog, sudo should not ask for a password on a CircleCI build machine, and this is how CircleCI machines have worked until recently.

The reason that sudo is timing out is not because the command takes a long time to run, but because sudo asks for a password (which it should not) and times out waiting for the password to be entered.

Finally, sudo on CircleCI only asks for a password on Ubuntu 12.04, not on 14.04. This leads me to suspect that it’s some kind of configuration problem on the Ubuntu 12.04 image.

You are completely correct, I misread. Looking into this now.

Haven’t been able to replicate this so far on Ubuntu 12.04 myself. Would it be possible if you could PM me a link to your build having this issue? (You can click my username, then ‘message’ to PM me).