Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Desktop fails to start; instantly crashes #18356

Closed
Vectorial1024 opened this issue Mar 25, 2024 · 6 comments
Closed

GitHub Desktop fails to start; instantly crashes #18356

Vectorial1024 opened this issue Mar 25, 2024 · 6 comments

Comments

@Vectorial1024
Copy link

The problem

Unable to use GitHub Desktop because it crashes on startup; also unable to find any crash logs. (Where are the crash logs?)

Tried clean reinstalling e.g. removing the folder inside %AppData%, bu no change of effects.

Release version

3.3.12 (inferred from AppData since cannot open app)

Operating system

Windows 11

Steps to reproduce the behavior

  1. Open GitHub Desktop
  2. GitHub Desktop opens (has app icon in taskbar), but loads slowly
  3. GitHub Desktop shows a blank/transparent screen
  4. After a while, GitHub Desktop exits (I did not reach the main screen)

Log files

No response

Screenshots

No response

Additional context

No response

@Vectorial1024
Copy link
Author

Update: eventually, I was fed up with the failures, and decided to do a clean reinstall again, except I go get some water when the reinstall is ongoing. To my surprise, GitHub Desktop finally launches correctly and brings me to the "sign up or log in" page.

My guess is that I was too impatient and launched GitHub Desktop when it was not "ready" yet, and so the app image was somehow broken.

Would be nice to have someone come in and provide more help.

@steveward
Copy link
Member

Thanks for the report @Vectorial1024. Any installation logs would be available in %LocalAppData%\GitHubDesktop\SquirrelSetup.log.

If no log file is being generated there you should be able to find one in the SquirrelTemp directory in %LocalAppData%\SquirrelTemp\SquirrelSetup.log.

Since you were able to resolve this with a clean reinstall I'm going to close this out, but feel free to upload the install log files and I can take a look.

@Vectorial1024
Copy link
Author

Thanks for the hints!

I did eventually find something in %LocalAppData%\SquirrelTemp\Squirrel-Install.log, which seems interesting:

[25/03/24 12:19:12] info: Program: About to install to: %LocalAppData%\GitHubDesktop
[25/03/24 12:19:12] info: CheckForUpdateImpl: Reading RELEASES file from %LocalAppData%\SquirrelTemp
[25/03/24 12:19:12] info: CheckForUpdateImpl: First run, starting from scratch
[25/03/24 12:19:13] info: ApplyReleasesImpl: Writing files to app directory: %LocalAppData%\GitHubDesktop\app-3.3.12
[25/03/24 12:19:14] info: LogHost: Rigging execution stub for GitHubDesktop_ExecutionStub.exe to %LocalAppData%\GitHubDesktop\GitHubDesktop.exe
[25/03/24 12:19:20] info: ApplyReleasesImpl: Squirrel Enabled Apps: [%LocalAppData%\GitHubDesktop\app-3.3.12\GitHubDesktop.exe]
[25/03/24 12:19:35] error: ApplyReleasesImpl: Couldn't run Squirrel hook, continuing: %LocalAppData%\GitHubDesktop\app-3.3.12\GitHubDesktop.exe: System.OperationCanceledException: The operation was canceled.
   at System.Threading.CancellationToken.ThrowOperationCanceledException()
   at Squirrel.Utility.<>c__DisplayClass11_0.<InvokeProcessAsync>b__0()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<InvokeProcessAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.UpdateManager.ApplyReleasesImpl.<>c__DisplayClass10_0.<<invokePostInstall>b__0>d.MoveNext()
[25/03/24 12:19:37] info: ApplyReleasesImpl: Starting fixPinnedExecutables
[25/03/24 12:19:37] info: ApplyReleasesImpl: Fixing up tray icons
[25/03/24 12:19:37] info: ApplyReleasesImpl: cleanDeadVersions: checking for version 3.3.12
[25/03/24 12:19:37] info: ApplyReleasesImpl: cleanDeadVersions: exclude new version folder app-3.3.12
[25/03/24 12:19:37] warn: ApplyReleasesImpl: Failed to clean dead versions, continuing anyways: System.IO.DirectoryNotFoundException: Could not find a part of the path '%LocalAppData%\GitHubDesktop\packages\RELEASES'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at Squirrel.UpdateManager.ApplyReleasesImpl.<cleanDeadVersions>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.UpdateManager.ApplyReleasesImpl.<ApplyReleases>d__2.MoveNext()
[25/03/24 12:19:37] error: IEnableLogger: Failed to create uninstaller registry entry: System.IO.DirectoryNotFoundException: Could not find a part of the path '%LocalAppData%\GitHubDesktop\packages\RELEASES'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at Squirrel.UpdateManager.InstallHelperImpl.<CreateUninstallerRegistryEntry>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__43`1.MoveNext()
[25/03/24 12:19:37] fatal: Finished with unhandled exception: System.AggregateException: One or more errors occurred. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path '%LocalAppData%\GitHubDesktop\packages\RELEASES'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at Squirrel.UpdateManager.InstallHelperImpl.<CreateUninstallerRegistryEntry>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__43`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Update.Program.<Install>d__4.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Squirrel.Update.Program.executeCommandLine(String[] args)
   at Squirrel.Update.Program.main(String[] args)
---> (Inner Exception #0) System.IO.DirectoryNotFoundException: Could not find a part of the path '%LocalAppData%\GitHubDesktop\packages\RELEASES'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at Squirrel.UpdateManager.InstallHelperImpl.<CreateUninstallerRegistryEntry>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__43`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Update.Program.<Install>d__4.MoveNext()<---

And then in %LocalAppData%\SquirrelTemp\Squirrel-Install.1.log:

[25/03/24 12:19:21] info: Program: Starting Squirrel Updater: --install . --rerunningWithoutUAC
[25/03/24 12:19:21] info: Program: Starting install, writing to %LocalAppData%\SquirrelTemp
[25/03/24 12:19:21] info: Program: About to install to: %LocalAppData%\GitHubDesktop
[25/03/24 12:19:21] warn: Program: Install path %LocalAppData%\GitHubDesktop already exists, burning it to the ground
[25/03/24 12:19:22] error: IEnableLogger: Failed to remove existing directory on full install, is the app still running???: System.UnauthorizedAccessException: Access to the path '%LocalAppData%\GitHubDesktop\app-3.3.12\GitHubDesktop.exe' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalDelete(String path, Boolean checkHost)
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Squirrel.Utility.<>c__DisplayClass13_1`1.<<ForEachAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<DeleteDirectory>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<>c.<<DeleteDirectory>b__19_1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Squirrel.Utility.<>c__DisplayClass13_1`1.<<ForEachAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<DeleteDirectory>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__42.MoveNext()
[25/03/24 12:19:22] fatal: Finished with unhandled exception: System.AggregateException: One or more errors occurred. ---> System.UnauthorizedAccessException: Access to the path '%LocalAppData%\GitHubDesktop\app-3.3.12\GitHubDesktop.exe' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalDelete(String path, Boolean checkHost)
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Squirrel.Utility.<>c__DisplayClass13_1`1.<<ForEachAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<DeleteDirectory>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<>c.<<DeleteDirectory>b__19_1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Squirrel.Utility.<>c__DisplayClass13_1`1.<<ForEachAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<DeleteDirectory>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Update.Program.<Install>d__4.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Squirrel.Update.Program.executeCommandLine(String[] args)
   at Squirrel.Update.Program.main(String[] args)
---> (Inner Exception #0) System.UnauthorizedAccessException: Access to the path '%LocalAppData%\GitHubDesktop\app-3.3.12\GitHubDesktop.exe' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalDelete(String path, Boolean checkHost)
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Squirrel.Utility.<>c__DisplayClass13_1`1.<<ForEachAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<DeleteDirectory>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<>c.<<DeleteDirectory>b__19_1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Squirrel.Utility.<>c__DisplayClass13_1`1.<<ForEachAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<DeleteDirectory>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Update.Program.<Install>d__4.MoveNext()<---

This seems to explain why it just crashes with no apparent explanation.

@Vectorial1024
Copy link
Author

In fact, I am getting a real deja vu here. I was dealing with several other apps near the same time period e.g. installing Slack, and then Slack was behaving very similarly: it also failed to start and instantly crashed. Slack had the courtesy of telling me "permission denied" after it crashed.

What I did when dealing with the Slack app was to repair the Win11 environment using DISM. That certainly fixed Slack crashing on startup, but it was not enough to fix GitHub Desktop crashing on startup. This went on for a few days and then I decided to open an issue here, and then it somehow resolved itself...

Again, I am not sure whether I was too impatient to force-launch the app too early (notice the The operation was canceled. wording in the log file) that broke some of the app auto-update mechanisms.

@Vectorial1024
Copy link
Author

I am installing GitHub Desktop recently again, and also found basically the same problem.

This time, I opened up the task manager, and looked at the process list.

I noticed that when I am starting GitHub Desktop, there are several GitHubDesktop.exe processes in the process list, but suddenly, one of them goes to suspended state, and then soon afterwards, the GitHub Desktop app itself crashes, which kills all GitHubDesktop.exe processes except the suspended one.

I somehow cannot kill the suspended process.

@Vectorial1024
Copy link
Author

Update: I think I successfully set up GitHub Desktop again. @steveward would you like to review this?

The steps were basically the following:

  1. Do a manual cleanup:
  • Uninstall GitHub Desktop via Settings
  • Also uninstall GitHub Desktop Deployment Tool via Settings if exists
  • Remove %AppData%/GitHub Desktop/*
  • Remove %LocalAppData%/GitHubDesktop/*
  • Remove the desktop shortcut if exists
  1. Restart Windows
  2. Do NOT download the EXE installer; download the MSI installer instead
  3. Run the MSI installer
  4. Restart Windows
  5. Wait for the Deployment Tool to finish; supposedly, it should create a new shortcut in the desktop
  6. Right click on that shortcut to run as admin (important!)
  7. It should open GitHub Desktop without crashing, showing you the login page
  8. Close GitHub Desktop
  9. Verify: run it again normally (not as admin)
  10. It should open correctly also

Before finding out the above steps, I actually installed SourceTree as a backup git option, but hopefully, this does not change whether GitHub Desktop can be successfully installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@steveward @Vectorial1024 and others