Windows self-hosted runner fails to start
Asked by Peter Mihalik:

Hi, I'm getting this error when trying to start my windows runner:

```
[2022-06-03 09:11:26,175] Runner version: 1.323
[2022-06-03 09:11:26,206] Runner runtime: windows-powershell
Exception in thread "main" com.atlassian.pipelines.runner.core.exception.PrerequisiteFailedRunnerException: git executab
le not found in PATH.
[2022-06-03 09:11:28,050] Updating runner state to "OFFLINE".
[2022-06-03 09:11:29,678] An error occurred whilst updating runner state to "OFFLINE".
com.atlassian.pipelines.stargate.client.core.exceptions.StargateBadRequestException: Response Summary: HttpResponseSumma
ry{httpStatusCode=400, httpStatusMessage=Bad Request, bodyAsString={"key":"agent-service.request.bad-request","message":
"Can not transition runner state from UNREGISTERED to OFFLINE","arguments":{}}}
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
*__checkpoint ? 400 from PUT https://api.atlassian.com/ex/bitbucket-pipelines/rest/internal/accounts/%7Bafc96ffc
-a203-4350-b6ca-34143b78cec2%7D/repositories/%7B30dfa15e-21a2-488f-ac32-59428f33e982%7D/runners/%7B34884e10-bd00-5ec6-ba
c9-334015506810%7D/state [DefaultWebClient]
Original Stack Trace:
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImp
l.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAcc
essorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.atlassian.bitbucketci.client.reactive.ResponseExceptionFactory$ConstructorInvoker.invokeConstruct
or(ResponseExceptionFactory.java:117)
at io.vavr.CheckedFunction1.lambda$unchecked$43b513dd$1(CheckedFunction1.java:220)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:106)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
at reactor.core.publisher.FluxDefaultIfEmpty$DefaultIfEmptySubscriber.onNext(FluxDefaultIfEmpty.java:101
)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127)
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107)
at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onNext(FluxMapFuseable.java:2
95)
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableConditionalSubscriber.onNext(FluxFilterFuseab
le.java:337)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)
at reactor.core.publisher.MonoCollect$CollectSubscriber.onComplete(MonoCollect.java:159)
at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260)
at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)
at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:400)
at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:419)
at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:473)
at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:703)
at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:93)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:3
79)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:3
65)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357
)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:3
79)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:3
65)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357
)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(Combine
dChannelDuplexHandler.java:436)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:3
79)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:3
65)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357
)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1372)
at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1235)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1284)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:
510)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:449)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:279)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:3
79)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:3
65)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357
)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:3
79)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:3
65)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)
[2022-06-03 09:11:29,678] Shutdown completed
```


Answers:
author: Patrik S
body: Hello [@Peter Mihalik](/t5/user/viewprofilepage/user-id/1103081) ,

Thank you for reaching out to Atlassian Community!

From the error being shown in the logs :

```
git executable not found in PATH
```

It looks like the environment you are executing the runners currently have not git installed or the path for the git.exe is not in the $PATH environment variable of your system.

Having said that, could you please make sure you have installed **git** in the machine where you are executing the runners? You can download git for windows at the following link :

* <https://git-scm.com/download/win>

In case it's already installed and you are still facing the error, please make sure to include the full path of the folder that contains git.exe to the PATH environment variable of your system and try starting the runner again. The folder is usually *C:\\Program Files\\Git\\bin* or *C:\\Program Files\\Git\\mingw64\\bin .*

Let me know in case you have any questions.

Thank you [@Peter Mihalik](/t5/user/viewprofilepage/user-id/1103081) ,

Kind regards,

Patrik S

comments: author: Peter Mihalik
body: Hi [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) git is installed, but it looks like I just forgot to restart the powershell terminal and the PATH wasn't updated. After retrying it now works OK.

Thanks,

Peter


author: admin
body: [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) ,

I'm getting the exact same error. However, I've install latest git and it's in PATH as well.

$ which git  
/d/utils/git/mingw64/bin/git

$ git --version  
git version 2.37.2.windows.2

do you have any suggestions? I'm running in Win 10 Pro.

./start.sh --accountUuid {...} --repositoryUuid {...} --runnerUuid {...} --OAuthClientId ... --OAuthClientSecret ... --runtime linux-shell --workingDirectory ../temp  
\[2022-08-16 01:44:22,363\] Runner version: 1.346  
\[2022-08-16 01:44:22,394\] Runner runtime: linux-shell  
Exception in thread "main" com.atlassian.pipelines.runner.core.exception.PrerequisiteFailedRunnerException: git executable not found in PATH.  
\[2022-08-16 01:44:25,790\] Updating runner state to "OFFLINE".  
\[2022-08-16 01:44:27,991\] An error occurred whilst updating runner state to "OFFLINE".  
com.atlassian.pipelines.stargate.client.core.exceptions.StargateBadRequestException: Response Summary: HttpResponseSummary{httpStatusCode=400, httpStatusMessage=Bad Request, bodyAsString={"key":"agent-service.request.bad-request","message":"Can not transition runner state from UNREGISTERED to OFFLINE","arguments":{}}}  
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:  
Error has been observed at the following site(s):  
\*__checkpoint ? 400 from PUT <https://api.atlassian.com/ex/bitbucket-pipelines/rest/internal/accounts/.../repositories/.../runners/.../state> \[DefaultWebClient\]  
Original Stack Trace:  
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)  
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)  
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)  
at com.atlassian.bitbucketci.client.reactive.ResponseExceptionFactory$ConstructorInvoker.invokeConstructor(ResponseExceptionFactory.java:117)  
at io.vavr.CheckedFunction1.lambda$unchecked$43b513dd$1(CheckedFunction1.java:220)  
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:106)  
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)  
at reactor.core.publisher.FluxDefaultIfEmpty$DefaultIfEmptySubscriber.onNext(FluxDefaultIfEmpty.java:101)  
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127)  
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107)  
at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onNext(FluxMapFuseable.java:295)  
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableConditionalSubscriber.onNext(FluxFilterFuseable.java:337)  
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)  
at reactor.core.publisher.MonoCollect$CollectSubscriber.onComplete(MonoCollect.java:159)  
at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)  
at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260)  
at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)  
at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:400)  
at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:419)  
at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:473)  
at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:703)  
at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:93)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)  
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)  
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)  
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327)  
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299)  
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)  
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1372)  
at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1235)  
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1284)  
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:510)  
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:449)  
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:279)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)  
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)  
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)  
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)  
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)  
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)  
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)  
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)  
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)  
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)  
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)  
at java.base/java.lang.Thread.run(Thread.java:834)  
\[2022-08-16 01:44:27,991\] Shutdown completed

Thanks


author: admin
body: I'm running in Git Bash window.


author: Dan
body: I cant believe I forgot to install git! that's hilarious, thank you for the help!


Tags: bitbucket-cloud

cloud