Password prompt when buildg from bitbucket server.

marcel.sottnik's Avatar

marcel.sottnik

15 Jan, 2021 12:24 AM

Hiya forum,

I get a password prompt when trying to build a project stored at bitbucket server. I have connection to the bitbucket (could add the project). What is wrong with my settings?

Here my appveyor.yml

configuration: Release

# restore packages before running MSBuild
before_build:
    - nuget restore

# package Web Application project for Web Deploy
build:
    verbosity: minimal
    publish_wap: true

here is the message:

Build started
git clone -q --branch=master git@<code>:<project>/<project>.git /home/appveyor/projects/<project>-<code>
git@bitbucket.<domain>.<domain>'s password:

Where does the username git comes from? I didn't set anything like that.

  1. Support Staff 1 Posted by Feodor Fitsner on 15 Jan, 2021 05:07 AM

    Feodor Fitsner's Avatar

    What is <code> in your URL? It should be host name.

    If it's a private repository AppVeyor should add an SSH key to the repository when you add a new project. Was it added in your case? If not, try configuring it manually. You can find a public key on "General" tan of project settings.

  2. 2 Posted by marcel.sottnik on 15 Jan, 2021 10:37 AM

    marcel.sottnik's Avatar

    Hi Feodor,

    the key is properly created in the repository access keys and is the same as the one in General tab. The user git is existing on the bitbucket and has rights to the repository. The code is an alphanumeric code, no hostname. Appveyor and bitbucket are on the same server, but the configured links points on the public address. But sitll, I could make a link to bitbucket as I could link the project directly from there.

  3. Support Staff 3 Posted by Feodor Fitsner on 16 Jan, 2021 04:09 AM

    Feodor Fitsner's Avatar

    Alright, I see it's a self-hosted AppVeyor Server installation. To clone a repo via SSH AppVeyor should create ~/.ssh/config file and put a private RSA key into ~/.ssh directory. Check what you have in those files. Try cloning manually to see if that works with those keys/settings. Also, make sure ssh.exe is in PATH.

  4. 4 Posted by marcel.sottnik on 17 Jan, 2021 12:46 AM

    marcel.sottnik's Avatar

    So the problem is, that there is missing option for the ssh port in the entry created in .ssh/config file by appveyor. The bitbucket server git over ssh is different from the standard system sshd and the port for it cannot be the standard one. It seems the option for the port should be added in the appveyor.
    It's probably also practical to be able to specify the user under which appveyor clones the repo.
    Currently I don't see any possible workaround to this problem, because every build creates it's own entry for the connection in the .ssh/config file. So even if I change the config file manually it won't help, because after failed build it will be abandoned.

  5. Support Staff 5 Posted by Feodor Fitsner on 17 Jan, 2021 01:00 AM

    Feodor Fitsner's Avatar

    While looking through the history of support cases looks like I've found a solution.

    Try configuring the following environment variable on project settings page or in appveyor.yml:

    APPVEYOR_CLONE_SSH_PORT: 7999
    

    7999 should be Bitbucket Server SSH port. Cloning URL should switch to ssh:// if custom port specified.

    Let me know if that worked.

  6. 6 Posted by marcel.sottnik on 17 Jan, 2021 01:04 AM

    marcel.sottnik's Avatar

    Wonderful! That worked like a charm!

  7. Support Staff 7 Posted by Feodor Fitsner on 17 Jan, 2021 01:05 AM

    Feodor Fitsner's Avatar

    Cool, thanks for the update!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac