Known Issues

Issue: Invalid machine state when provisioning

With VirtualBox v4.3.14, when doing vagrant up, an error (or similar error) sometimes occurs saying:

Exception

The guest machine entered an invalid state while waiting for it to boot. Valid states are 'starting, running'. The machine is in the 'poweroff' state. Please verify everything is configured properly and try again. If the provider you're using has a GUI that comes with it, it is often helpful to open that and watch the machine, since the GUI often has more helpful error messages than Vagrant can retrieve. For example, if you're using VirtualBox, run vagrant up while the VirtualBox GUI is open.

Resolution:

To resolve the issue, downgrading to version VirtualBox v4.3.12 worked


Issue: ansible.host turned into executable file

Sometimes pulling the repository down will make ansible.host an executable file and will produce the following error:

Exception

ERROR: The file provisioners/ansible/ansible.host is marked as executable, but failed to execute correctly. If this is not supposed to be an executable script, correct this with chmod -x provisioners/ansible/ansible.host.

Resolution

To resolve the issue, run chmod -x provisioners/ansible/ansible.host


Issue: Ansible Provisioning fails when using Jenkins CLI

Sometimes this will happen because Jenkins is not fully online after a restart during provisioning. This is either because the sleep time isn't long enough or Jenkins takes a little longer to start.

Exception

failed: [54.69.156.112] => {"changed": true, "cmd": "java -jar /opt/jenkins/jenkins-cli.jar -s http://localhost:8080 list-jobs All", "delta": "0:00:06.720559", "end": "2014-09-30 14:49:18.306571", "rc": 1, "start": "2014-09-30 14:49:11.586012"}
stderr: Exception in thread "main" java.io.IOException: No X-Jenkins-CLI2-Port among [X-Jenkins, null, X-Hudson, X-Hudson-Theme, Content-Length, Expires, X-Jenkins-Session, Set-Cookie, Content-Type, Server, Cache-Control]
    at hudson.cli.CLI.getCliTcpPort(CLI.java:283)
    at hudson.cli.CLI.<init>(CLI.java:126)
    at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)
    at hudson.cli.CLI._main(CLI.java:466)
    at hudson.cli.CLI.main(CLI.java:382)
    Suppressed: java.io.IOException: Server returned HTTP response code: 503 for URL: http://localhost:8080/cli
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626)
        at hudson.cli.FullDuplexHttpStream.<init>(FullDuplexHttpStream.java:78)
        at hudson.cli.CLI.connectViaHttp(CLI.java:156)
        at hudson.cli.CLI.<init>(CLI.java:130)
        ... 3 more

FATAL: all hosts have already failed -- aborting

Resolution

To resolve this just run vagrant provision again and it will should resolve the issue


Issue: Ansible Provisioning with AWS fails with SSH Exception

When provisioning the Jenkins environment with AWS for the first time, the provisioning will fail for SSH reasons. This can be resolved by getting the Public IP Address of the created instance in your EC2 Console and replacing the Public IP Address within the /provisioners/ansible/ansible.host file.

Exception

GATHERING FACTS ***************************************************************
fatal: [127.0.0.1] => SSH encountered an unknown error during the connection.
We recommend you re-run the command using -vvvv, which will enable SSH
debugging output to help diagnose the issue

Resolution

Current File ( /provisioners/ansible/ansible.host )

[jenkins]
127.0.0.1 ansible_ssh_port=2222

Eg. of what to be updated to:

[jenkins]
54.69.58.64

then run:

$ vagrant provision

This will now provision the machine properly (given the IP address you put is correct).

NB. Note that the machine is already running and we do not need to run vagrant up again. Thus running vagrant provision will work just fine