tilt-dev / tilt

Define your dev environment as code. For microservice apps on Kubernetes.
https://tilt.dev/
Apache License 2.0
7.47k stars 293 forks source link

Tilt syncback does not work on WSL2 (Linux subsystem for Windows) #6336

Open pmualaba opened 4 months ago

pmualaba commented 4 months ago

Expected Behavior

Given the following config in Tiltfile:

syncback(
  'schema',
  'deploy/api',
  '/app/',
  paths=['schema.gql'],
  target_dir='./apps/api/',
  namespace='btp',
  rsync_path='/tmp/rsync.tilt'
)

When i trigger the update in the Tiilt UI syncback should execute successfully. (Task should be green) This configuration works on Macbook M1 but not on Windows WSL2 (Ubuntu 22.04)

Current Behavior

Instead i get the following error in WSL2:

Running cmd: /home/pmualaba/.local/share/tilt-dev/tilt_modules/github.com/tilt-dev/tilt-extensions/syncback/krsync.sh 'deploy/api -n btp' /tmp/rsync.tilt -aOv --progress --stats -T=/tmp/rsync.tilt '--include=schema.gql***' '--exclude=*' syncback:/app/ ./apps/api/
RSYNC_PATH: --rsync-path=/tmp/rsync.tilt
K8S_OBJECT: deploy/api -n btp
RSYNC_TILT_PATH: /tmp/rsync.tilt
KRSYNC_TAR_PATH: /home/pmualaba/.local/share/tilt-dev/tilt_modules/github.com/tilt-dev/tilt-extensions/syncback/rsync.tilt.tar
krsync_callback_path: /tmp/rsync.tilt.krsync/krsync-callback.sh
@: -aOv --progress --stats -T=/tmp/rsync.tilt --include=schema.gql*** --exclude=* syncback:/app/ ./apps/api/
receiving incremental file list
command terminated with exit code 139
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 139) at io.c(231) [Receiver=3.2.7]
rsync: [Receiver] write error: Broken pipe (32)
Build Failed: Command "/home/pmualaba/.local/share/tilt-dev/tilt_modules/github.com/tilt-dev/tilt-extensions/syncback/krsync.sh 'deploy/api -n btp' /tmp/rsync.tilt -aOv --progress --stats -T=/tmp/rsync.tilt '--include=schema.gql***' '--exclude=*' syncback:/app/ ./apps/api/" failed: exit status 139

image

Steps to Reproduce

1. 2. 3. 4.

Context

tilt doctor Output


$ tilt doctor
❯ tilt doctor
Tilt: v0.33.10, built 2023-12-15
System: linux-amd64
---
Docker
- Host: unix:///var/run/docker.sock
- Server Version: 25.0.3
- API Version: 1.44
- Builder: 2
- Compose Version: v2.24.5
---
Kubernetes
- Env: k3d
- Context: orbstack
- Cluster Name: k3d-orbstack
- Namespace: btp
- Container Runtime: containerd
- Version: v1.27.4+k3s1
- Cluster Local Registry: none
---
Thanks for seeing the Tilt Doctor!
Please send the info above when filing bug reports. 💗

The info below helps us understand how you're using Tilt so we can improve,
but is not required to ask for help.
---
Analytics Settings
--> (These results reflect your personal opt in/out status and may be overridden by an `analytics_settings` call in your Tiltfile)
- User Mode: opt-out
- Machine: f803152fdad6f68fdaaef11e91f0af2d
- Repo: 

#### About Your Use Case
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
nicks commented 4 months ago

what version of rsync do you have running on your local machine?

"exit status 139" says to me that rsync is segfaulting, so it's likely this is not a tilt issue, but a broken rsync install

pmualaba commented 4 months ago

My rsync verion in WSL2 linux is:

❯ rsync --version
rsync  version 3.2.7  protocol version 31
Copyright (C) 1996-2022 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, symlinks, symtimes, hardlinks, hardlink-specials,
    hardlink-symlinks, IPv6, atimes, batchfiles, inplace, append, ACLs,
    xattrs, optional secluded-args, iconv, prealloc, stop-at, no crtimes
Optimizations:
    SIMD-roll, no asm-roll, openssl-crypto, no asm-MD5
Checksum list:
    xxh128 xxh3 xxh64 (xxhash) md5 md4 sha1 none
Compress list:
    zstd lz4 zlibx zlib none
Daemon auth list:
    sha512 sha256 sha1 md5 md4

In the Container rsync.tilt version is:

settlemint@api-54ff4fb5fd-hxmwv:/app$ /tmp/rsync.tilt --version
rsync  version v3.2.3  protocol version 31
Copyright (C) 1996-2020 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, hardlink-specials, symlinks, IPv6, atimes,
    batchfiles, inplace, append, no ACLs, xattrs, optional protect-args,
    iconv, symtimes, prealloc, stop-at, no crtimes
Optimizations:
    SIMD, asm, openssl-crypto
Checksum list:
    xxh64 (xxhash) md5 md4 none
Compress list:
    zstd lz4 zlibx zlib none

So protocol version 31 is the same for both. Should this work like this?

pmualaba commented 4 months ago

I downgraded my local version in WSL2 to 3.2.3 (same as rsync.tilt in the container) but still same error

❯ rsync --version
rsync  version 3.2.3  protocol version 31
Copyright (C) 1996-2020 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, hardlink-specials, symlinks, IPv6, atimes,
    batchfiles, inplace, append, ACLs, xattrs, optional protect-args, iconv,
    symtimes, prealloc, stop-at, no crtimes
Optimizations:
    SIMD, no asm, openssl-crypto
Checksum list:
    xxh128 xxh3 xxh64 (xxhash) md5 md4 none
Compress list:
    zstd lz4 zlibx zlib none