Bug 1139359 - node platform logs do not provide context attributes consistently
Summary: node platform logs do not provide context attributes consistently
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-08 18:07 UTC by Luke Meyer
Modified: 2019-11-14 06:30 UTC (History)
6 users (show)

Fixed In Version: openshift-origin-msg-node-mcollective-1.22.2.2-1.el6op rubygem-openshift-origin-node-1.23.9.23-1.el6op
Doc Type: Bug Fix
Doc Text:
Node platform log entries are built with attributes from the arguments of the MCollective call that caused them. In the case of the execute_parallel action, the arguments are structured differently. With application and gear context enabled for node platform logs, attributes were previously not logged for the execute_parallel actions, which include adding SSH keys and cartridges. This bug fix ensures that the arguments are now gathered from either argument structure, if present. As a result, all known actions with the relevant MCollective call arguments are logged with the appropriate context attributes.
Clone Of:
Environment:
Last Closed: 2014-10-02 13:59:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1353 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.1.7 bug fix and enhancement update 2014-10-02 17:59:00 UTC

Description Luke Meyer 2014-09-08 18:07:48 UTC
Description of problem:
In the node platform logs, if 

Steps to Reproduce:
1. Update node.conf with PLATFORM_LOG_CONTEXT_ENABLED=1 PLATFORM_LOG_CONTEXT_ATTRS=request_id,app_uuid and restart ruby193-mcollective
2. Create an app
3. Check /var/log/openshift/node/platform.log entries for entries with "action=execute_parallel" (e.g. for adding ssh keys at the end)

Actual results: (example)
September 08 11:31:44 INFO [] openshift-agent: request end: action=execute_parallel, requestid=222da33d918f5a34aab9400a14fac6ed, senderid=broker.hosts.example.com, statuscode=0, [...]

Expected results:
September 08 11:31:44 INFO [request_id=a853164d2c5222f12c1a5bc47cf03f29,app_uuid=540dcbb83a0fb2b523000079] openshift-agent: request end: action=execute_parallel, requestid=222da33d918f5a34aab9400a14fac6ed, senderid=broker.hosts.example.com, statuscode=0, [...]

Additional info:
This is because the logger is looking for the attributes in a fixed part of the mco request, and under execute_parallel they are in a different place. I have a patch.

Comment 6 Anping Li 2014-09-10 05:53:11 UTC
Verified and pass on ose-2.1 2014-09-09.1.

Create app and check the platform.log. The request_id and app_uuid were added and the ssh keys was added. the log is as below:

September 10 01:45:07 INFO [request_id=5eaf4b653c4f501ac0ddd8993a9efee4,app_uuid=540fe55dbe43de94cf0000ec] openshift-agent: request end: action=cartridge_do, requestid=547393743d77541683214b96d4c5de69, senderid=broker.ose.com.cn, statuscode=0, data={:time=>nil, :output=>"", :exitcode=>0, :addtl_params=>nil}
September 10 01:45:08 INFO [] openshift-agent: request start: action=get_facts requestid=32eb448744cc51d4ba808a13b7a62100, senderid=broker.ose.com.cn, data={:facts=>["public_hostname"], :process_results=>true, :args=>{}}
September 10 01:45:08 INFO [] openshift-agent: request end: action=get_facts, requestid=32eb448744cc51d4ba808a13b7a62100, senderid=broker.ose.com.cn, statuscode=0, data={:output=>{:public_hostname=>"node2.ose.com.cn"}}
September 10 01:45:08 INFO [] openshift-agent: request start: action=execute_parallel requestid=805cfbe7592153ad97dfc9109f6fc75d, senderid=broker.ose.com.cn, data={:args=>{:timeout=>nil}, "node2.ose.com.cn"=>[{:tag=>{"op_id"=>"540fe55dbe43de94cf0000f5"}, :gear=>"540fe55dbe43de94cf0000ec", :job=>{:cartridge=>"openshift-origin-node", :action=>"authorized-ssh-key-batch-add", :args=>{"--with-app-uuid"=>"540fe55dbe43de94cf0000ec", "--with-app-name"=>"t1", "--with-expose-ports"=>false, "--with-container-uuid"=>"540fe55dbe43de94cf0000ec", "--with-container-name"=>"t1", "--with-namespace"=>"hanli1dom", "--with-uid"=>4345, "--with-request-id"=>"5eaf4b653c4f501ac0ddd8993a9efee4", "--with-ssh-keys"=>[{"key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCzwmMg1MX8Dm/bw5nFScVSAH7RcApddk0B/TkAn4W5IPECZwp6YBBkFx8fDGHDVtcj79oQnxx9cGjytMVacXWrjErIspsoNUMfklPTcq/KkuxmgGOEIL46U4dInmwJfyu51L0bo3ASo4IS+msqS8efTCI9+oOflTdg+eSJAbAGV7b4YmvZJorOszyF/FaYyfgah49IU/+AWA+usX0WZSy395wEejKd4q+mRpcasZPk7+v9mQtJS+VOeje+IqXH2DBXLNPbe4E0RREuoOOacZwnkCtzByIrs7O6OUR/FOeAsr6+FPnjbJYXIvOT1Wxd3c0UOERfMaQrLMf6kLvymiOH", "type"=>"ssh-rsa", "comment"=>"54056fc1be43deaba0000001-default", "content"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCzwmMg1MX8Dm/bw5nFScVSAH7RcApddk0B/TkAn4W5IPECZwp6YBBkFx8fDGHDVtcj79oQnxx9cGjytMVacXWrjErIspsoNUMfklPTcq/KkuxmgGOEIL46U4dInmwJfyu51L0bo3ASo4IS+msqS8efTCI9+oOflTdg+eSJAbAGV7b4YmvZJorOszyF/FaYyfgah49IU/+AWA+usX0WZSy395wEejKd4q+mRpcasZPk7+v9mQtJS+VOeje+IqXH2DBXLNPbe4E0RREuoOOacZwnkCtzByIrs7O6OUR/FOeAsr6+FPnjbJYXIvOT1Wxd3c0UOERfMaQrLMf6kLvymiOH"}, {"key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA1MeM1t/oT1kC7zIIcw0kDgLPEYPdsVNyXT3v3in8zVfJba9+FhBq4PztX6jMqS+NqI2/55z7+KrbEBOduJRFjm3Fivxsu5gBRumlvsvVZq+SmkdYZoRptsBe0fUTyswpRAWCsgM2hT36I6CQNMdnN0wtF/w7zH24OS8RWZSB3TTj4q6xcCZ2nTaM9zo3YgjCivKM4lkXLJk3y9yU0fnPAynOpltthRkYVfvdttDavf2urcaJveHLjVCCji+/l3WpxHcuc/D5bebxc7yyaCHDFChUWgo1rpOTEEFZnh+HEkrNSmNhpQ+wXhnUMtyj+eEhxX24Ta4Q8RNYnbATAaInHw==", "type"=>"ssh-rsa", "comment"=>"54056fc1be43deaba0000001-hanli2", "content"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEA1MeM1t/oT1kC7zIIcw0kDgLPEYPdsVNyXT3v3in8zVfJba9+FhBq4PztX6jMqS+NqI2/55z7+KrbEBOduJRFjm3Fivxsu5gBRumlvsvVZq+SmkdYZoRptsBe0fUTyswpRAWCsgM2hT36I6CQNMdnN0wtF/w7zH24OS8RWZSB3TTj4q6xcCZ2nTaM9zo3YgjCivKM4lkXLJk3y9yU0fnPAynOpltthRkYVfvdttDavf2urcaJveHLjVCCji+/l3WpxHcuc/D5bebxc7yyaCHDFChUWgo1rpOTEEFZnh+HEkrNSmNhpQ+wXhnUMtyj+eEhxX24Ta4Q8RNYnbATAaInHw=="}, {"key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDDUhirjKIHuTS1WZWrCdDRSLJiy1hUXLCbnNSN9SYkwf7W+B5XbnO0VLXp93GFY6Oue6BwI4FKtNB/0FqWxZubRvTk7rI3bYn9CqUvt/4egBT20OGrU8hs9wUy3STOcLJ0tUOTef9YOlAWfhxaCe+5gzpwDBoQiLBlEe+FzfeGZ4kmhLjliFR9yMBnskrG/G7dKitCM6m9ceSiG2qdv63B/e2giw2ta8x011aY906TgRccZJQKe4uQh8TPVCUsHy40qryUWMOG8JmAQNP4Qjy9g5iJcXC2fTIHrtSPS75T4UNc85FP+cOLvL/LtuPd7mrxrMOBInWiGzbxFpBY0YeH", "type"=>"ssh-rsa", "comment"=>"54056fc1be43deaba0000001-hanli1broker", "content"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQDDUhirjKIHuTS1WZWrCdDRSLJiy1hUXLCbnNSN9SYkwf7W+B5XbnO0VLXp93GFY6Oue6BwI4FKtNB/0FqWxZubRvTk7rI3bYn9CqUvt/4egBT20OGrU8hs9wUy3STOcLJ0tUOTef9YOlAWfhxaCe+5gzpwDBoQiLBlEe+FzfeGZ4kmhLjliFR9yMBnskrG/G7dKitCM6m9ceSiG2qdv63B/e2giw2ta8x011aY906TgRccZJQKe4uQh8TPVCUsHy40qryUWMOG8JmAQNP4Qjy9g5iJcXC2fTIHrtSPS75T4UNc85FP+cOLvL/LtuPd7mrxrMOBInWiGzbxFpBY0YeH"}, {"key"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCgUqEEoxekuSeXIzTBVfyRAcrsOXGsKmM63pxOa4f0vy+ZVAXDKx+/ikON6uvjNFBXnF5cHIbOYx1CBL9+B+XyrJMG/hW01oRabAqxJstYmF+mbxDOEe9yAD5PsbBON0lgeHzzZencOnJgdEkZyTKSLir+5mQ4szTeeiBcP6gRQl2sI4Lls1Z07/du5h00ri6sAV4bnzJGEVWleYcQAIbU3gRubZo9cQ+H1ODXqOQBdoBIh/CZInb3EplweJQGvOovGexknTyDD7MsjhrKO0wFfZpk1NWhSil04guiD4JJdYvHNBU/khNlAixkPSPb6YPp9LwJ8C9xszpHYP8V6qEj", "type"=>"ssh-rsa", "comment"=>"54056fc1be43deaba0000001-hanli1anli", "content"=>"AAAAB3NzaC1yc2EAAAADAQABAAABAQCgUqEEoxekuSeXIzTBVfyRAcrsOXGsKmM63pxOa4f0vy+ZVAXDKx+/ikON6uvjNFBXnF5cHIbOYx1CBL9+B+XyrJMG/hW01oRabAqxJstYmF+mbxDOEe9yAD5PsbBON0lgeHzzZencOnJgdEkZyTKSLir+5mQ4szTeeiBcP6gRQl2sI4Lls1Z07/du5h00ri6sAV4bnzJGEVWleYcQAIbU3gRubZo9cQ+H1ODXqOQBdoBIh/CZInb3EplweJQGvOovGexknTyDD7MsjhrKO0wFfZpk1NWhSil04guiD4JJdYvHNBU/khNlAixkPSPb6YPp9LwJ8C9xszpHYP8V6qEj"}, {"key"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAv+3d0zRJh8zxBPu80+d+iFZXeCgfYClbC+GhgO6xHvqBNVZxRbk233TMqPswJIBNKKHwENP74kyCNYHDhc3tlHSg56C2ofx1RC1KYReCY3TRWn/1tHETVf0PcDEUytRWORys5j5FhidgyiRTh7rqitEBcPLW0r5gC1rtyFG2Pt30pTJ3SHkANuIBm++8ns+4fA/y8PCV6yLgb64Kyf6Kmrtii4C2OH1ZBBfOCJwEEVLLWgCXPP0mubRpFIgKUjsjhuCAGCY6LHsR9IPHNNHqOFNpQoLr4KSGKuKcpUSnO1ZjmmDfC3PQpplmyhowisvpTcOU0NC6aM+RTh4KVgqjRQ==", "type"=>"ssh-rsa", "comment"=>"54056fc1be43deaba0000001-test", "content"=>"AAAAB3NzaC1yc2EAAAABIwAAAQEAv+3d0zRJh8zxBPu80+d+iFZXeCgfYClbC+GhgO6xHvqBNVZxRbk233TMqPswJIBNKKHwENP74kyCNYHDhc3tlHSg56C2ofx1RC1KYReCY3TRWn/1tHETVf0PcDEUytRWORys5j5FhidgyiRTh7rqitEBcPLW0r5gC1rtyFG2Pt30pTJ3SHkANuIBm++8ns+4fA/y8PCV6yLgb64Kyf6Kmrtii4C2OH1ZBBfOCJwEEVLLWgCXPP0mubRpFIgKUjsjhuCAGCY6LHsR9IPHNNHqOFNpQoLr4KSGKuKcpUSnO1ZjmmDfC3PQpplmyhowisvpTcOU0NC6aM+RTh4KVgqjRQ=="}]}}, :result_stdout=>"", :result_stderr=>"", :result_exit_code=>""}, {:tag=>{"op_id"=>"540fe55dbe43de94cf0000f5"}, :gear=>"540fe55dbe43de94cf0000ec", :job=>{:cartridge=>"openshift-origin-node", :action=>"update-configuration", :args=>{"--with-app-uuid"=>"540fe55dbe43de94cf0000ec", "--with-app-name"=>"t1", "--with-expose-ports"=>false, "--with-container-uuid"=>"540fe55dbe43de94cf0000ec", "--with-container-name"=>"t1", "--with-namespace"=>"hanli1dom", "--with-uid"=>4345, "--with-request-id"=>"5eaf4b653c4f501ac0ddd8993a9efee4", "--with-config"=>{"auto_deploy"=>true, "deployment_branch"=>"master", "keep_deployments"=>1, "deployment_type"=>"git"}}}, :result_stdout=>"", :result_stderr=>"", :result_exit_code=>""}], :process_results=>true}
September 10 01:45:08 INFO [] Shell command 'quota --always-resolve -w 540fe55dbe43de94cf0000ec' ran. rc=0 out=Disk quotas for user 540fe55dbe43de94cf0000ec (uid 4345):

Comment 7 openshift-github-bot 2014-09-11 20:22:49 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/94de999addeeb6505ee9a244d1ea5c14aead82ed
NodeLogger: add attrs to log, parse execute_parallel actions

Bug 1139359 - node platform logs do not provide context attributes consistently
https://bugzilla.redhat.com/show_bug.cgi?id=1139359

This fixes platform context logging such that it works for
execute_parallel agent requests.

Additionally, the available context attributes are expanded to include
app_name, app_namespace, and (where applicable) cart_name.

Comment 9 errata-xmlrpc 2014-10-02 13:59:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1353.html


Note You need to log in before you can comment on or make changes to this bug.