Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkins startup is not detected when Jenkins security is enabled #25

Open
tcihak opened this issue Jan 23, 2015 · 6 comments
Open

Jenkins startup is not detected when Jenkins security is enabled #25

tcihak opened this issue Jan 23, 2015 · 6 comments

Comments

@tcihak
Copy link

tcihak commented Jan 23, 2015

The "Timed out waiting for Jenkins to start." message is displayed after 90 seconds even though Jenkins has started up successfully.

The root cause is in the "wait_for_jenkins.sh" bash script.
The "curl" command always returns a value of 22 since the page returns a 403.
To fix this, I removed the -k option from both "curl" calls.

@stisti
Copy link
Owner

stisti commented Feb 1, 2015

Could you give more details what kind of security you have configured? I don't really understand how removing the -k option helps because that option should allow curl to skip SSL certificate verification.

@tcihak
Copy link
Author

tcihak commented Feb 2, 2015

I removed the -f option and not the -k option. Sorry for the confusion.

@stisti
Copy link
Owner

stisti commented Feb 3, 2015

Yes, that would explain it. Without the -f option curl will exit with 0
even if the server responded something else than 200 OK. But what kind of
security setting did you use to prevent even Jenkins front page from
loading?

2015-02-02 15:32 GMT+02:00 Ted Cihak notifications@github.com:

I removed the -f option and not the -k option. Sorry for the confusion.


Reply to this email directly or view it on GitHub
#25 (comment).

@tcihak
Copy link
Author

tcihak commented Feb 3, 2015

We are using:
1.) Role-Based Strategy Plugin
2.) Jenkins Global Security (any security realm and Role-Based Strategy auth)
3.) No anonymous access (in Assign Roles)

This configuration causes the Jenkins front page to be a login page.

Let me know if need more detailed instructions than this.

@RuslanZasukhin
Copy link

Hi, first of all thank you for great tool for MacOS users! It really saves life :)

We also have role-based security. And me also have see this message about timeout, after 90 second. In fact it is just annoying and never harm.

but exists one more trouble related to
curl -jk 'jenkins_url'

when exists security. If try to copy command into terminal,
$ curl -fk 'http://localhost:8080//computer/api/xml?xpath=/*/busyExecutors'

You can see error
curl: (22) The requested URL returned error: 403 Forbidden

In terminal I can add
$ curl -fk 'http://user:passw@localhost:8080//computer/api/xml?xpath=/*/busyExecutors'

to resolve this, but I was not able way to fix this in Jenkins.app.
I have try edit main script, this not helps...

And may be this is serious trouble, because if Jenkins.app cannot correctly see if Jenkins is busy, it do not set caffeine ... And we have some troubles with -- slave go offline last days... This is why I have start to look into this more deeply.

Does exists any way, to provide login/password into Jenkins.app? Or other workaround?

@MoonMobilityAdmin
Copy link

Hi,
For case no anonymous access i modified script "wait_for_jenkins.sh":

#!/bin/bash
timeout=$(($(date +%s) + 90))
statuscode=$(curl -s --output /dev/null --write-out "%{http_code}" "$1")
logger -t Jenkins.app "Jenkins is not responding yet, sleeping... " and "$statuscode"
while [ $(date +%s) -lt $timeout ] && [ $statuscode -eq 000 ] ; do
    logger -t Jenkins.app "Jenkins is not responding yet, sleeping... " and "$statuscode"
    sleep 1
    statuscode=$(curl -s --output /dev/null --write-out "%{http_code}" "$1")
done
logger -t Jenkins.app "Not waiting any longer Jenkins" and "$statuscode"
statuscode=$(curl -s --output /dev/null --write-out "%{http_code}" "$1")
if [ $statuscode -eq 000 ]
then
    exit 1
else
    exit 0
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants