You can also turn on some shell logging by using `/bin/sh -xc
YOUR_COMMAND_STRING`

On Fri, Apr 20, 2018 at 2:30 PM Ketan Padegaonkar <
ketanpadegaon...@gmail.com> wrote:

> You may be able to get something by turning on the log level for the
> logger `com.thoughtworks.go.util.command.CommandLine`. More information on
> turning on logging is here
> <https://docs.gocd.org/current/advanced_usage/logging.html>. You should
> turn on this log on the agent, not the server.
>
>
> On Fri, Apr 20, 2018 at 2:20 PM David Joos <david.j...@gmail.com> wrote:
>
>> Anyone got a heads up on how to up the CommandLine component error
>> logging to find out why the custom command fails? Got pulled away on
>> something else, hoping to get some time to dig deeper today.
>>
>> Thanks in advance!
>>
>> 2018-04-17 16:07 GMT+01:00 David Joos <david.j...@gmail.com>:
>>
>>> Also: when changing (just out of desperation) the custom command to a
>>> simple echo, it fails as well - for that project...
>>>
>>> I'll have a look at whether I can get trace logging on the CommandLine
>>> component on the agents, so hopefully something more useful can be
>>> unearthed (FYI: we're using GoCD 18.2)
>>>
>>> Thanks in advance for ideas/pointers!
>>> David
>>>
>>> 2018-04-17 16:03 GMT+01:00 David Joos <david.j...@gmail.com>:
>>>
>>>> Hi guys,
>>>>
>>>> thanks for the feedback!
>>>>
>>>> Re: config XML snippet
>>>> ```
>>>> *<exec command="/bin/sh">*
>>>> *  <arg>-c</arg>*
>>>> *  <arg>tar xvzf "#{ARTIFACT_PROJECT_NAME}.tar.gz"</arg>*
>>>> *  <runif status="passed" />*
>>>> *</exec>*
>>>> ```
>>>> FYI: this is part of a template used successfully across other projects.
>>>>
>>>> Re: /bin/sh
>>>> ...when SSH'ing in and running `/bin/sh -c "tar xvzf project.tar.gz"`
>>>> on the GoCD agent (FYI: it fails on different agents for this pipeline -
>>>> agents that fetch and untar other pipelines without any issues in the same
>>>> environment) it works as expected. That is what baffles me the most.
>>>>
>>>> If there would be at least a bit more to go on somewhere than from the
>>>> console tab:
>>>> *[go] Task: fetch artifact [project.tar.gz] => [] from
>>>> [build_project/package/package]took: 0.224s*
>>>> *[go] Task: /bin/sh -c "tar xvzf \"project.tar.gz\""took: 0.0s*
>>>>
>>>> *[go] Task status: failed, took: 0.0s[go] Current job status: failed*
>>>>
>>>> Thanks!
>>>> David
>>>>
>>>>
>>>>
>>>> 2018-04-17 15:49 GMT+01:00 Aravind SV <arv...@thoughtworks.com>:
>>>>
>>>>> Hello David,
>>>>>
>>>>> Can you share the XML snippet from the config? I'd expect it to be
>>>>> something like this:
>>>>>
>>>>> <exec command="/bin/sh">
>>>>>   <arg>-c</arg>
>>>>>   <arg>tar xvzf "artifact.tar.gz"</arg>
>>>>> </exec>
>>>>>
>>>>> Is it?
>>>>>
>>>>> It shouldn't be like this:
>>>>>
>>>>> <exec command="/bin/sh -c tar xvzf \"artifact.tar.gz\"">
>>>>> </exec>
>>>>>
>>>>> since that is telling it to look for a command with that filename.
>>>>>
>>>>> Cheers,
>>>>> Aravind
>>>>>
>>>>>
>>>>> On Tue, Apr 17, 2018 at 10:37 AM, David Joos <david.j...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Anyone got any ideas on how to bump the GoCD agent's error log to
>>>>>> trace so to hopefully get some more background info as to what is going 
>>>>>> on?
>>>>>> FYI: when replacing tar with any other custom command, it fails as
>>>>>> well for this specific pipeline (template used on other pipelines without
>>>>>> any issues) - not sure what is causing this, hence more noisy error logs
>>>>>> would be really helpful :-)
>>>>>>
>>>>>> Thanks in advance!
>>>>>> David
>>>>>>
>>>>>> 2018-04-13 18:17 GMT+01:00 David Joos <david.j...@gmail.com>:
>>>>>>
>>>>>>> Hi there,
>>>>>>>
>>>>>>> I've got a pipeline template where after fetching an artifact (eg.
>>>>>>> artifact.tar.gz) successfully, we untar the artifact via a custom 
>>>>>>> command
>>>>>>> (`/bin/sh -c "tar xvzf \"artifact.tar.gz\""`).
>>>>>>>
>>>>>>> On a new project we're only seeing failures in GoCDs console tab:
>>>>>>> ```
>>>>>>>
>>>>>>> [go] Task: /bin/sh -c "tar xvzf \"artifact.tar.gz\"" took: 0.23s
>>>>>>> [go] Task status: failed, took: 0.23s
>>>>>>>
>>>>>>> ```
>>>>>>> ...without any further information on why / what is happening
>>>>>>> exactly.
>>>>>>>
>>>>>>> When executing  `/bin/sh -c "tar xvzf \"artifact.tar.gz\""` command
>>>>>>> as the 'go' user on the GoCD agent itself via the cli
>>>>>>> (/var/lib/go-agent/pipelines/artifact_pipeline_name), the command untars
>>>>>>> the file perfectly, as expected. `echo $?` also underlines the command
>>>>>>> exited cleanly (0), so I'm unsure why we don't get to see this when GoCD
>>>>>>> runs the task...
>>>>>>>
>>>>>>> Is there any more verbose logging I could turn on/dig into on the
>>>>>>> GoCD agent to get to the bottom of this issue? This has been baffling me
>>>>>>> for too long now :-)
>>>>>>>
>>>>>>> Thanks in advance for your help!
>>>>>>>
>>>>>>> Kind regards,
>>>>>>> David
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "go-cd" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to go-cd+unsubscr...@googlegroups.com.
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "go-cd" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to go-cd+unsubscr...@googlegroups.com.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "go-cd" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to go-cd+unsubscr...@googlegroups.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "go-cd" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to go-cd+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to go-cd+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to