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

Bad error message "no implicit conversion of String into Hash" on auth error #1

Open
henrik opened this issue Jun 3, 2014 · 3 comments

Comments

@henrik
Copy link

henrik commented Jun 3, 2014

Maybe this was fixed after 0.0.2; I'm afraid I can't easily check that at the moment.

I got this error:

no implicit conversion of String into Hash
/Users/henrik/.rvm/gems/ruby-2.1.0@barsoom_servers/gems/rest-client-1.6.7/lib/restclient/resource.rb:50:in `merge'
/Users/henrik/.rvm/gems/ruby-2.1.0@barsoom_servers/gems/rest-client-1.6.7/lib/restclient/resource.rb:50:in `get'
/Users/henrik/.rvm/gems/ruby-2.1.0@barsoom_servers/gems/proxmox-0.0.2/lib/proxmox.rb:346:in `http_action_get'
/Users/henrik/.rvm/gems/ruby-2.1.0@barsoom_servers/gems/proxmox-0.0.2/lib/proxmox.rb:137:in `openvz_get'

Basically the issue seems to be that create_ticket does @connection_status = "error" as the last thing in the error branch, meaning it returns the "error" string.

The Proxmox::Proxmox initializer sets @auth_params = create_ticket.

http_action_get does @site[url].get @auth_params … where @auth_params will be the "error" string instead of a hash, causing that confusing error message.

Would be nice if the message was clearer about the actual issue.

nledez pushed a commit that referenced this issue Nov 28, 2015
Add ssl options for rest connection
@Walter900
Copy link

Hi, I met same problem. How could u solved it

@henrik
Copy link
Author

henrik commented Sep 27, 2017

@Walter900 I think the issue I reported was just that you would get an incorrect error message when you couldn't authenticate (e.g. if you have the wrong password). So the fix for me was to use the right password. And I encouraged the proxmox project to clarify the error message.

@Walter900
Copy link

I got it! Thanks.

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

No branches or pull requests

2 participants