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

rsync-auto not ignoring folders in exclusions lists, fail because of permissions issue #12927

Closed
kamuridesu opened this issue Sep 29, 2022 · 4 comments

Comments

@kamuridesu
Copy link

I have a folder that only root can access in my project containing sensitive data and don't want it to be exposed in the VM so I added it to the exclusion list. But rsync-auto keeps failing because it doesn't have permission to the folder, where it doesn't have to check at all.

Debug output

https://gist.githubusercontent.com/kamuridesu/9db490f11d32a5c0c45393d9d6ebe396/raw/180facd7df0740de043082ade45f97d805ad94e7/vagrant_rsync_auto.log

Expected behavior

Synchronize folders, ignoring the paths on rsync__exclude.

Actual behavior

Error, trying to add files that lack permission.

Reproduction information

Vagrant version

Vagrant 2.3.0

Host operating system

Arch Linux Rolling Release
Kernel: 5.19.11-arch1-1

Guest operating system

Debian 10 "Buster"
Kernel: 4.19.0-18-amd64

Steps to reproduce

  1. have a folder with only root permission
  2. add it to the exclusion list
  3. try to use rsync-auto
  4. see the error

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

  config.vm.box = "debian/buster64"
  config.vm.box_check_update = false
  config.vm.network "private_network", ip: "192.168.56.100"
  #
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "4000"
    vb.cpus = "4"
  end
  config.vm.provision "shell", path: "configs/shell/provision.sh"
  config.vm.synced_folder ".", "/vagrant", type: "rsync",
    rsync__exclude: [".git/", "data/", "data/*", "data/**", "data/postgres"]
end
@kamuridesu kamuridesu added the bug label Sep 29, 2022
@kamuridesu
Copy link
Author

It seems to be related: #4248 (comment)

@soapy1
Copy link
Contributor

soapy1 commented Jan 18, 2023

This looks like its related to an issue with the listen gem guard/listen#557. Seems to be only effecting linux host.

@soapy1
Copy link
Contributor

soapy1 commented Jan 20, 2023

Once #13066 is merged this problem can be avoided using the polling method (as suggested by guard/listen#251 (comment)). This can be enabled in Vagrant by running vagrant rsync-auto --poll

@soapy1 soapy1 modified the milestones: 2.3, 2.3.5 Jan 20, 2023
@soapy1
Copy link
Contributor

soapy1 commented Feb 8, 2023

I'm going to go ahead and close this issue now that #13066 is merged. This problem can now be avoided using vagrant rsync-auto --poll (using the polling option). This workaround must be used when running on a mac host due to limitations around how file checking works.

@soapy1 soapy1 closed this as completed Feb 8, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants