Jenkins workspace error on ssh&Mercurial plugin - ssh

I met this problem when I was trying to config Jenkins to fetch the repository on the server of a fellow(university course).
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/TEST1/workspace
$ hg clone --rev default --noupdate ssh://XXX#partch.anu.edu.au/XXX/XXX /var/lib/jenkins/jobs/TEST1/workspace
remote: Host key verification failed.
abort: no suitable response from remote hg!
ERROR: Failed to clone ssh://XXX#partch.anu.edu.au/XXX/XXX
ERROR: Failed to clone ssh://XXX#partch.anu.edu.au/XXX/XXX
Finished: FAILURE
Then I tried to do the same command in terminal, with the different error
abort: Permission denied: /var/lib/jenkins/jobs/TEST1/workspace
I tried to change the location for the command:
hg clone --rev default --noupdate ssh://XXX#partch.anu.edu.au/XXX/XXX /home/administrator/TEST
And it works
According to all these, and the fact that this is no workspace(Error: no workspace)--I know it's because of no successful build ever.
Is it a problem with the workspace configuration of Jenkins? but don't know what to do.
Thank you very much if anyone gives me some advice!

Your error doesn't mention anything about a workspace. There error clearly states that it comes from remote hg and it is an authentication failure.
Also, are you using the Mercurial Plugin to perform the SCM checkout or trying to replicate it with a Build Shell build step?

Related

Error while cloning Thunderbird's Mercurial repository

I wanted to clone the Mozilla Thunderbird repository to my PC.
I used the official guide (here) and tried to clone several times, but after a few minutes it always throws an error.
there is always the same following error message:
abort: An existing connection was forcibly closed by the remote host
transaction abort!
rollback completed
[Code 255]
I used this command for cloning:
hg clone --verbose https://hg.mozilla.org/mozilla-central "C:\Users\...\source\"
(userpath shortened)

Q: Sourcetree error : 'git status' failed with code -1"

Sourcetree showing this error 'git status' failed with code -1" while trying access project from bookmark, also I can't clone any other project from remote list or manual by url.
SSH connection is good. Command
ssh -T git#github.com showing - Hi "name"! You've successfully authenticated, but GitHub does not provide shell access.
Command git clone also works fine and fetch project.
Resolved by clicking options > git > Use System Git and set to use System Git Version.

How to use personal github access token with gitlab runner

I mirrored a private repository from Github to run builds with gitlab runner. My project has private gems hosted on Github and the build is failing with
Fetching git#github.com:private/gem.git
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Retrying `git clone 'git#github.com:private/gem.git' "/builds-ci/gitlab/repo/vendor/ruby/2.4.0/cache/bundler/git/gem-a356dd016736a58b8b77677e8d7df689f8f43ada" --bare --no-hardlinks --quiet` due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git#github.com:private/gem.git' "/builds/gitlab-ci/repo/vendor/ruby/2.4.0/cache/bundler/git/gem-a356dd016736a58b8b77677e8d7df689f8f43ada" --bare --no-hardlinks --quiet` in directory /builds/gitlab-ci/repo has failed.Host key verification failed.
fatal: Could not read from remote repository.
I used personal Github access token to mirror private repositories from Github to Gitlab. There is a way to use Github access token to clone private gems with bundler without the need to set up SSH keys:
export BUNDLE_GITHUB__COM=x-access-token:<token>
Do I need to create a separate access token and paste it into .gitlab-ci.yml
image: ruby:2.4.1
variables:
BUNDLE_GITHUB__COM=x-access-token:<token>
...
Or I can use the token which I used to mirror repositories from Github? Like this
variables:
BUNDLE_GITHUB__COM=x-access-token:$SOME_GITLAB_JOB_ACCESS_TOKEN
?
I managed to do it with adding BUNDLE_GITHUB__COM to .gitlab-ci.yml commiting it to the source code for now:
# .gitlab-ci.yml
variables:
BUNDLE_GITHUB__COM=x-access-token:<token>
...

How to use ssh for gitlab scheduled jobs

We recently changed our repo to use SSH and now our scheduled jobs wont run
This is the error we are seeing
Running with gitlab-runner 10.2.0 (0a75cdd1)
on ff (4b9268cd)
Using Shell executor...
Running on pro1.staging.cardstream.net...
Cloning repository...
Cloning into '/home/gitlab-runner/builds/4b9268cd/0/Graham/QA_TEST'...
fatal: repository 'http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx#dev.cardstream.com/Graham/QA_TEST.git/' not found
ERROR: Job failed: exit status 1
I would be grateful if someone could shed some light on this
Thanks
It seems that I have misunderstood after being misled by various internet postings.
It not possible to have gitlab use ssh when cloning a project within a job

dotcloud push on cygwin fails with "rsync error: unexplained error (code 255)" (similar with git and hg)

Though I have followed the usual steps for using the dotCloud CLI under Cygwin, dotcloud push fails in all cases: --rsync, --hg, and --git.
I am on Windows 8 and Cygwin.
How can I push successfully?
Sample output:
me#host /cygdrive/d/project
$ dotcloud push --rsync
==> Pushing code with rsync from "./" to application myapp
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at /home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/io.c(605) [sender=3.0.9]
me#host /cygdrive/d/project
$ dotcloud push --git
Permission denied (publickey,password).r from "./" to application myapp
fatal: The remote end hung up unexpectedly
me#host /cygdrive/d/project
$ dotcloud push --hg
==> Pushing code with mercurial from "./" to application myapp
abort: no suitable response from remote hg!
Error: Mercurial returned a fatal error
You may be running into a bug in Cygwin's group permissions. Vineet Gupta gives a workaround in his blog. The problem comes from the very strict permissions expected by ssh around the keys, and the solution is to set the permission on the ssh key properly (to 600, rw by owner only). Cygwin seems to need the group to be added manually.
Updating the steps to get the dotCloud CLI installed, including setting the permissions, leads to:
Start the Cygwin Setup.
Select default choices until you reach the package selection dialog.
Enable the following packages:
net/openssh
net/rsync
devel/git
devel/mercurial
python/python (make sure it’s at least 2.6!)
web/wget
After the installation, you should have a Cygwin icon on your desktop. Start it: you will get a command-line shell.
Download easy_install
wget http://peak.telecommunity.com/dist/ez_setup.py
Install easy_install
python ez_setup.py
You now have easy_install; let’s use it to install pip:
easy_install pip
Now install dotcloud (the CLI)
pip install dotcloud
Set up the CLI with your credentials. This will also download the ssh key.
dotcloud setup
New Step Update the permissions on your dotCloud key:
chgrp Users ~/.dotcloud_cli/dotcloud.key
chmod 600 ~/.dotcloud_cli/dotcloud.key
Now you should be able to dotcloud push
If you have multiple dotCloud accounts, then you will need to repeat this process for each account, since each account has its own key. Also note that you shouldn't have to set these permissions manually, but it seems like the group ownership is sometimes the wrong default in Cygwin. Linux and OSX don't seem to show this problem, though the permissions must be 600 for all OSes, so it is worth checking.