Skip to content

loss of service to a local repository upon computer sleep #5734

Closed

Description

@msftrncs

Description

Services to a local repository that is stored on a network share is lost if the computer goes to sleep or hibernates, or possibly with other network access issues.

Version

  • GitHub Desktop: 1.4.0
  • Operating system: Microsoft Windows [Version 10.0.17763.1]

Steps to Reproduce

Leave GitHub Desktop open on a repository that is stored on a network share (Windows Server 2012 R2) and then walk away and allow the computer to sleep and eventually hibernate.
Return to the computer and wake it up.

Expected Behavior

I expect the state of GitHub desktop should return to normal (as was previous before the sleep), if not immediately, I expect it to try again (indefinitely until the user says otherwise) to locate the repository at the path it was last seen.

Actual Behavior

You will find GitHub Desktop reporting 'Can't Find "repository"' along with a path to where it was last seen, and some buttons, 'locate...', 'clone' and 'remove'.

I restarted GitHub desktop, but it just came back up in the same state. I tried pressing the 'locate...' button, but it took me to some other path way too far away (local system drive) to be worth the effort to navigate to. I know the path exists because I still had Explorer windows open to the folder, and they are working fine, immediately after the awakening. All other repositories are fine, even the ones on the same server share, so only the one that was open at the time the machine went to sleep is a problem.

Logs

2018-09-25.desktop.production.log

Activity

  1. msftrncs commented on Sep 25, 2018

    @msftrncs
    ContributorAuthor

    Apparently the repository became corrupt during the sleep event, locating it is doing no good. The issue probably happens when the computer sleeps while GitHub has some uncommitted writes to the database. Fortunately the repository was synced.

  2. msftrncs commented on Sep 25, 2018

    @msftrncs
    ContributorAuthor

    Additional, the database and the older seem to be intact, as GIT and VS Code operated repository just fine.

  3. shiftkey commented on Sep 25, 2018

    @shiftkey
    Member

    @msftrncs thanks for the report.

    I know the path exists because I still had Explorer windows open to the folder, and they are working fine, immediately after the awakening.

    Once Desktop is unable to find the repository on disk, it'll stay in that "missing" state until being resolved. Anecdotally, we mostly see this "missing" flow occur when someone renames or deletes a folder on disk without updating Desktop. We've not talked about checking the location again to see if the folder is accessible again, which might help for scenarios like repositories on network shares, but I'm not sure how many of our users are working with this sort of setup.

    I restarted GitHub desktop, but it just came back up in the same state. I tried pressing the 'locate...' button, but it took me to some other path way too far away (local system drive) to be worth the effort to navigate to.

    As a workaround, you can drag-and-drop the folder onto Desktop to re-add it. But this is an interesting bit of information, as we don't seem to use the old location at all when trying to relocate the repository:

    public async relocateRepository(repository: Repository): Promise<void> {
    const directories = remote.dialog.showOpenDialog({
    properties: ['openDirectory'],
    })
    if (directories && directories.length > 0) {
    const newPath = directories[0]
    await this.updateRepositoryPath(repository, newPath)
    }
    }

    If we try and open Explorer to the parent directory where we last saw this repository, would that help make this flow easier? I'm also not sure how it'd work if the network share itself is unaccessible, but I suspect Windows will put you somewhere.

  4. added
    priority-3
    on Sep 25, 2018
  5. msftrncs commented on Sep 26, 2018

    @msftrncs
    ContributorAuthor

    Nice to know about the dragging, I've probably seen that somewhere, but didn't think about that. I eventually 'removed' it and used 'add local repository' and everything came back online. I think because it was the last repository I had added, the location came up right away in the file dialog for adding a local repository.

    I'm not sure what happens if you try to open the dialog with the default path unreachable either... but I am thinking it goes back to the users home path, after a short delay, with no error message.

  6. msftrncs commented on Nov 14, 2018

    @msftrncs
    ContributorAuthor

    Just flagging that this issue is effectively a duplicate to #4264 which is in the Available In Community project.

  7. shiftkey commented on Nov 14, 2018

    @shiftkey
    Member

    @msftrncs thanks for the heads up. I'm going to cross-reference this issue there so we avoid carrying duplicates around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions