Search code examples
jenkins-x

Why jx install runs chrome to get the admin token?


When I run jx install I get those error messages

Attempting to find the Jenkins API Token with the browser in headless mode...using url http://jenkins.jx.35.205.149.20.nip.io/me/configure
unable to automatically find API token with chromedp using URL http://jenkins.jx.35.205.149.20.nip.io/me/configure
retrying after error:Running in batch mode and no default api token found

Unfortunatly, I'm running those install script from an Ansible docker container. As a consequence, I have no chrome installed in container (neither do I have an X environment and window manager).

So why is this token retrieved ? And is there a way to set it "by hand" (through another jx command, as an example) ?


Solution

  • there’s currently no other way with Jenkins to get an API token until we move to ephemeral / one shot masters rather than static masters.

    We could disable the use of Chrome though? If it cannot use Chrome to get the API token the code asks you to visit the URL and copy/paste the api token from the Jenkins console