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

Errno::ENAMETOOLONG #53

Closed
cstewart87 opened this issue Jan 22, 2014 · 10 comments
Closed

Errno::ENAMETOOLONG #53

cstewart87 opened this issue Jan 22, 2014 · 10 comments

Comments

@cstewart87
Copy link

Running test-kitchen for ossec cookbook and come across this error. It's issued during the chef-client run, which leads my to believe it's something with chef-zero. Could me wrong tho.

Stacktrace:

[2014-01-22T17:17:27+00:00] DEBUG: HTTP 1.1 500 Internal Server Error
       [2014-01-22T17:17:27+00:00] DEBUG: content-type: text/plain
       [2014-01-22T17:17:27+00:00] DEBUG: server: chef-zero

       [2014-01-22T17:17:27+00:00] DEBUG: connection: close
       [2014-01-22T17:17:27+00:00] DEBUG: content-length: 13481
       [2014-01-22T17:17:27+00:00] DEBUG: ---- End HTTP Status/Header Data ----

       [2014-01-22T17:17:27+00:00] DEBUG: Expected JSON response, but got content-type 'text/plain'
       [2014-01-22T17:17:27+00:00] INFO: HTTP Request Returned 500 Internal Server Error:


       ================================================================================
       Error Resolving Cookbooks for Run List:
       ================================================================================


       Unknown Server Error:
       ---------------------
       The server had a fatal error attempting to load the node data.



       Server Response:
       ----------------
       Exception raised!  #<Errno::ENAMETOOLONG: File name too long - {"name":"ossec","description":"Installs/Configures ossec","long_description":"Description\n====\n\nInstalls OSSEC from source in a server-agent installation. See:\n\nhttp://www.ossec.net/main/manual/manual-installation/\n\nRequirements\n====\n\nTested on Ubunt
.....
.....
.....
@sethvargo
Copy link
Contributor

I've also gotten this error. In Ruby, filenames are limited to 255 characters, because <reasons>. I think we'll need to look into SHAing files or something. In the meantime, you can shorten the name of your Test Kitchen suite.

@cstewart87
Copy link
Author

Can't seem to replicate it anymore, however, I had forgotten to run berks update after updating the metadata.rb and that seemed to resolve things. Strange error for that sort of thing, I'll keep any eye out for anything else like that.

In regard to the filename being to long, you'll notice that the filename it was trying to use was actually the contents of the node data (hard to see because I cut off some of the stacktrace).

@sethvargo sethvargo reopened this Jan 22, 2014
@sethvargo
Copy link
Contributor

@cstewart87 it wasn't; that's just a bad stacktrace. This is a real error that we need to deal with at some point.

@stevendanna
Copy link
Contributor

@sv As a heads up, it isn't just a Ruby limitation. Ext3 and Ext4 both have a max filename length of 255 bytes. I'm unsure about other filesystems.

@sethvargo
Copy link
Contributor

@stevendanna how does the Chef Server handle this limitation /cc @seth

HighwayofLife added a commit to HighwayofLife/chef-zero that referenced this issue Jan 30, 2014
metadata.json contents are being read into from_json ... JSON.parse as a filename rather than passed the filename which from_json is actually expecting. This change passes in the filename of the metadata.json file rather than the contents.
@stevendanna
Copy link
Contributor

Does anyone have a reproduction case of this? If so, can you post the details here and/or post the full stack trace?

@sethvargo
Copy link
Contributor

@stevendanna @paulmooring had something yesterday

@HighwayofLife
Copy link

[2014-02-01T20:10:05-08:00] ERROR: #<Errno::ENAMETOOLONG: File name too long - {
         "name": "fm_services",
         "description": "Shared Services components coobook",
         "long_description": "",
         "maintainer": "David Lewis",
         "maintainer_email": "<snip>",
         "license": "Proprietary",
         "platforms": {
           "centos": ">= 0.0.0",
           "redhat": ">= 0.0.0"
         },
         "dependencies": {
           "fm_nexus": ">= 0.0.0",
           "fm_tomcat": ">= 0.0.0",
           "java": ">= 0.0.0",
           "fm-base": ">= 0.0.0",
           "fm_logstash_agent": ">= 0.0.0",
           "openssl": ">= 0.0.0",
           "minitest-handler": ">= 0.0.0"
         },
         "recommendations": {
         },
         "suggestions": {
         },
         "conflicting": {
         },
         "providing": {
         },
         "replacing": {
         },
         "attributes": {
         },
         "groupings": {
         },
         "recipes": {
         },
         "version": "2.0.22"
       }
       >
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-zero-1.7.2/lib/chef_zero/cookbook_data.rb:77:in `read'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-zero-1.7.2/lib/chef_zero/cookbook_data.rb:77:in `from_json'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-zero-1.7.2/lib/chef_zero/cookbook_data.rb:42:in `metadata_from'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/chef_fs/chef_fs_data_store.rb:366:in `get_single_cookbook_version'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/chef_fs/chef_fs_data_store.rb:181:in `list'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-zero-1.7.2/lib/chef_zero/rest_base.rb:55:in `list_data'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-zero-1.7.2/lib/chef_zero/endpoints/environment_cookbook_versions_endpoint.rb:24:in `block in post'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-zero-1.7.2/lib/chef_zero/endpoints/environment_cookbook_versions_endpoint.rb:16:in `each'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-zero-1.7.2/lib/chef_zero/endpoints/environment_cookbook_versions_endpoint.rb:16:in `post'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-zero-1.7.2/lib/chef_zero/rest_base.rb:29:in `call'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-zero-1.7.2/lib/chef_zero/rest_router.rb:23:in `call'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-zero-1.7.2/lib/chef_zero/server.rb:335:in `block in make_app'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/puma-1.6.3/lib/puma/server.rb:412:in `call'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/puma-1.6.3/lib/puma/server.rb:412:in `handle_request'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/puma-1.6.3/lib/puma/server.rb:306:in `process_client'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/puma-1.6.3/lib/puma/server.rb:215:in `block in run'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/puma-1.6.3/lib/puma/thread_pool.rb:94:in `call'
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/puma-1.6.3/lib/puma/thread_pool.rb:94:in `block in spawn_thread'

@HighwayofLife
Copy link

The version of chef_zero in chef chef-11.8.2-1 that was downloaded to the Vagrant VM via Chef Omnibus (latest) was asking for a filename, however the latest version in master is asking for a json string. There is a bug in the current "stable" version, but the current version of master appears to work fine.
The question I have is... from the .kitchen.yml file, how would I specify it pull the latest version of chef_zero from master?

@sethvargo
Copy link
Contributor

@HighwayofLife that is not currently possible. I'll see about cutting a new release.

jeffbyrnes added a commit to evertrue/exhibitor-cookbook that referenced this issue Oct 5, 2015
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants