microsoft/VSLinux

Problem with rsync when generating CMake cache

IakovK opened this issue ยท 17 comments

Please use the following bug reporting template to help produce actionable and reproducible issues:

  • A brief description
    I am having a problem when trying to play with CMake project for Linux. The project (super simple) is attached.

  • Expected results
    Everything is done without errors.

  • Actual results (with build output window contents if applicable)
    1> Copying files to remote machine...
    1> rsync -t --delete --delete-excluded -v -r --exclude=.vs --exclude=.git /D/Projects/linuxproj/libyui/proj1/ rsync://jacob@localhost:51067/temp
    1> rsync: connection unexpectedly closed (0 bytes received so far) [sender]
    1> rsync error: error in rsync protocol data stream (code 12) at /C/Users/t-elmor/rsync-3.0.8-1-msys-1.0.17-src.tar/rsync-3.0.8-1-msys-1.0.17-src/rsync-3.0.8/io.c(601) [sender=3.0.8]
    1> Error while copying.

  • VC++ version, Linux system name and version, GCC/GDB/gdbserver version, CPU arch, etc. If you are using a specific version of Linux on an embedded board, we might need to know about it to get a repro on similar hardware

Microsoft Visual Studio Professional 2017
Version 15.8.7
VisualStudio.15.Release/15.8.7+28010.2046
Microsoft .NET Framework
Version 4.7.02556

Installed Version: Professional

Visual C++ 2017 00370-10006-38474-AA490
Microsoft Visual C++ 2017

Application Insights Tools for Visual Studio Package 8.13.10627.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017 15.8.05085.0
ASP.NET and Web Tools 2017

C# Tools 2.9.0-beta8-63208-01
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service 2.0
JavaScript Language Service

JavaScript Project System 2.0
JavaScript Project System

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package

MLGen Package Extension 1.0
MLGen Package Visual Studio Extension Detailed Info

NuGet Package Manager 4.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info

TypeScript Tools 15.8.20822.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 2.9.0-beta8-63208-01
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual C++ for Linux Development 1.0.9.27924
Visual C++ for Linux Development

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake 1.0
Visual Studio Tools for CMake

Visual Studio Tools for Universal Windows Apps 15.0.28010.2046
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Linux version: opensuse leap 15.0, cmake 3.10.2, rsync 3.1.3

  • Steps required to reproduce the error
    I don't know. I did the following: just open cmake project. When I click the Generate link at the top of the screen (in the message "C++ IntelliSense information may be out of date, generate the CMake cache to refresh. Generate - Settings"), the behaviour reproduces.
  • Required packages and commands to install

See our contributing instructions for assistance.

proj1.zip

15.9 was supposed to resolve this problem, but it did not for me:

rsync error: error in rsync protocol data stream (code 12) at /C/Users/t-elmor/rsync-3.0.8-1-msys-1.0.17-src.tar/rsync-3.0.8-1-msys-1.0.17-src/rsync-3.0.8/io.c(601) [sender=3.0.8]
1> Error while copying. Please see https://aka.ms/AA23jat for troubleshooting.

