Select Page

Jenkins Worker provisioning_refresh troubleshooting

The main task of this worker is to create a new provisioning profile every single day, save it in the developer repository and push it to the origin. This worker is triggered once every single day.

2-factor-authentication error 

Since end of february 2019 apple forces each developer to activate 2-factor-authentication for their developer accounts. That means, each trusted device has to enter a new 6 digit code every month. This task can’t be automated easily, so this error is unavoidable but quite easy to fix.

Error message

So in case you see the Jenkins worker failing, select the latest failed job in the web UI and press the button Console. Scroll down to the last few lines and check if you can see the following message: Please enter the 6 digit code: /Users/rheimhuber… What happens here is, that apple wants to verify and sends a 6 digit code, but since jenkins is connected via ssh, there is no way for the jenkins to present any Alert where you can type in the message.


The solution is, to trigger the job manually and enter the 6 digit code. Therefore do the following:

  • Connect to the Mac Mini via Team Viewer, or physically log in.
  • Open the command line and navigate to the directory /Users/rheimhuber/developer
  • Now execute the command $ ruby scripts/renew_provisioning.rb
  • The command start processing and you will be asked for the 6 digit code. This time however, since you’re on the machine without using ssh, the process will wait for your input
  • Now connect to our buildserver ( via Microsoft Remote Desktop. You will be asked for a login to the Windows machine. Therefore use 1 password and search for buildserver. I can’t share all credentials here, please ask Christian in that case.
  • Once logged in to the virtual machine, you will see a prompt which asks you, if you want to allow an incoming connection. Press “Allow”. Now the code will be visible to you. Use that code in the command line (Mac mini) where you were asked for and press enter. Now the script finishes and for the next 30 days, the script can be executed by jenkins again.
Was this helpful for you?