teamcityteamcity-9.0sourcegear-vault

Generate new session token when connecting to Vault from TeamCity Vault plugin


I am using the "Vault (experimental)" VCS plugin when setting up a new VCS Root, which I did a few weeks ago.

Our Vault server is restarted every night.

When I click "Test Connection" in the "Edit VCS Root" page today I get

Test connection failed in Proj1 :: Main :: BuildWithNoTests Main {internal id=3}: Exception occurred while trying to connect to Vault server. See original message below:

Session is no longer valid. Either the server restarted, or your session timed out. You must login again to re-authenticate.

I didn't explicity login using the VCS plugin so don't know how to do so again. How do I force the Vault plugin to get a new session token from the Vault server?

Also is it possible to configure this to happen say every day at 7am ?

Thanks


Solution

  • It is not possible at present to force the plugin to generate a new session token.

    I found a workaround though, which was to change the Vault session timeout to 60 mins. Once this was done the TeamCity Vault plugin would retrieve a fresh token as required and everything worked as required.

    The one annoying thing is that I had to use a new Vault user as the users I had previously used (when the timeout was 7 days) still won't connect. I'm guessing the plugin caches the token until it has expired.