Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "You must supply a valid value to --key" #5

Open
jaredcnance opened this issue Oct 11, 2016 · 2 comments
Open

Getting "You must supply a valid value to --key" #5

jaredcnance opened this issue Oct 11, 2016 · 2 comments

Comments

@jaredcnance
Copy link

jaredcnance commented Oct 11, 2016

Below is the output:

2016-10-11T18:25:39.4778610Z ##[section]Starting: Docker compose
2016-10-11T18:25:39.8598660Z [command]/bin/bash /home/docker-user/Agents/a1/_work/_tasks/lambda3docker_e3b19710-626e-11e6-865c-3771efe12c4b/0.7.2/dockerTask.sh --compose --env Debug --server mysite.centralus.cloudapp.azure.com --port 2200 --user myadmin --key -----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY----- --project myproject
2016-10-11T18:25:39.8730780Z Exporting variables supplied as arguments...
2016-10-11T18:25:39.8847870Z Variables exported.
2016-10-11T18:25:39.8854000Z You must supply a valid value to --key. Value supplied (first 20 characters):
2016-10-11T18:25:39.8859220Z -----BEGIN
2016-10-11T18:25:39.8898400Z Docker script failed:/bin/bash failed with return code: 13
2016-10-11T18:25:39.9549440Z ##[section]Finishing: Docker compose

I have tried two things, using the total output of cat id_rsa (as shown above) with the new lines replaced with \n. And I have tried using just the key with the new lines replaced with \n.

I'm not sure what I'm doing wrong here. This is the key I use when I SSH into the host as well.

@jaredcnance
Copy link
Author

So, I was able to reproduce this locally (using dockerTask.sh) and found that this passes (https://github.com/Lambda3/vsts-build-task-docker/blob/master/lambda3docker/dockerTask.sh#L146) if I add quotation marks around the argument.

image

However, now it is throwing the following:

2016-10-11T20:02:00.5047650Z Killing existing ssh.
2016-10-11T20:02:00.5128330Z /home/docker-user/Agents/a1/_work/_tasks/lambda3docker_e3b19710-626e-11e6-865c-3771efe12c4b/0.7.2/dockerTask.sh: line 36: kill: (1205) - Operation not permitted
2016-10-11T20:02:00.5134010Z Return code was not zero but 1
2016-10-11T20:02:00.5156610Z Docker script failed:/bin/bash failed with return code: 231

@giggio
Copy link
Contributor

giggio commented Oct 29, 2016

I usually have an SSH_KEY secure variable:
image

And use it like that:
image

The error you are showing is on line 36:
https://github.com/Lambda3/vsts-build-task-docker/blob/master/lambda3docker/dockerTask.sh#L36

It happens when we are trying to kill an existing ssh connection. What are the messages that come before that? Is it a Connecting... one, or a Could not connect to server one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants