Project

General

Profile

Actions

Bug #23016

closed

hammer job-invocation output blocks and keeps polling for output

Added by Lukas Pramuk about 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

# hammer job-invocation output --id 1 --host host1.ovirt.rhts.eng.bos.redhat.com
<empty and blocks>

Debug mode show that it is polling API for the same result

[ INFO 2018-03-26T05:32:04 HammerCLIForemanRemoteExecution::JobInvocation::OutputCommand] Called with options: {"option_host_name"=>"host1.example.com", "option_host_id"=>2, "option_id"=>"1"}
[ INFO 2018-03-26T05:32:04 API] Server: https://sat.example.com
[ INFO 2018-03-26T05:32:04 API] GET /api/job_invocations/1/hosts/2
[DEBUG 2018-03-26T05:32:04 API] Params: {}
[DEBUG 2018-03-26T05:32:04 API] Headers: {
    :params => {}
}
[DEBUG 2018-03-26T05:32:04 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[DEBUG 2018-03-26T05:32:05 API] Response: {
     "refresh" => true,
      "output" => [],
     "delayed" => true,
    "start_at" => "2018-03-19T09:18:44.047+01:00" 
}
[DEBUG 2018-03-26T05:32:05 API] Response headers: {
                                 :date => "Mon, 26 Mar 2018 09:32:04 GMT",
                               :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
                      :foreman_version => "1.18.0-develop",
                  :foreman_api_version => "2",
                      :apipie_checksum => "8a1982493c4c675e17f4c638b54219c5",
                        :cache_control => "max-age=0, private, must-revalidate",
                         :x_request_id => "61ac558d-fbe1-40b0-aba7-9fc4531f333e",
                            :x_runtime => "0.074037",
              :content_security_policy => "default-src 'self'; child-src 'self'; connect-src 'self' ws: wss:; img-src 'self' data: *.gravatar.com; script-src 'unsafe-eval' 'unsafe-inline' 'self'; style-src 'unsafe-inline' 'self'",
            :strict_transport_security => "max-age=631139040; includeSubdomains",
               :x_content_type_options => "nosniff",
                   :x_download_options => "noopen",
                      :x_frame_options => "sameorigin",
    :x_permitted_cross_domain_policies => "none",
                     :x_xss_protection => "1; mode=block",
                         :x_powered_by => "Phusion Passenger 4.0.53",
                           :set_cookie => [
        [0] "_session_id=194c0a48f07461c865e4629ba6396181; path=/; secure; HttpOnly" 
    ],
                                 :etag => "W/\"2e5056c4ba93523e4e06562314670cd3-gzip\"",
                               :status => "200 OK",
                                 :vary => "Accept-Encoding",
                     :content_encoding => "gzip",
                       :content_length => "98",
                         :content_type => "application/json; charset=utf-8" 
}
[ INFO 2018-03-26T05:32:06 API] Server: https://sat.example.com
[ INFO 2018-03-26T05:32:06 API] GET /api/job_invocations/1/hosts/2
[DEBUG 2018-03-26T05:32:06 API] Params: {
    :since => nil
}
[DEBUG 2018-03-26T05:32:06 API] Headers: {
    :params => {
        :since => nil
    }
}
[DEBUG 2018-03-26T05:32:06 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[DEBUG 2018-03-26T05:32:06 API] Response: {
     "refresh" => true,
      "output" => [],
     "delayed" => true,
    "start_at" => "2018-03-19T09:18:44.047+01:00" 
}
[DEBUG 2018-03-26T05:32:06 API] Response headers: {
                                 :date => "Mon, 26 Mar 2018 09:32:06 GMT",
                               :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
                      :foreman_version => "1.18.0-develop",
                  :foreman_api_version => "2",
                      :apipie_checksum => "8a1982493c4c675e17f4c638b54219c5",
                        :cache_control => "max-age=0, private, must-revalidate",
                         :x_request_id => "a8b319e1-e30a-4c32-9738-d4c1834213f9",
                            :x_runtime => "0.071594",
              :content_security_policy => "default-src 'self'; child-src 'self'; connect-src 'self' ws: wss:; img-src 'self' data: *.gravatar.com; script-src 'unsafe-eval' 'unsafe-inline' 'self'; style-src 'unsafe-inline' 'self'",
            :strict_transport_security => "max-age=631139040; includeSubdomains",
               :x_content_type_options => "nosniff",
                   :x_download_options => "noopen",
                      :x_frame_options => "sameorigin",
    :x_permitted_cross_domain_policies => "none",
                     :x_xss_protection => "1; mode=block",
                         :x_powered_by => "Phusion Passenger 4.0.53",
                           :set_cookie => [
        [0] "_session_id=aa9658eb2ce3b367a4eecae5ab68dbd0; path=/; secure; HttpOnly" 
    ],
                                 :etag => "W/\"2e5056c4ba93523e4e06562314670cd3-gzip\"",
                               :status => "200 OK",
                                 :vary => "Accept-Encoding",
                     :content_encoding => "gzip",
                       :content_length => "98",
                         :content_type => "application/json; charset=utf-8" 
}


Is it because of "output" => [] ?
Isn't CLI able to handle it?


Related issues 1 (0 open1 closed)

Related to foreman-tasks - Bug #22776: Provide reliable helper for determining if a task is set to be executed laterClosedAdam Ruzicka03/05/2018Actions
Actions #1

Updated by Lukas Pramuk about 6 years ago

katello-3.7.0-1.nightly.el7.noarch
foreman-1.18.0-0.develop.201803202124git6ed2083.el7.noarch
tfm-rubygem-foreman_remote_execution_core-1.1.1-1.fm1_18.el7.noarch
tfm-rubygem-foreman_remote_execution-1.4.6-1.fm1_18.el7.noarch
rubygem-smart_proxy_remote_execution_ssh-0.1.5-1.el7.noarch
tfm-rubygem-hammer_cli_foreman_remote_execution-0.0.6-2.fm1_17.el7.noarch

Actions #2

Updated by Adam Ruzicka about 6 years ago

  • Related to Bug #22776: Provide reliable helper for determining if a task is set to be executed later added
Actions #3

Updated by Lukas Pramuk about 6 years ago

Server:

GET "/api/job_invocations/1/hosts/2"
GET "/api/job_invocations/1/hosts/2?since"
GET "/api/job_invocations/1/hosts/2?since"
GET "/api/job_invocations/1/hosts/2?since"

... looping

2018-03-26T07:07:54 [I|app|] Started GET "/api/job_invocations/1/hosts/2" for CLIENT at 2018-03-26 07:07:54 -0400
2018-03-26T07:07:54 [I|app|5b533] Processing by Api::V2::JobInvocationsController#output as JSON
2018-03-26T07:07:54 [I|app|5b533]   Parameters: {"apiv"=>"v2", "job_invocation_id"=>"1", "host_id"=>"2", "job_invocation"=>{}}
2018-03-26T07:07:54 [I|app|5b533] Current user: foreman_admin (administrator)
2018-03-26T07:07:54 [I|app|5b533] Authorized user admin(Admin User)
2018-03-26T07:07:54 [I|app|5b533] Current user: admin (administrator)
2018-03-26T07:07:54 [I|app|5b533] Completed 200 OK in 57ms (Views: 0.7ms | ActiveRecord: 15.9ms)
2018-03-26T07:07:55 [I|app|] Started GET "/api/job_invocations/1/hosts/2?since" for CLIENT at 2018-03-26 07:07:55 -0400
2018-03-26T07:07:55 [I|app|a6dc7] Processing by Api::V2::JobInvocationsController#output as JSON
2018-03-26T07:07:55 [I|app|a6dc7]   Parameters: {"since"=>nil, "apiv"=>"v2", "job_invocation_id"=>"1", "host_id"=>"2", "job_invocation"=>{}}
2018-03-26T07:07:55 [I|app|a6dc7] Current user: foreman_admin (administrator)
2018-03-26T07:07:55 [I|app|a6dc7] Authorized user admin(Admin User)
2018-03-26T07:07:55 [I|app|a6dc7] Current user: admin (administrator)
2018-03-26T07:07:55 [I|app|a6dc7] Completed 200 OK in 59ms (Views: 0.6ms | ActiveRecord: 18.0ms)
2018-03-26T07:07:57 [I|app|] Started GET "/api/job_invocations/1/hosts/2?since" for CLIENT at 2018-03-26 07:07:57 -0400
2018-03-26T07:07:57 [I|app|dd63c] Processing by Api::V2::JobInvocationsController#output as JSON
2018-03-26T07:07:57 [I|app|dd63c]   Parameters: {"since"=>nil, "apiv"=>"v2", "job_invocation_id"=>"1", "host_id"=>"2", "job_invocation"=>{}}
2018-03-26T07:07:57 [I|app|dd63c] Current user: foreman_admin (administrator)
2018-03-26T07:07:57 [I|app|dd63c] Authorized user admin(Admin User)
2018-03-26T07:07:57 [I|app|dd63c] Current user: admin (administrator)
2018-03-26T07:07:57 [I|app|dd63c] Completed 200 OK in 64ms (Views: 0.6ms | ActiveRecord: 22.7ms)
2018-03-26T07:07:58 [I|app|] Started GET "/api/job_invocations/1/hosts/2?since" for CLIENT at 2018-03-26 07:07:58 -0400
2018-03-26T07:07:58 [I|app|6e352] Processing by Api::V2::JobInvocationsController#output as JSON
2018-03-26T07:07:58 [I|app|6e352]   Parameters: {"since"=>nil, "apiv"=>"v2", "job_invocation_id"=>"1", "host_id"=>"2", "job_invocation"=>{}}
2018-03-26T07:07:58 [I|app|6e352] Current user: foreman_admin (administrator)
2018-03-26T07:07:58 [I|app|6e352] Authorized user admin(Admin User)
2018-03-26T07:07:58 [I|app|6e352] Current user: admin (administrator)
2018-03-26T07:07:58 [I|app|6e352] Completed 200 OK in 65ms (Views: 0.6ms | ActiveRecord: 22.7ms)

Actions #4

Updated by The Foreman Bot about 6 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Adam Ruzicka
  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/335 added
Actions #5

Updated by Anonymous almost 6 years ago

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

Also available in: Atom PDF