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

Dependency Resolution Broken on Windows 7 #140

Closed
tknerr opened this issue Sep 26, 2012 · 12 comments · Fixed by #176
Closed

Dependency Resolution Broken on Windows 7 #140

tknerr opened this issue Sep 26, 2012 · 12 comments · Fixed by #176
Labels
Milestone

Comments

@tknerr
Copy link
Contributor

tknerr commented Sep 26, 2012

Hey guys,

following the awesome cookbook authoring guide from Jamie Winsor I git stuck after adding the depends "artifact", "~> 0.10.7" tp metadata.rb.

What I got on the next bundle exec vagrant provision is this:

W:\tmp\myface>bundle exec vagrant provision
[Berkshelf] installing cookbooks...
[Berkshelf] Using myface (0.0.1) at path: 'W:/tmp/myface'
W:/tools/vagrant/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-0.6.0.beta1/lib/berkshelf/downloader.rb:91:in `download': Cookbook 'artifact'
f the default locations (Berkshelf::CookbookNotFound)
        from W:/tools/vagrant/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-0.6.0.beta1/lib/berkshelf/resolver.rb:127:in `install_source'
        from W:/tools/vagrant/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-0.6.0.beta1/lib/berkshelf/resolver.rb:47:in `add_source'
        from W:/tools/vagrant/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-0.6.0.beta1/lib/berkshelf/resolver.rb:71:in `block in add_source_
        from W:/tools/vagrant/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-0.6.0.beta1/lib/berkshelf/resolver.rb:68:in `each'
        from W:/tools/vagrant/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-0.6.0.beta1/lib/berkshelf/resolver.rb:68:in `add_source_dependenc
        from W:/tools/vagrant/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-0.6.0.beta1/lib/berkshelf/resolver.rb:26:in `block in initialize'
        from W:/tools/vagrant/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-0.6.0.beta1/lib/berkshelf/resolver.rb:25:in `each'
        from W:/tools/vagrant/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-0.6.0.beta1/lib/berkshelf/resolver.rb:25:in `initialize'
        from W:/tools/vagrant/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-0.6.0.beta1/lib/berkshelf/berksfile.rb:335:in `new'
...

Next I tried berks install but got the same problem:

W:\tmp\myface>berks install
Using myface (0.0.1) at path: 'W:/tmp/myface'
Cookbook 'artifact' not found in any of the default locations

My Berksfile looks like this:

site :opscode

metadata

and this is my metadata.rb:

name             "myface"
maintainer       "YOUR_NAME"
maintainer_email "YOUR_EMAIL"
license          "All rights reserved"
description      "Installs/Configures myface"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          "0.0.1"

depends "artifact", "~> 0.10.7"

I have tried several things like using site 'http://cookbooks.opscode.com/api/v1/cookbooks' instead of site :opscode, using a different cookbook ("mysql") with and without version constraints, but it didn't make a difference.

Am I doing something wrong?

Windows7 64-Bit, Ruby 1.9.3p125, berkshelf 0.6.0.beta1

@reset
Copy link
Contributor

reset commented Sep 26, 2012

I'll take a look and see if I can reproduce this

@tknerr
Copy link
Contributor Author

tknerr commented Sep 27, 2012

Cool, thanks! Btw: is there a debug switch that I could turn on for more logging output?

@reset
Copy link
Contributor

reset commented Sep 27, 2012

No - what kind of information are you looking for?

@tknerr
Copy link
Contributor Author

tknerr commented Sep 27, 2012

Nothing specifically, just some kind of debug logging if you will. Thought there might be --verbose flag or so...

@tknerr
Copy link
Contributor Author

tknerr commented Oct 1, 2012

Just tried 0.6.0.beta2, but still the same issue :-/

site 'http://cookbooks.opscode.com/api/v1/cookbooks'
cookbook 'nagios'
W:\tmp\myface>berks install
Cookbook 'nagios' not found in any of the default locations

@reset : could you reproduce this on a Windows box?

@reset
Copy link
Contributor

reset commented Oct 1, 2012

I haven't had a chance to attempt to reproduce it just yet. I don't have immediate access to Windows machines - I unfortunately need to go find one.

@justincampbell
Copy link
Contributor

@tknerr I'm unable to reproduce this with a new Berkshelf cookbook with metadata depending on nagios, or just an empty directory with the Berksfile above. Could you push a repo that recreates the issue?

@tknerr
Copy link
Contributor Author

tknerr commented Oct 24, 2012

Just cloned master today, built the gem and followed the first three steps of http://berkshelf.com/, which is probably the most simple scenario.

I'm running

V:\tmp\bstest2>bundle exec berks init
      create  Berksfile
      create  Gemfile
Successfully initialized

Then edit the Berksfile:

site :opscode

cookbook 'mysql'
cookbook 'nginx', '~> 0.101.5'

Then again I get the same issue upon berks install:

V:\tmp\bstest2>bundle exec berks install
Cookbook 'mysql' not found in any of the default locations

If its not something specific to my Windows 7 64-Bit installation, I suspect it might be some "bad" dependencies in my Gemfile.lock

Here's my Berksfile, Gemfile and Gemfile.lock: https://gist.github.com/3944902

@tknerr
Copy link
Contributor Author

tknerr commented Oct 28, 2012

I could finally trace it down to this line:
https://github.com/RiotGames/berkshelf/blob/master/lib/berkshelf/locations/site_location.rb#L56

It seems that I get a Permission Denied error when moving the file from the temporary location to the berkshelf:
Permission denied - (C:/Users/tkn/AppData/Local/Temp/d20121028-11204-fu4f3j/mysql, X:/home/.berkshelf/cookbooks/mysql-1.3.0)

@tknerr
Copy link
Contributor Author

tknerr commented Oct 28, 2012

No clue why, but FileUtils.mv in line #56 fails when moving the directory (note: you need to set force: false otherwise the error is silently swallowed):

FileUtils.mv(File.join(dir, name), cb_path, force: false)

On the other hand, doing an explicit copy / delete works:

FileUtils.cp_r(File.join(dir, name), cb_path)
FileUtils.rm_rf(File.join(dir, name))

@tknerr
Copy link
Contributor Author

tknerr commented Oct 28, 2012

This seems to be a common issue under windows, which could be caused by a virus scanner, as I read from here: http://www.ruby-forum.com/topic/1044813

@reset
Copy link
Contributor

reset commented Oct 29, 2012

Merged changes from @tknerr and closing. If this is still a problem please re-open the issue.

@reset reset closed this as completed Oct 29, 2012
thommay pushed a commit that referenced this issue Aug 30, 2016
Fixes: #140, Fixes: #214, Fixes: #1579

Signed-off-by: Thom May <thom@may.lt>
@berkshelf berkshelf locked and limited conversation to collaborators Jun 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants