Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Yarn, NPM, node. I installed all three on Microsoft windows server 2019, but cant access from bamboo Edited

When i login into the server and on command prompt type yarn -v or npm -v or node -v, it returns result and i have added successfully location in add capabilities key and value section. But when i run basic command like yarn -v from bamboo build job it doesn't works.

Location is correct and its 64bit os

 

basically the error you can see is:

INFO | jvm 1 | 2020/10/07 06:03:42 | Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application

i dont know how to resolve this.

 

the logs show the error as

INFO | jvm 1 | 2020/10/07 06:03:42 | 2020-10-07 06:03:42,001 INFO [0-BAM::172.12.10.107::Agent:pool-3-thread-1] [TaskResultBuilder] Failing task since return code of [C:\Program Files (x86)\Yarn\bin\yarn -v] was -1 while expected 0
INFO | jvm 1 | 2020/10/07 06:03:42 | 2020-10-07 06:03:42,001 INFO [0-BAM::172.12.10.107::Agent:pool-3-thread-1] [TaskResultBuilder] Process exception:
INFO | jvm 1 | 2020/10/07 06:03:42 | com.atlassian.utils.process.ProcessNotStartedException: C:\Program Files (x86)\Yarn\bin\yarn could not be started
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.utils.process.ExternalProcessImpl.start(ExternalProcessImpl.java:342)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.process.ProcessServiceImpl.executeExternalProcess(ProcessServiceImpl.java:204)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.process.ProcessServiceImpl.executeExternalProcess(ProcessServiceImpl.java:218)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.plugins.shell.task.AbstractShellBuildTask.execute(AbstractShellBuildTask.java:48)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.plugins.shell.task.AbstractShellBuildTask.execute(AbstractShellBuildTask.java:39)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$3(TaskExecutorImpl.java:319)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:252)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:319)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:112)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:73)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.executeBuildPhase(DefaultBuildAgent.java:204)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:176)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.lambda$waitAndPerformBuild$0(BuildAgentControllerImpl.java:131)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:185)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:125)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:127)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
INFO | jvm 1 | 2020/10/07 06:03:42 | at java.lang.Thread.run(Unknown Source)
INFO | jvm 1 | 2020/10/07 06:03:42 | Caused by: java.io.IOException: Cannot run program "C:\Program Files (x86)\Yarn\bin\yarn" (in directory "C:\Users\bamboo\bamboo-agent-home\xml-data\build-dir\MWC-CIWIN-JOB1"): CreateProcess error=193, %1 is not a valid Win32 application
INFO | jvm 1 | 2020/10/07 06:03:42 | at java.lang.ProcessBuilder.start(Unknown Source)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.utils.process.ExternalProcessImpl.createDefaultProcess(ExternalProcessImpl.java:377)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.utils.process.ExternalProcessImpl.createProcess(ExternalProcessImpl.java:385)
INFO | jvm 1 | 2020/10/07 06:03:42 | at com.atlassian.utils.process.ExternalProcessImpl.start(ExternalProcessImpl.java:339)
INFO | jvm 1 | 2020/10/07 06:03:42 | ... 20 more
INFO | jvm 1 | 2020/10/07 06:03:42 | Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
INFO | jvm 1 | 2020/10/07 06:03:42 | at java.lang.ProcessImpl.create(Native Method)
INFO | jvm 1 | 2020/10/07 06:03:42 | at java.lang.ProcessImpl.<init>(Unknown Source)
INFO | jvm 1 | 2020/10/07 06:03:42 | at java.lang.ProcessImpl.start(Unknown Source)

1 answer

1 accepted

 

 

Hi @Abhishek Saharan ,

This is mostly because the PATH variable inside the bamboo task does not include yarn and node. Add "echo $PATH" path command into your bamboo task and compare the result with the one when you login to the server.

Hello @Bloompeak Support

you are right, 

echo path command "echo %Path%" when i log into the server returns

C:\Python38\Scripts\;C:\Python38\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Amazon\cfn-bootstrap\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\bin\;C:\Program Files (x86)\Yarn\bin\;C:\Users\bamboo\AppData\Local\Microsoft\WindowsApps;

 

and echo path command from bamboo task return this

C:\Users\bamboo\bamboo-agent-home\xml-data\build-dir\MWC-CIWIN-JOB1>echo C:\Users\bamboo\AppData\Local\Microsoft\WindowsApps;

 

but while adding capabilities to agent, i added path to these tools. Picture attached.

Any suggestion is appreciated, thank you very much for the response and guiding in right direction.

Screen Shot 2020-10-07 at 10.19.54 PM.png

Now i added the path in windows bamboo user environment variable and from bamboo task it return correct result 

08-Oct-2020 05:50:55C:\Users\bamboo\bamboo-agent-home\xml-data\build-dir\MWC-CIWIN-JOB1>echo hi; echo C:\Program Files (x86)\Yarn\bin\;C:\Program Files (x86)\bin\;C:\Program Files\nodejs\;C:\Users\bamboo\AppData\Local\Microsoft\WindowsApps;;
08-Oct-2020 05:50:55hi; echo C:\Program Files (x86)\Yarn\bin\;C:\Program Files (x86)\bin\;C:\Program Files\nodejs\;C:\Users\bamboo\AppData\Local\Microsoft\WindowsApps;;
08-Oct-2020 05:50:55 
08-Oct-2020 05:50:55C:\Users\bamboo\bamboo-agent-home\xml-data\build-dir\MWC-CIWIN-JOB1>yarn -v
08-Oct-2020 05:50:561.22.5

 

but as in the message above this message you see i added the capability(screenshot) and when i run this task(screenshot attached). I get the same error. How to get yarn then?

"Failing task since return code of [C:\Program Files (x86)\Yarn\bin\yarn -v] was -1 while expected 0"

 

Is it cause i am using command task ?? and these tasks might not work for windows cause script tasks returns fine and all the results.

Screen Shot 2020-10-07 at 10.55.27 PM.png

Like Bloompeak Support likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

685 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you