drrb / puppet-library

A private Puppet Forge
GNU General Public License v3.0
87 stars 20 forks source link

ArgumentError - string contains null byte #2

Closed josepedrocorreia closed 10 years ago

josepedrocorreia commented 10 years ago

Hi,

I'm getting this error message when serving domcleal/augeasproviders from a directory:

[root@tk132 ~]# puppet-library --port 9292 --module-dir /tmp/modules/
/usr/lib/ruby/gems/1.8/gems/haml-4.0.5/lib/haml/parser.rb:86: warning: regexp has invalid interval
Starting Puppet Library server:
 |- Port: 9292
 |- Host: default
 |- Server: default
 `- Forges:
    - PuppetLibrary::Forge::Directory: /tmp/modules/
[2014-02-07 12:25:47] INFO  WEBrick 1.3.1
[2014-02-07 12:25:47] INFO  ruby 1.8.7 (2011-06-30) [x86_64-linux]
[2014-02-07 12:25:47] WARN  TCPServer Error: Address already in use - bind(2)
[2014-02-07 12:25:47] INFO  WEBrick::HTTPServer#start: pid=30119 port=9292
ArgumentError - string contains null byte:
    /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader/entry.rb:66:in `join'
    /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader/entry.rb:66:in `full_name'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/forge/directory.rb:45:in `get_metadata'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/util.rb:84:in `find'
    /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:64:in `each'
    /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:55:in `loop'
    /usr/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:55:in `each'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/util.rb:83:in `find'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/forge/directory.rb:45:in `get_metadata'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/forge/directory.rb:42:in `map'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/forge/directory.rb:42:in `get_metadata'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/forge/abstract.rb:89:in `retrieve_metadata'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/forge/abstract.rb:43:in `get_module_metadata'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/forge/multi.rb:48:in `get_module_metadata'
    /usr/lib/ruby/1.8/webrick/utils.rb:73:in `inject'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/forge/multi.rb:46:in `each'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/forge/multi.rb:46:in `inject'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/forge/multi.rb:46:in `get_module_metadata'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/server.rb:69:in `GET /:author/:module.json'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1592:in `call'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1592:in `compile!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:957:in `[]'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:957:in `route!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:976:in `route_eval'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:957:in `route!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:997:in `process_route'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:995:in `catch'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:995:in `process_route'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:955:in `route!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:954:in `each'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:954:in `route!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1067:in `dispatch!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `invoke'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `catch'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `invoke'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1064:in `dispatch!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:889:in `call!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `invoke'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `catch'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `invoke'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:889:in `call!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:877:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-protection-1.5.2/lib/rack/protection/xss_header.rb:18:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-protection-1.5.2/lib/rack/protection/path_traversal.rb:16:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-protection-1.5.2/lib/rack/protection/json_csrf.rb:18:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-protection-1.5.2/lib/rack/protection/base.rb:50:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-protection-1.5.2/lib/rack/protection/frame_options.rb:31:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/logger.rb:15:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call_without_check'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:217:in `call'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:210:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/show_exceptions.rb:21:in `call'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:180:in `call'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:2004:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
    /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
    /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
    /usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/handler/webrick.rb:14:in `run'
    /usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
    /usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/server.rb:141:in `start'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/puppet_library.rb:125:in `start_server'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/../lib/puppet_library/puppet_library.rb:35:in `go'
    /usr/lib/ruby/gems/1.8/gems/puppet-library-0.7.0/bin/puppet-library:25
    /usr/bin/puppet-library:19:in `load'
    /usr/bin/puppet-library:19
tk132 - - [07/Feb/2014:12:25:54 CET] "GET /domcleal/augeasproviders.json HTTP/1.1" 500 199294
- -> /domcleal/augeasproviders.json

The content of /tmp/modules is the following:

[root@tk132 ~]# ls -la /tmp/modules/
total 212
drwxr-xr-x   2 root root   4096 Feb  7 12:23 .
drwxrwxrwt 296 root root  20480 Feb  7 12:22 ..
-rw-r--r--   1 root root 187172 Feb  7 12:23 domcleal-augeasproviders-1.0.2.tar.gz

And the file was downloaded directly from the Puppet Forge. (BTW, I can install it if Puppet Library is proxying the Puppet Forge.)

drrb commented 10 years ago

I tried this on Ruby 1.8.7 with Rubygems 2.0.14, and wasn't able to reproduce it. There are a couple of possibilities I can think of.

One possibility is that the problem's related to your version of Rubygems (where the error is raised). Looking at #1, it appears you're running Rubygems 1.3.7. Unfortunately I'm a bit limited with respect to testing on older versions of Ruby and Rubygems: I haven't been able to get the integration tests to run properly on them yet, so some bugs have been getting missed (actually, I found #3 when I was investigating this issue with Ruby 1.8.7!).

Another possibility is that the module file is corrupt. The version of domcleal/augeasproviders 1.0.2 from the Forge is 187123 bytes, which is different to the one you've got (187172 bytes). Try re-downloading the file from the forge, and seeing if that fixes the problem. Unfortunately, if it does fix the problem, it looks like you might also run into #3. I'll be releasing 0.8.0 shortly to resolve #3. Hopefully we'll get you up and running soon!

(EDIT: 0.8.0 is released, including enabled integration tests for Ruby 1.8.7)

josepedrocorreia commented 10 years ago

I upgraded to 0.8.0 and it seems to be working now, thanks!

drrb commented 10 years ago

No worries :) . Glad it fixed the problem!