juju scp: ERROR when copying between units needs better error message.

Bug #1619404 reported by Andrew James Beach on 2016-09-01
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Problem encountered with 2.0-beta16-xenial-amd64 with a controller hosted on lxd 2.0.4. Replicated with aws.

juju scp works copying to and from units. However trying to directly copy between two units produces the following message:

ERROR exit status 1 (Host key verification failed.
lost connection)

And the operation fails.

Error replicated in juju 2.0-beta17 with both lxd and aws.

description: updated
Anastasia (anastasia-macmood) wrote :

Please paste the command that you have used.

'juju help scp' mentions an example for copying between units:
Copy file.dat from machine 0 to the machine hosting unit foo/0 (-3
causes the transfer to be made via the client):

    juju scp -- -3 0:file.dat foo/0:

Please note that -3 in the above command is important! According to scp man, it "copies between two remote hosts are transferred through the local host. Without this option the data is copied directly between the two remote hosts. Note that this option disables the progress meter."

Juju client can connect to the 2 Juju managed hosts, but the hosts can't connect to each other, so -3 works around that.

If your command included -3, it would also be helpful to know the commands that you have used to setup your environment. It will help us to replicate the bug exactly.

Changed in juju:
status: New → Incomplete

OK so it doesn't work without -3, for example:

juju scp ubuntu@0:test-file ubuntu@1:~

But it does

... Sorry wrong button.

This doesn't work:

    juju scp ubuntu@0:test-file ubuntu@1:~

Along with using unit names (eg. wiki/0:). However added the -3 flag does seem to fix the problem.

    juju scp -- -3 ubuntu@0:test-file ubuntu@1:~

But only when using machine ids, using unit names, as in:

    juju scp -- -3 ubuntu@wiki/0:test-file ubuntu@mysql/0:~
    juju scp -- -3 wiki/0:test-file mysql/0:~


    ERROR exit status 1

This is with the wiki-simple charm, which I had set up with a straight deploy to experiment with the ssh, run and scp commands.

The initial problem however did seem to just be the missing -3 flag. Should it be assumed when moving between two machines/units or at least mentioned in the error message?

Anastasia (anastasia-macmood) wrote :


Error exit by itself is interesting. Could you please also attach the log for unit, it's machine and the controller machine? We'd like to see what exactly is causing this error.

Sorry, but which logs? For which error and from where? I'm still sorting out a lot of details about the system.

Anastasia (anastasia-macmood) wrote :


Controller machine logs can be found on controller machine, 'juju ssh' into it and look in /var/logs/juju.

The same location on unit machine will have unit logs as well.

OK, I got all four of the machine & unit logs.

It was trying to move a file (test-file) from wiki/0 on machine 1 to mysql/0 on machine 0. Set up is from a deploy wiki-simple.

Although I took a look at them and not much seems to have made it to the log files after the creation of the units.

Changed in juju:
status: Incomplete → Triaged
importance: Undecided → High
milestone: none → 2.0-rc1
Changed in juju:
milestone: 2.0-rc1 → 2.0.0
Changed in juju:
assignee: nobody → Richard Harding (rharding)
Richard Harding (rharding) wrote :

So to be clear:

- unit to unit scp is not supported. The client must be involved and the -3 is the path to do that.
- The error message when attempting scp between two units isn't ideal. We'll look to address that in this bug.
- scp with -3 works between machines, but not for unit identifiers.

juju scp --debug -- -3 mysql/0:/var/log/syslog wiki/0:/home/ubuntu/mysql-syslog
13:50:34 INFO juju.cmd supercommand.go:63 running juju [2.0-rc1 gc go1.6.2]
13:50:34 DEBUG juju.cmd supercommand.go:64 args: []string{"juju", "scp", "--debug", "--", "-3", "mysql/0:/var/log/syslog", "wiki/0:/home/ubuntu/mysql-syslog"}
13:50:34 INFO juju.juju api.go:72 connecting to API addresses: [[fdf0:1fb4:8efd:dfd2:216:3eff:fe16:7dd9]:17070]
13:50:34 INFO juju.api apiclient.go:507 dialing "wss://[fdf0:1fb4:8efd:dfd2:216:3eff:fe16:7dd9]:17070/model/4716a2e5-f79a-4113-88d4-712f0af1f1fd/api"
13:50:34 INFO juju.api apiclient.go:302 connection established to "wss://[fdf0:1fb4:8efd:dfd2:216:3eff:fe16:7dd9]:17070/model/4716a2e5-f79a-4113-88d4-712f0af1f1fd/api"
13:50:34 DEBUG juju.juju api.go:263 API hostnames unchanged - not resolving
13:50:34 DEBUG juju.cmd.juju.commands ssh_common.go:226 proxy-ssh is false
13:50:34 DEBUG juju.utils.ssh ssh.go:298 using OpenSSH ssh client
13:50:35 DEBUG juju.api apiclient.go:558 health ping failed: connection is shut down
13:50:35 ERROR cmd supercommand.go:458 exit status 1
13:50:35 DEBUG cmd supercommand.go:459 (error details: [{exit status 1}])

Yes, that matches what I found when I was examining it. I don't know if anything has changed since 17.

Changed in juju:
milestone: 2.0.0 → 2.1.0
Changed in juju:
assignee: Richard Harding (rharding) → nobody
Anastasia (anastasia-macmood) wrote :

Updated the title and lowered the Importance.
This bug is now about providing a better error message to the user when 'juju scp' between units fails. It would be great to have the hint of '-3' as part of the error message.

summary: - juju scp: ERROR when copying between units.
+ juju scp: ERROR when copying between units needs better error message.
Changed in juju:
importance: High → Medium
tags: added: usability
Curtis Hovey (sinzui) on 2017-02-17
Changed in juju:
milestone: 2.1-rc2 → none
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers