Intel® VTune™ Profiler- Collection failed due to SCP failing to copy files from the host to the target

ID 662889
Updated 12/8/2016
Version Latest
Public

author-image

By

Intel® VTune™ Profiler uses SCP as a mechanism to copy files to and from the host and the target system, while performing a remote collection. 

Often, you may encounter an issue where VTune Amplifier will stop with the "Collection failed" error with a sub-message like:

Collection failed. The data cannot be displayed. Cannot copy [some_file] to [some_remote_destination] on target. Please check scp command. 

As the error message says, you may first test if the SCP command works. To do this, you may try to copy a simple file:

scp -v my_file.txt user@remote_host:/home/[remote_user]/Desktop

For the above to work, you need to set up a password-less SSH connection to your remote host. (See the section "Setup target to not require a password" from this link for more information)

Example:

I have a file called my_settings.txt on the desktop of my local machine and I want to copy that file on the Desktop of my remote machine with a hostname remotetarget (mapped to an IP address in /etc/hosts) and username targetuser:

scp /home/hostuser/Desktop/mysettings.txt targetuser@remotetarget:/home/targetuser/Desktop/mysettings.txt

If the above command works, then you know SCP is working fine.

Problem: 

Often, SCP will fail without any meaningful error, with the verbose output finishing on Exit status 0. The issue is based on a known bug reported here and is simply due to the remote shell outputting some text.

If when you do ssh targetuser@remotetarget and you see some text being printed, you would want to log on the target machine and comment the outputs (defined in ~/.bash_profile or ~/.bashrc).

Removing the printed outputs should resolve the SCP problem.

Another option could be to check if one is in an interactive shell through the $PS1 variable and subsequently preventing the execution of the rest of the script. This can be done by adding the following on the first line of your .bashrc script:

if [ -z "$PS1" ]; then
   return
fi​

You probably came to this article experiencing this SCP problem. I hope this article helps solve the problem.