fgrehm / vagrant-cachier

Caffeine reducer
http://fgrehm.viewdocs.io/vagrant-cachier
MIT License
1.08k stars 111 forks source link

Assuming that vagrant executor has uid 1000 #66

Closed gionn closed 10 years ago

gionn commented 10 years ago

Hi,

I'm using vagrant+lxc under jenkins and vagrant-cachier doesn't play well with it.

The problem is that the permissions/ownership of the cache folder (created by tomcat user) aren't compatible with the commands that get executed inside the vm (I think via the default vagrant user, with uid 1000).

Is there a way to deal with non-standard uid executing vagrant?

Bringing machine 'mysql' up with 'lxc' provider...
[mysql] Importing base box 'opscode-precise-lxc'...
[...]
[mysql] Setting up mount entries for shared folders...
[mysql] -- /vagrant
[mysql] -- /tmp/vagrant-cache
[mysql] -- /tmp/vagrant-chef-1/chef-solo-1/cookbooks
[mysql] Warning! The LXC provider doesn't support any of the Vagrant public / private
network configurations (ex: `config.vm.network :private_network, ip: "some-ip"`).
They will be silently ignored.
[mysql] Starting container...
[mysql] Waiting for machine to boot. This may take a few minutes...
[mysql] Machine booted and ready!
[mysql] Setting hostname...
[mysql] Installing Chef 11.8.2 Omnibus package...
[mysql] Downloading Chef 11.8.2 for ubuntu...
[mysql] Installing Chef 11.8.2
[mysql] (Reading database ... 
[mysql] 26840 files and directories currently installed.)
[mysql] Preparing to replace chef 11.6.2-1.ubuntu.12.04 (using .../chef_11.8.2_amd64.deb) ...
[mysql] Unpacking replacement chef ...
[mysql] Setting up chef (11.8.2-1.ubuntu.12.04) ...
[mysql] Thank you for installing Chef!
[mysql] Configuring cache buckets...
An error occurred while executing multiple actions in parallel.
Any errors that occurred are shown below.

An error occurred while executing the action on the 'mysql'
machine. Please handle this error then try again:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mkdir -p /tmp/vagrant-cache/apt/partial

Stdout from the command:

Stderr from the command:

mkdir: cannot create directory `/tmp/vagrant-cache/apt': Permission denied
fgrehm commented 10 years ago

Unfortunately the problem is on vagrant-lxc and a solution might be adding support for NFS on the provider or build a base box with the proper uid in place =/

Please join us at https://github.com/fgrehm/vagrant-lxc/issues/151