In version 15.9.2 the problem is still present :(

lukka commented

@aWeinzierl @Pitt14 it is possible that you have on the remote target a process (rsync) listening on the same port that is being tried by the rsync spawn by VS. Could you please ssh onto the remote machine and kill the process (e.g. 'pkill rsync' using the same user account you set up in VS) and retry again?
Please open this bug on the Developer Community forum, thanks!

I tried to do that with my test project:

  1. opened project, got the error message;
  2. killed rsync via ssh;
  3. clicked Generate at the top of the window.
    result: the same error message.

@lukka @elizabethmorrow can you take a look?

lukka commented

Closing as the issue is now present at Developer Community forums.

I have the same problem, none of the suggested workarounds (e.g. pkill rsync) really works. I'm on the latest VS 2019 Preview. Really sad that every time I try this, for the last year or two, there's still something that doesn't work out-of-the-box yet. And the displayed errors make it nigh impossible to try and find out what's going on without spending hours on it.

I wonder why can't they just revert that feature to the state when it worked? Don't they use version control systems?

@patrikhuber
Really sad that every time I try this, for the last year or two, there's still something that doesn't work out-of-the-box yet. And the displayed errors make it nigh impossible to try and find out what's going on without spending hours on it.
I sort of agree: It seems that the quality of Microsoft products deteriorates with every release (I use Windows and Visual Studio).

@IakovK To be fair this feature is evolving a lot, and in principle improving quite a lot. The problem I'd say is that there's so many things that can go wrong along the way. Maybe I've just been unfortunate. I'd love to use VS & direct CMake integration & WSL and it's awesome what MS is doing in that direction. I just wish their testing was a bit better, and the error messages were better, so you could do more about it (and more easily) when something goes wrong.

@patrikhuber
I don't know in which direction it is evolving. What is improving if the feature doesn't work? In first version it was poor (good for first version), but it worked. Good promise. In next update it just stopped working. Evolved. Now, given the Microsoft's attitude, I am afraid to install any updates: Who knows, maybe they are evolving it in such a direction that breaks what always worked? Code editor, for example.
Every next update is worse than previous one.
So, I won't update Visual Studio, I won't update Windows anymore. Every update is a risk to make the computer unusable.

I have the same problem, none of the suggested workarounds (e.g. pkill rsync) really works. I'm on the latest VS 2019 Preview. Really sad that every time I try this, for the last year or two, there's still something that doesn't work out-of-the-box yet. And the displayed errors make it nigh impossible to try and find out what's going on without spending hours on it.

I have the same problem. VS 2019 Preview 4.

For the reason stated above I am not going even to try VS 2019. Enough.

@lukka I have the same problem. VS 2019 Preview 4.

I also have the same problem, VS 2019 Preview 1

I also have the same problem with VS 2019 16.1.0 Preview 3.0. There is no remote rsync process running. I did turn on the "Cross Platform Logging" feature, and here's some useful log output:

10:45:22.7225428 [Info, Thread 70]	liblinux.RemoteSystemBase: Connecting over SSH to 172.17.79.107:22
10:45:23.0846376 [Info, Thread 70]	liblinux.IO.RemoteFileSystemImpl: Connecting over SFTP to 172.17.79.107:22
10:45:23.6747337 [Info, Thread 70]	liblinux.Shell.CommonCommandBase: Command "realpath -m -L ~/Documents/VisualStudio/NR/CMakeBuild/RaspberryPi-Debug/NetworkRedirector" finished with exit code 0 after 5.8713ms
10:45:23.7824315 [Info, Thread 70]	liblinux.Shell.CommonCommandBase: Command "basename '/home/vagrant/Documents/VisualStudio/NR/CMakeBuild/RaspberryPi-Debug/NetworkRedirector'" finished with exit code 0 after 102.9675ms
10:45:23.8892838 [Info, Thread 70]	liblinux.Shell.CommonCommandBase: Command "cat /proc/net/tcp | awk '{gsub(/.*:/,"",$2); print $2}' | sort -un" finished with exit code 0 after 99.4414ms
10:45:23.9960051 [Info, Thread 70]	liblinux.Shell.CommonCommandBase: Command "netstat -tln | awk '{gsub(/.*:/,"",$4); print $4}' | sort -un" finished with exit code 0 after 103.9003ms
10:45:24.0996402 [Info, Thread 70]	liblinux.Ssh.ShellStream: Writing "unset HISTFILE
" to SSH shell
10:45:24.0996402 [Info, Thread 70]	liblinux.Ssh.ShellStream: Writing "mkdir /var/tmp/40488/
" to SSH shell
10:45:24.1006450 [Info, Thread 70]	liblinux.Ssh.ShellStream: Writing "echo -e "pid file = /var/tmp/40488/rsyncd.pid 
lock file = /var/tmp/40488/rsyncd.lock 
log file = /var/tmp/40488/rsyncd.log 
port = 4444 
use chroot = False 
address = 127.0.0.1
[temp] 
path = /home/vagrant/Documents/VisualStudio/NR/CMakeBuild/RaspberryPi-Debug/NetworkRedirector 
comment =  
read only = no 
list = True 
uid = vagrant 
" > /var/tmp/40488/rsyncd.conf
" to SSH shell
10:45:24.1016434 [Info, Thread 70]	liblinux.Ssh.ShellStream: Writing "rsync --daemon --port=4444 --config=/var/tmp/40488/rsyncd.conf
" to SSH shell
10:45:24.1206039 [Info, Thread 70]	liblinux.Shell.CommonCommandBase: Command "ps aux | grep -v grep | grep 40488" finished with exit code 1 after 16.6895ms
10:45:24.2372956 [Info, Thread 70]	liblinux.Shell.CommonCommandBase: Command "ps aux | grep -v grep | grep 40488" finished with exit code 1 after 115.7894ms
10:45:24.3560303 [Info, Thread 70]	liblinux.Shell.CommonCommandBase: Command "ps aux | grep -v grep | grep 40488" finished with exit code 1 after 118.0576ms
10:45:24.4777184 [Info, Thread 70]	liblinux.Shell.CommonCommandBase: Command "ps aux | grep -v grep | grep 40488" finished with exit code 1 after 119.2303ms
10:45:24.5944128 [Info, Thread 70]	liblinux.Shell.CommonCommandBase: Command "ps aux | grep -v grep | grep 40488" finished with exit code 1 after 114.686ms
10:45:24.7160984 [Info, Thread 70]	liblinux.Shell.CommonCommandBase: Command "ps aux | grep -v grep | grep 40488" finished with exit code 1 after 120.1363ms

This continues until it times out. I checked for myself, and I see that the /var/tmp/40488/ directory doesn't exist. If I run the commands from the log myself, Visual Studio will connect, but the next time around, the /var/tmp/40488/ directory gets deleted.

We believe this is not fixed in VS 2019, if this is still a problem for you, please open a feedback ticket on the Developer Community

We retired this issue list, here on Github. We now adopted and using the Developer Community (https://developercommunity.visualstudio.com/spaces/62/index.html), for Cross Plat and Linux experiences (and C++ all up generally), which we are actively monitoring. Please use the Developer Community, to report issues or suggestions for bugs or new experiences. Further discussions on this thread here on Github might be unmonitored. If there is further comments or context in this current issue, please create a new issue on the Developer Community and mention it there.