Reputation: 21
I'm having some unexplained difficulty using the mercurial keyring extension with TortoiseHg (v2.11.1 64-bit) in Windows Server 2008R2.
The extension appears to be enabled (mercurial_keyring entry is present in mercurial.ini as well as the repo hgrc file), and I've set my default repo URL to pass my user account (e.g. 'default=http://username@my-host-name/reponame/
').
I've done a manual push from a command prompt to store my password in the windows credential store, which appears to work - subsequent pushes from the command prompt do not request authentication. I can also see the 'Mercurial' entry in the Windows Credential Store.
I have confirmed that my PATH environment variable points only to the hg.exe instance installed by TortoiseHg.
Finally, I have created a job in Jenkins that attempts to perform a commit and push on the same repo I did my test push against to store my credentials. The job, however, fails with the following message:
16:33:00 c:\_servers\Jenkins>hg push --debug
16:33:12 pushing to http://<username>@<my-host-name>/kiln/Code/<repo path>
16:33:12 using http://<my-host-name>/kiln/Code/<repo path>
16:33:12 http auth: user <username>, password not set
16:33:12 sending capabilities command
16:33:12 query 1; heads
16:33:12 sending batch command
16:33:12 searching for changes
16:33:12 all remote heads known locally
16:33:12 sending branchmap command
16:33:12 sending branchmap command
16:33:12 preparing listkeys for "bookmarks"
16:33:12 sending listkeys command
16:33:12 2 changesets found
16:33:12 list of changesets:
16:33:12 e7131cb8af1d3e64e678861c687d76025d3c639f
16:33:12 7bc85ba011df5c423244e3222efd7ebf6b5f0dd6
16:33:12 bundling: 1/2 changesets (50.00%)
16:33:12 bundling: 2/2 changesets (100.00%)
16:33:12 bundling: 1/2 manifests (50.00%)
16:33:12 bundling: 2/2 manifests (100.00%)
16:33:12 bundling: .hgignore 1/2 files (50.00%)
16:33:12 bundling: <mutated file list> 2/2 files (100.00%)
16:33:12 sending unbundle command
16:33:12 sending 685 bytes
16:33:12 sending: 0 kb
16:33:12 sending: 0 kb
16:33:12 [HgKeyring] Keyring URL: http://<my-host-name>/kiln/Code/<repo path>
16:33:12 [HgKeyring] Looking for password for user <username> and url `http://<my-host-name>/kiln/Code/<repo path>`
16:33:12 [HgKeyring] **Password not present in the keyring**
16:33:12 abort: mercurial_keyring: http authorization required but program used in non-interactive mode
I'm not sure what I'm doing wrong, or if this is just not a workable configuration, but I would certainly appreciate any suggestions. Thanks for your consideration.
Upvotes: 1
Views: 989
Reputation: 4245
You need to do a manual push as the user account that Jenkins runs under to store the password in that user's keyring in Windows.
Upvotes: 1