Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

NameError: wrong constant name 500Error #66

Closed
lardcanoe opened this issue Jun 11, 2014 · 3 comments
Closed

NameError: wrong constant name 500Error #66

lardcanoe opened this issue Jun 11, 2014 · 3 comments
Labels

Comments

@lardcanoe
Copy link

Another:

NameError: wrong constant name 500Error
File "org/jruby/RubyModule.java" line 2634 in const_set
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/lib/aws/errors.rb" line 92 in set_error_constant
File "org/jruby/ext/thread/Mutex.java" line 149 in synchronize
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/lib/aws/errors.rb" line 87 in set_error_constant
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/lib/aws/errors.rb" line 80 in error_class
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/lib/aws/error_handler.rb" line 29 in error
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/lib/aws/error_handler.rb" line 19 in call
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/vendor/seahorse/lib/seahorse/client/response.rb" line 36 in on
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/lib/aws/error_handler.rb" line 12 in call
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/lib/aws/plugins/retry_errors.rb" line 78 in call
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/lib/aws/response_handler.rb" line 12 in call
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/lib/aws/request_handler.rb" line 14 in call
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/lib/aws/plugins/response_paging.rb" line 9 in call
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/lib/aws/plugins/user_agent.rb" line 12 in call
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/vendor/seahorse/lib/seahorse/client/plugins/restful_bindings.rb" line 13 in call
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/vendor/seahorse/lib/seahorse/client/plugins/endpoint.rb" line 27 in call
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/vendor/seahorse/lib/seahorse/client/plugins/param_validation.rb" line 22 in call
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/vendor/seahorse/lib/seahorse/client/plugins/raise_response_errors.rb" line 14 in call
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/vendor/seahorse/lib/seahorse/client/plugins/param_conversion.rb" line 22 in call
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/vendor/seahorse/lib/seahorse/client/request.rb" line 70 in send_request
File "/home/releases/vendor/bundle/jruby/1.9/gems/aws-sdk-core-2.0.0.rc8/vendor/seahorse/lib/seahorse/client/plugins/operation_methods.rb" line 42 in describe_cache_clusters
@trevorrowe
Copy link
Contributor

Thank you for reporting the issue. Could you enable http wire logging and recreate this error? It looks like we are attempting to create an error class from the error code returned, and are picking an invalid constant name.

Also a small sample of code the produces this error would be helpful. Thanks.

@lardcanoe
Copy link
Author

This is one of those once or twice out of a million calls types of errors :-)

Just saw this one 976709b#diff-7bb6bea58245fdef5cb01fe9d9120178R40 is it related?

If the fix isn't obvious without the detailed logs, then we can just close this.

@trevorrowe
Copy link
Contributor

Yes, it looks like a related issue. S3 follows the HTTP spec by not returning a body in response to certain HTTP requests, (like HEAD). In these situations, S3 can not return an xml description of the error. For these, we have to infer the error code from the HTTP status code, hence the mapping. When there is not a mapping from numeric status code to a string error code, the S3 code was attempting to generate an error class like "412", which is not a valid constant name.

I'm going put together a patch that ensures we don't attempt to create error classes with numeric names, like "500Error".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants