gitlab-runner using ssh fails
Summary
The gitlab-runner using ssh executer fails before ssh connection is established
Steps to reproduce
A simple project has an assigned pipeline connected to a gitlab-runner. The pipline process is activated but fails within seconds before trying to connect via ssh. Commandline SSH connection to runner machine is working.
.gitlab-ci.yml
# This is a simple example illustrating how to build and test .NET Core project
# with GitLab Continuous Integration / Continuous Delivery.
image: microsoft/dotnet:latest
# ### Define variables
#
variables:
# 1) Name of directory where restore and build objects are stored.
OBJECTS_DIRECTORY: 'obj'
# 2) Name of directory used for keeping restored dependencies.
NUGET_PACKAGES_DIRECTORY: '.nuget'
# 3) A relative path to the source code from project repository root.
# NOTE: Please edit this path so it matches the structure of your project!
SOURCE_CODE_PATH: '*/*/'
# ### Define stage list
#
# In this example there are only two stages.
# Initially, the project will be built and then tested.
stages:
- build
# ### Define global cache rule
cache:
# Per-stage and per-branch caching.
key: "$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG"
paths:
# Specify three paths that should be cached:
#
# 1) Main JSON file holding information about package dependency tree, packages versions,
# frameworks etc. It also holds information where to the dependencies were restored.
- '$SOURCE_CODE_PATH$OBJECTS_DIRECTORY/project.assets.json'
# 2) Other NuGet and MSBuild related files. Also needed.
- '$SOURCE_CODE_PATH$OBJECTS_DIRECTORY/*.csproj.nuget.*'
# 3) Path to the directory where restored dependencies are kept.
- '$NUGET_PACKAGES_DIRECTORY'
policy: pull-push
# ### Restore project dependencies
before_script:
- 'dotnet restore --packages $NUGET_PACKAGES_DIRECTORY'
build:
stage: build
script:
- 'dotnet build --no-restore'
Actual behavior
Job fails with error:
Running with gitlab-runner 12.1.0 (de7731dd)
on Runner on Paros z_kmXv5a
Using SSH executor ...
The command "$ 'bash'" is either misspelled or
could not be found.
The command "$ 'bash'" is either misspelled or
could not be found.
ERROR: Job failed: Process exited with: 1. Reason was: ()
There is no trafic visible using wireshark.
Expected behavior
At least connection established in wireshark
Relevant logs and/or screenshots
job log
Add the job log
Environment description
Gitlab-ce (12.1.6) is installed as custom installation on ubuntu server (18.04.3 LTS). The gitlab-runner (12.1.0) is installed on Win10 (1903), where SSH server is installed. The runner uses ssh; terminal connection vom gitlab host to runner host is working.
config.toml contents
concurrent = 1
check_interval = 0
log_level = "debug"
[session_server]
session_timeout = 1800
[[runners]]
name = "Runner on Paros"
url = "https://<server>/"
token = "z_kmXv5axJgx6RaBcr4r"
executor = "ssh"
[runners.custom_build_dir]
[runners.ssh]
user = "<user>"
password = "<password>"
host = "<hostname>"
port = "22"
identity_file = "C:\\Users\\<user>/.ssh/id_rsa"
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.custom]
run_exec = "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
Used GitLab Runner version
Version: 12.1.0
Git revision: de7731dd
Git branch: 12-1-stable
GO version: go1.8.7
Built: 2019-07-19T13:52:54+0000
OS/Arch: windows/amd64
Used GitLab Runner verify
Runtime platform arch=amd64 os=windows pid=14752 revision=de7731dd version=12.1.0
Verifying runner... is alive runner=z_kmXv5a