Troubleshooting

Use this Go community space to get help troubleshooting any product related issues.

This is a public Discussion Area  publicRSS

Post

    xyzhang
    Go agent couldn't use rake command when running job
    Post posted December 26, 2011 by xyzhang, last edited February 9, 2012
    863 Views, 5 Comments
    Topic:
    Go agent couldn't use rake command when running job
    Body:

    We have problems use go-agent run rake task for RoR project. Can anyone help us? Please contact me if you need more information.

    We installed go-server and go-agent on the same machine.

    OS:

    ubuntu (11.04)

    Go Version:

    2.4

    Rails 3

    We can run rake task mannualy form the go-agent pipeline/project folder "/var/lib/go-agent/pipelines/<project>

    But when trigger this task from go dashboard, got the following errors:

    Stack Trace:

    Comment

     

    • janmejay
      posted December 27, 2011 by janmejay

      Hi,

      Can you please post the output of

      $ which rake

      Regards,
      Janmejay

    • xyzhang
      posted December 27, 2011 by xyzhang

      $ which rake

      /usr/local/ruby/bin/rake

    • janmejay
      posted December 27, 2011 by janmejay

      Doesn't look like it is available in PATH for job.

      The path you have set is: '/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games'

      Where as rake is available in /usr/local/ruby/bin

      May be you want to try appending this to your current PATH value.

      Also, it seems you have tried to override the environment variable(i see it set to  '/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/bin/ruby') in Go configuration. While I understand it may actually be what you want to do, as in, you want your rake task to see this PATH, please note that it doesn't have any effect on executable lookup done by Go agent. It will have effect on exec/fork-exec executable lookup done by rake task(agent's inferior process).

      In this case, you want to set environment variables for Go agent by modifying /etc/default/go-agent(on linux) or equivallent for your platform. You will need to restart the agent for this to have effect.

      If it still doesn't work, please post the console log of job run with new environment variable settings.

      Regards,
      Janmejay

    • xyzhang
      posted December 28, 2011 by xyzhang

      Hi, I modified /etc/default/go-agent and got the following error:

       

         [cruise] Current job status: passed.


      [cruise] Start to execute task: <exec command="bundle install" />.
      [cruise] setting environment variable 'GO_ENVIRONMENT_NAME' to value 'Test'
      [cruise] setting environment variable 'CRUISE_ENVIRONMENT_NAME' to value 'Test' (Deprecated. Use 'GO_ENVIRONMENT_NAME' instead.)
      [cruise] setting environment variable 'CRUISE_SERVER_URL' to value 'https://127.0.0.1:8154/go/' (Deprecated. Use 'GO_SERVER_URL' instead.)
      [cruise] setting environment variable 'GO_SERVER_URL' to value 'https://127.0.0.1:8154/go/'
      [cruise] setting environment variable 'GO_PIPELINE_NAME' to value 'ashoka-ci'
      [cruise] setting environment variable 'GO_PIPELINE_COUNTER' to value '26'
      [cruise] setting environment variable 'GO_PIPELINE_LABEL' to value '26'
      [cruise] setting environment variable 'GO_STAGE_NAME' to value 'unit_test'
      [cruise] setting environment variable 'GO_STAGE_COUNTER' to value '1'
      [cruise] setting environment variable 'GO_JOB_NAME' to value 'tests'
      [cruise] setting environment variable 'CRUISE_PIPELINE_NAME' to value 'ashoka-ci' (Deprecated. Use 'GO_PIPELINE_NAME' instead.)
      [cruise] setting environment variable 'CRUISE_PIPELINE_COUNTER' to value '26' (Deprecated. Use 'GO_PIPELINE_COUNTER' instead.)
      [cruise] setting environment variable 'CRUISE_PIPELINE_LABEL' to value '26' (Deprecated. Use 'GO_PIPELINE_LABEL' instead.)
      [cruise] setting environment variable 'CRUISE_STAGE_NAME' to value 'unit_test' (Deprecated. Use 'GO_STAGE_NAME' instead.)
      [cruise] setting environment variable 'CRUISE_STAGE_COUNTER' to value '1' (Deprecated. Use 'GO_STAGE_COUNTER' instead.)
      [cruise] setting environment variable 'CRUISE_JOB_NAME' to value 'tests' (Deprecated. Use 'GO_JOB_NAME' instead.)
      [cruise] setting environment variable 'CRUISE_REVISION_ASHOKA_BRANCH_SVN' to value '3173' (Deprecated. Use 'GO_REVISION_ASHOKA_BRANCH_SVN' instead.)
      [cruise] setting environment variable 'GO_REVISION_ASHOKA_BRANCH_SVN' to value '3173'
      [cruise] setting environment variable 'RAILS_ENV' to value 'test'
      Error happened while attempting to execute 'bundle install'.
      Please make sure [bundle install] can be executed on this agent.

      [Debug Information] Environment variable PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin:/usr/local/ruby/bin:/usr/local/ruby/bin

      [cruise] Start to create properties ashoka-ci/26/unit_test/1/tests on ashoka-ci [/var/lib/go-agent] at Wed Dec 28 18:31:34 CST 2011

      [cruise] Start to upload ashoka-ci/26/unit_test/1/tests on ashoka-ci [/var/lib/go-agent] at Wed Dec 28 18:31:34 CST 2011

      [cruise] Job completed ashoka-ci/26/unit_test/1/tests on ashoka-ci [/var/lib/go-agent] at Wed Dec 28 18:31:34 CST 2011

      And

      &>which bundle
      /usr/local/ruby/bin/bundle

      &> cd /usr/local/ruby/bin
      &>ls bundle
      -rwxr-xr-x 1 root root 386 2011-12-23 10:45 bundle


    • janmejay
      posted December 30, 2011 by janmejay

      Hi,

      'bundle install' is actually not a command. 'bundle' is a command, which takes arguments, 'install' is one of those arguments.

      'bundle install' would be a command when you have a script named 'bundle install' in the path. So it is again failing for executable lookup.

      Can you please configure it to execute 'bundle' as a command, having one argument with value 'install'? you can do this by using args="install" attribute on <exec/> tag.

      Regards,
      Janmejay