I installed push-jobs feature on chef-server to run commands from workstation or Jenkins.
When I run the command from Jenkins “knife job start ‘chef-client’ <node_name>”, it is not displaying complete log like when I run “chef-client” on a node.
How to get the complete log in Jenkins console ?? Please help me with this.
Without knowing specifically how you’re triggering the Job, the best I can say is to use awk (or something similar) to capture the output of the start command and regex capture the Job ID.
Thanks @tomduffield
used batch cmd to capture the JOB ID.
But when i initiate the below cmd , i am receiving error… can you help me with this.
C:\chef\chef-repo>knife job output --channel stdout cdaf88e53573a83f3f491bcd9b447072 AT_Protogo
ERROR: The object you are looking for could not be found
Response: <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>
@tomduffield push-jobs client version - 2.1.4 and server : opscode-push-jobs-server_2.1.1-1
job output worked for some builds, but suddenly it started showing the above message even after when chef-client succeeds.
Where exactly output logs will be stored in chef-server or chef-client ??
Hey,
So looking back I think I might have the answer. In your initial email I noticed that the --capture flag was missing from your command. That is required in order to tell the Push Jobs Client to send the logs to the Push Jobs Server (from where they are retrieved).
Below is my push-client.rb file, kindly let me know if i am missing anything means.
Preformatted text# Generated by Chef
# Local modifications will be overwritten!
LC_ALL='en_US.UTF-8'
# Chef server connect options
chef_server_url 'URL'
node_name 'AT_DataHub-BackOffice'
client_key 'c:\chef\client.pem'
trusted_certs_dir 'c:\chef\trusted_certs'
verify_api_cert true
ssl_verify_mode :verify_peer
allow_unencrypted false
# The whitelist comes from node['push_jobs']['whitelist']
whitelist({"chef-client"=>"chef-client --force-formatter"})
# We're under runit, so don't output timestamp
Mixlib::Log::Formatter.show_time = true
I am able to get the logs on jenkins console but some issues here,
logs with small size (less than 100 lines) will be displayed in jenkins console but for bigger size logs i am getting below error.
knife job output --channel stdout cdaf88e53573d3c62aa12ccf6080315f AT_DataHub-BackOffice
ERROR: The object you are looking for could not be found
Response: <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>
is there any config settings i need to change to get the complete logs ??
tried all the possibilities but didnt work, kindly help me with this.