Project

General

Profile

Actions

Bug #19159

closed

Session authentication doesn't work with Restclient < 1.8

Added by Tomáš Strachota almost 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
High
Category:
Other commands
Difficulty:
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Session authentication doesn't work with restclient 1.8 that we use on production installs.
The authenticator expects http request to have uri set but this change was introduced post 1.8.

[DEBUG 2017-04-04 07:17:49 API] Using authenticator: HammerCLIForeman::Api::SessionAuthenticatorWrapper
[ERROR 2017-04-04 07:17:49 API] undefined method `hostname' for nil:NilClass
[DEBUG 2017-04-04 07:17:49 API] #<NoMethodError: undefined method `hostname' for nil:NilClass>
[ERROR 2017-04-04 07:17:49 Exception] Error: undefined method `hostname' for nil:NilClass
Error: undefined method `hostname' for nil:NilClass
[ERROR 2017-04-04 07:17:49 Exception]

NoMethodError (undefined method `hostname' for nil:NilClass):
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.10.0/lib/hammer_cli_foreman/api/session_authenticator_wrapper.rb:40:in `authenticate'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.1.0/lib/apipie_bindings/rest_client_extensions.rb:14:in `block in <module:RestClientExtensions>'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:407:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:407:in `block in transmit'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:406:in `each'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:406:in `transmit'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/resource.rb:51:in `get'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.1.0/lib/apipie_bindings/api.rb:313:in `call_client'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.1.0/lib/apipie_bindings/api.rb:229:in `http_call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.1.0/lib/apipie_bindings/api.rb:179:in `call_action'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.1.0/lib/apipie_bindings/api.rb:174:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.1.0/lib/apipie_bindings/resource.rb:21:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.10.0/lib/hammer_cli/apipie/command.rb:43:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.10.0/lib/hammer_cli_foreman/commands.rb:158:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.10.0/lib/hammer_cli_foreman/commands.rb:248:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.10.0/lib/hammer_cli_foreman/commands.rb:283:in `retrieve_all'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.10.0/lib/hammer_cli_foreman/commands.rb:267:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.10.0/lib/hammer_cli/abstract.rb:27:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.10.0/lib/hammer_cli/abstract.rb:27:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.10.0/lib/hammer_cli/abstract.rb:27:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.10.0/bin/hammer:146:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'
Actions #1

Updated by The Foreman Bot almost 7 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/298 added
Actions #2

Updated by Tomáš Strachota almost 7 years ago

  • translation missing: en.field_release deleted (243)

This is a candidate for hammer-cli-foreman 0.10.1

Actions #3

Updated by Tomáš Strachota almost 7 years ago

  • translation missing: en.field_release set to 246
Actions #4

Updated by Anonymous almost 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #5

Updated by Ivan Necas almost 7 years ago

  • Bugzilla link set to 1452774
Actions

Also available in: Atom PDF