fgrehm / vagrant-cachier

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

404 errors on apt-get install when cache is enabled #109

Closed snowch closed 10 years ago

snowch commented 10 years ago

The following Vagrantfile works fine:

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

    config.vm.box = "opscode-ubuntu-13.04-64"                                                                     
    config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-13.04_chef-provisionerless.box"                                                                                                 

    if Vagrant.has_plugin?("vagrant-cachier")                                                                     
       config.cache.scope = :box
       config.cache.auto_detect = false                                                                            
    end                                                                                                           
    config.vm.provision "shell", inline: $script                                                                  
end                                                                                                               

$script = <<SCRIPT                                                                                                
apt-get update                                                                                                    
wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb                                                     
dpkg -i puppetlabs-release-precise.deb
apt-get update                                                                           
apt-get install puppetmaster -y                                                                                   
SCRIPT                                                                                                            

However, if I enable cachier by commenting out this line:

#config.cache.auto_detect = false

I receive 404 errors:

...
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/r/ruby1.9.1/libruby1.9.1_1.9.3.194-8.1ubuntu1.1_amd64.deb  404  Not Found [IP: 91.189.88.153 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/r/ruby1.9.1/ruby1.9.1_1.9.3.194-8.1ubuntu1.1_amd64.deb
  404  Not Found [IP: 91.189.88.153 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

The error may be due to installing puppet master from precise on raring, but even so I would expect it to fail the same whether the cache was enabled or disabled?

fgrehm commented 10 years ago

I haven't had a chance to look into this yet but can you please try removing the cache dir completely on the host and try again? If that doesn't work please LMK

snowch commented 10 years ago

Unfortunately, removing the cache dir did not work - same error.

fgrehm commented 10 years ago

That sucks =/ I'll try to use that Vagrantfile to reproduce the issue when I have a chance. If you have any new information please let us know!

tknerr commented 10 years ago

same here in #113

@snowch does this happen on a Windows or Linux host?

snowch commented 10 years ago

Windows IIRC.

fgrehm commented 10 years ago

On that case, there's another issue about disabling the apt-lists bucket for windows hosts, please keep an eye on that :-)