Go agent couldn't use rake command when running job

Follow

Comments

6 comments

  • Avatar
    janmejay

    Hi,


    Can you please post the output of


    $ which rake


    Regards,
    Janmejay

  • Avatar
    xyzhang

    $ which rake


    /usr/local/ruby/bin/rake

  • Avatar
    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

  • Avatar
    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


  • Avatar
    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

  • Avatar
    Vivek Patil
    I am using sbt as a build tool for Scala and it gives me the following error.Can u please let me know the reason?

    Start to execute task: <exec command="./sbt" workingdir="biblioteca/" > <arg>compile</arg> </exec>. [go] setting environment variable 'GO_SERVER_URL' to value 'https://127.0.0.1:8154/go/' [go] setting environment variable 'GO_TRIGGER_USER' to value 'anonymous' [go] setting environment variable 'GO_PIPELINE_NAME' to value 'Biblioteca' [go] setting environment variable 'GO_PIPELINE_COUNTER' to value '5' [go] setting environment variable 'GO_PIPELINE_LABEL' to value '5' [go] setting environment variable 'GO_STAGE_NAME' to value 'compile' [go] setting environment variable 'GO_STAGE_COUNTER' to value '4' [go] setting environment variable 'GO_JOB_NAME' to value 'compile' [go] setting environment variable 'GO_REVISION' to value '29d9828a1a34aef7f0d0302293827137db429316' [go] setting environment variable 'GO_TO_REVISION' to value '29d9828a1a34aef7f0d0302293827137db429316' [go] setting environment variable 'GO_FROM_REVISION' to value '29d9828a1a34aef7f0d0302293827137db429316' Error happened while attempting to execute './sbt compile'. Please make sure [./sbt] can be executed on this agent. [Debug Information] Environment variable PATH: /usr/bin:/bin:/usr/sbin:/sbin


Please sign in to leave a comment.