Reputation: 1419
I installed TeamCity on Windows Server 2012. It has been working fine setting up a few builds. I then attempted to install some plugins by putting .zip files in the ~/.BuildServer/plugins folder. I restarted the server by cd'ing to c:\TeamCity\bin and running "runAll stop" followed by "runAll start".
Then when I go to the teamcity page for several minutes I get a "Enter the maintenance authentication token" page. It says on the page to find the maintenance token in the teamcity-server.log file (see screenshot below). I look in c:\TeamCity\logs\teamcity-server.log and it has several "super user token" and "agent authorizationtoken". I tried using these token but get an invalid maintenance token error.
So my question is where do I find the maintenance token?
Edit: This has resolved itself for me since upgrading to the latest TeamCity version. None of the suggested answers worked at the time I had this problem so that's why I am not marking anything as the accepted answer.
Upvotes: 10
Views: 8492
Reputation: 1
you can exec this command in docker or search "Super user authentication token" in log file
cat /opt/teamcity/logs/teamcity-server.log|grep "Super user authentication token"
Upvotes: 0
Reputation: 1
You will find multiple super user authentication token in the file specified (TeamCity\logs\teamcity-server). You can always use the last one in the file. (if there is not one in the last line, try logon with random number, you can get an authorization failed message with the token number included and it will be added to the file)
Upvotes: 0
Reputation: 101
Didn't work for me.
I rebooted then found the superuser token in TeamCity/logs/teamcity-server.log
Upvotes: 0
Reputation: 2832
If you cannot find in the log, just type a random value. The web ui will inform you that entered an invalid token.
Afterwards go to the log (TeamCity/logs/teamcity-server.log
) and check the last line:
[2018-03-27 17:55:20,258] WARN - jetbrains.buildServer.STARTUP - Failed maintenance authentication from IP address /86.234.23.62 with token: "6056431478480274143". Current authentication token: "6418830881320521552"
Upvotes: 0
Reputation: 1031
if you are hitting on this issue https://youtrack.jetbrains.com/issue/TW-43100 in TeamCity (v10.0.4) for IE, you may need to enable javascript and also add the url to IE trusted site list.
Upvotes: 0
Reputation: 71
open cmd
goto TeamCity instalation folder
C:\TeamCity\bin
type
runAll.bat stop
wait until services stoped then type
runAll.bat start
u will see current authentication token in console,.
Upvotes: 6
Reputation: 68750
Took me a while to find it, but it's in the file as indicated, but it's the very last line.
Upvotes: 2
Reputation: 129
Had the same issue it is the Superuser token you want (it will be the last line in the log unless you have tried to login - which will show in here as failures)
Along the lines of
Administrator can login from web UI using authentication token: 1234567890
/Edited so line in log file is more obviously a quote and added an example token thanks @Kleopatra,
Upvotes: 3
Reputation: 153
Please check out file teamcity-winservice.log in logs subfolder of your Teamcity. Auth token should be here.
Upvotes: 10
Reputation: 160892
It should be in the file teamcity-server.log
which is in the logs
subfolder of your TeamCity installation - look for the text "Administrator login is required from web UI using authentication token" and a long number afterwards which is your token.
Also see the docs for TeamCity Maintenance Mode.
Upvotes: 4