Repository: flutter
Issue: `flutter upgrade` crashes with ProcessException trying to run git on windows
Labels: c: crash,tool,P2,team-tool,triaged-tool

*@lanaspectrum commented on Aug 14, 2019, 12:01 PM UTC:*

## What happened

I got the exception when I tried to run Flutter upgrade following a prompt that a new version is now available

## Version information

Android Studio `3.4.2` • Flutter plugin `io.flutter 38.2.1` • Dart plugin `183.6270`

Error getting Flutter sdk information.

## Exception

null

```
java.lang.Throwable: Flutter device daemon #1: process exited during startup. Exit code: 255, stderr:
CreateProcessW failed 5

CreateProcessW failed 5

CreateProcessW failed 5
Unhandled exception:
ProcessException: Access is denied.

  Command: "\"C:\Program Files\Git\cmd\git.EXE\"" log -n 1 --pretty=format:%H
#0      _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:496:7)
#1      _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:641:18)
#2      Process.runSync (dart:io-patch/process_patch.dart:66:12)
#3      LocalProcessManager.runSync (package:process/src/interface/local_process_manager.dart:93:20)
#4      _runWithLoggingSync (package:flutter_tools/src/base/process.dart:349:48)
#5      runSync (package:flutter_tools/src/base/process.dart:321:10)
#6      _runGit (package:flutter_tools/src/version.dart:535:10)
#7      new FlutterVersion (package:flutter_tools/src/version.dart:23:26)
#8      runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:85:29)
#9      AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:99:41)
#10     __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:291:23)
#11     AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:87:20)
#12     AppContext.get (package:flutter_tools/src/base/context.dart:115:32)
#13     FlutterVersion.instance (package:flutter_tools/src/version.dart:186:49)
#14     new _DefaultUsage (package:flutter_tools/src/reporting/usage.dart:148:58)
#15     new Usage (package:flutter_tools/src/reporting/usage.dart:70:9)
#16     runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:104:20)
#17     AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:99:41)
#18     __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:291:23)
#19     AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:87:20)
#20     AppContext.get (package:flutter_tools/src/base/context.dart:115:32)
#21     Usage.instance (package:flutter_tools/src/reporting/usage.dart:76:40)
#22     flutterUsage (package:flutter_tools/src/reporting/usage.dart:60:33)
#23     _handleToolError (package:flutter_tools/runner.dart:120:7)
<asynchronous suspension>
#24     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:77:13)
<asynchronous suspension>
#25     _rootRunBinary (dart:async/zone.dart:1148:13)
#26     _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#27     runZoned.<anonymous closure> (dart:async/zone.dart:1479:21)
#28     _CustomZone.handleUncaughtError (dart:async/zone.dart:1003:19)
#29     Future._propagateToListeners (dart:async/future_impl.dart:589:16)
#30     Future._completeError (dart:async/future_impl.dart:491:5)
#31     _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#32     _Completer.completeError (dart:async/future_impl.dart:27:5)
#33     _AsyncAwaitCompleter.completeError (dart:async-patch/async_patch.dart:40:18)
#34     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart)
<asynchronous suspension>
#35     _rootRun (dart:async/zone.dart:1124:13)
#36     _CustomZone.run (dart:async/zone.dart:1021:19)
#37     _runZoned (dart:async/zone.dart:1516:10)
#38     runZoned (dart:async/zone.dart:1500:12)
#39     run.<anonymous closure> (package:flutter_tools/runner.dart:61:18)
<asynchronous suspension>
#40     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:29)
<asynchronous suspension>
#41     _rootRun (dart:async/zone.dart:1124:13)
#42     _CustomZone.run (dart:async/zone.dart:1021:19)
#43     _runZoned (dart:async/zone.dart:1516:10)
#44     runZoned (dart:async/zone.dart:1463:12)
#45     AppContext.run (package:flutter_tools/src/base/context.dart:153:18)
<asynchronous suspension>
#46     runInContext (package:flutter_tools/src/context_runner.dart:58:24)
<asynchronous suspension>
#47     run (package:flutter_tools/runner.dart:50:10)
#48     main (package:flutter_tools/executable.dart:65:9)
<asynchronous suspension>
#49     main (file:///C:/Users/oladimeji/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#50     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:303:32)
#51     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)

	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:137)
	at io.flutter.run.daemon.DeviceDaemon$Command.start(DeviceDaemon.java:239)
	at io.flutter.run.daemon.DeviceService.chooseNextDaemon(DeviceService.java:230)
	at io.flutter.utils.Refreshable.runInBackground(Refreshable.java:221)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

```

*This issue was moved by [devoncarew](https://github.com/devoncarew) from [flutter/flutter-intellij#3780](https://github.com/flutter/flutter-intellij/issues/3780).*