Skip to content

Folder Redirection Windows #2972

Closed
Closed

Description

@andrew-davis

Description

I'm using a Win7 machine at work and it is configured with folder redirection.

https://technet.microsoft.com/en-us/library/cc732275(v=ws.11).aspx
https://en.wikipedia.org/wiki/Folder_redirection

This configuration forces Github Desktop to install at \\NETWORK\Redirected\USERNAME\Application Data\GitHub Desktop. The application opens, but much of the functionality is broken because it has trouble finding and using the data in the folder.

I had the same issue with Atom and I created this issue atom/atom#15663. We were able to workaround by creating an 'electronUserData' folder at C:\Users\USERNAME\.atom.

Is it possible to do something similar with Github Desktop to restore functionality?

Thanks for your help.

Version

GitHub Desktop version: [1.0.3]

OS version: [Microsoft Windows 6.1.7601]

Logs

2017-09-21.desktop.production.log
2017-09-22.desktop.production.log
2017-10-05.desktop.production.log

Activity

  1. shiftkey commented on Oct 5, 2017

    @shiftkey
    Member

    Looking over the Atom source, it looks like they will change the userData path for the Electron app at runtime if they find a writeable directory at a given path:

      setUserData: (app) => {
        const electronUserDataPath = path.join(process.env.ATOM_HOME, 'electronUserData')
        if (fs.existsSync(electronUserDataPath)) {
          if (hasWriteAccess(electronUserDataPath)) {
            app.setPath('userData', electronUserDataPath)
          } else {
            // A path exists so it was intended to be used but we didn't have rights, so warn.
            console.log(`Insufficient permission to Electron user data "${electronUserDataPath}".`)
          }
        }

    https://github.com/atom/atom/blob/623caaf85d541737d495a98ef47742a656647c9f/src/atom-paths.js#L49-L58

    However this problem looks different to the one you encountered in Atom:

    2017-09-21T23:16:05.933Z - error: [ui] `git -c credential.helper= lfs clone --recursive --progress --progress -- https://github.com/SierraNevadaBrewingCo/website-custom-pages.git \\harvest\Redirected\andrewd\My Documents\GitHub\website-custom-pages` exited with an unexpected code: 2.
    Cloning into '\\harvest\Redirected\andrewd\My Documents\GitHub\website-custom-pages'...
    remote: Counting objects: 4, done.        
    remote: Compressing objects:  33% (1/3)           
    remote: Compressing objects:  66% (2/3)           
    remote: Compressing objects: 100% (3/3)           
    remote: Compressing objects: 100% (3/3), done.        
    remote: Total 4 (delta 1), reused 4 (delta 1), pack-reused 0        
    fatal: unable to get current working directory: No such file or directory
    warning: Clone succeeded, but checkout failed.
    You can inspect what was checked out with 'git status'
    and retry the checkout with 'git checkout -f HEAD'
    
    Error(s) during clone:
    git clone failed: exit status 128
    

    This looks like Git is trying to clone a repository to a network share, and failing during the checkout stage. Particularly this error:

    fatal: unable to get current working directory: No such file or directory
    

    This won't be solved by the same fix that was used with Atom.

  2. shiftkey commented on Oct 5, 2017

    @shiftkey
    Member

    As a workaround, you could use a local folder under C:\ as your clone directory to bypass the redirected My Documents folder.

  3. andrew-davis commented on Oct 9, 2017

    @andrew-davis
    Author

    First, I tried to clone an existing github repo to a C:\ location. It threw an authentication error. I used the same credentials that I sign into github with to access that repo.

    Second, I used GitGUI to clone an existing repo to a C:\ location and try to open it with github desktop. In github desktop, after selecting the local repo folder and clicking 'clone', nothing happens. No repo. No error. Nothing.

    I'm baffled by all this - unless it goes back to my original theory, that elements critical to the application are being saved in a folder that it can't access in an ongoing manor (windows folder redirection).

    Attached are the logs show my two different attempts detailed above. Thanks for all your help!

    2017-10-09.desktop.production.log

  4. shiftkey commented on Oct 10, 2017

    @shiftkey
    Member

    Second, I used GitGUI to clone an existing repo to a C:\ location and try to open it with github desktop. In github desktop, after selecting the local repo folder and clicking 'clone', nothing happens. No repo. No error. Nothing.

    Are you using the flow I described in #2995 and providing a folder path rather than a URL? What if you use File | Add existing repository? Does that get you further?

    I'm baffled by all this - unless it goes back to my original theory, that elements critical to the application are being saved in a folder that it can't access in an ongoing manor (windows folder redirection).

    It could be, but I think this is an issue with Git not handling folder redirection correctly - that will require some coordination with the upstream Git for Windows project.

    Looking at the log file, I see these two errors:

    2017-10-09T16:44:03.470Z - warn: [ui] fetchRepository: an error occurred for 'SierraNevadaBrewingCo/craft-test2'
    TypeError: Failed to execute 'fetch' on 'Window': Invalid value
        at Object.t.request (C:\Users\andrewd\AppData\Local\GitHubDesktop\app-1.0.3\webpack:\app\src\lib\http.ts:126:2)
        at b.request (C:\Users\andrewd\AppData\Local\GitHubDesktop\app-1.0.3\webpack:\app\src\lib\api.ts:444:17)
        at b.fetchRepository (C:\Users\andrewd\AppData\Local\GitHubDesktop\app-1.0.3\webpack:\app\src\lib\api.ts:218:9)
        at C.resolveCloneURL (C:\Users\andrewd\AppData\Local\GitHubDesktop\app-1.0.3\webpack:\app\src\ui\clone-repository\clone-repository.tsx:330:45)
        at <anonymous>
    

    I had a similar report of this from over here #2453 (comment) but I never did get to the bottom of what this "Invalid value" is referring to.

    Cloning into 'C:\Users\andrewd\github\craft-test2'...
    remote: Invalid username or password.
    fatal: Authentication failed for 'https://github.com/SierraNevadaBrewingCo/craft-test2/'
    Error(s) during clone:
    git clone failed: exit status 128
    
    (The error was parsed as 3: Authentication failed. You may not have permission to access the repository. Open options and verify that you're signed in with an account that has permission to access this repository.)
    

    This looks like we aren't able to get the token from your account - can you confirm you are signed into the app?

  5. andrew-davis commented on Oct 10, 2017

    @andrew-davis
    Author

    I really appreciate your help on this!

    Are you using the flow I described in #2995 and providing a folder path rather than a URL? What if you use File | Add existing repository? Does that get you further?

    I did use the URL tab, as described in #2995. Because, even though I'm signed in, there are no repos shown for me on the github tab. I tried signing out and back in. Even uninstalling and reinstalling. Issue still persists. EDIT: forgot to mention that using 'add local repo' does not do anything either.

    I had a similar report of this from over here #2453 (comment) but I never did get to the bottom of what this "Invalid value" is referring to.

    I read through #2453. I checked my windows credentials. Some of them were missing either the username or password field. I updated them, but still nothing changes for me in the app.

    I have attached the console output from the dev tools. Hopefully it will help shed some on the issue. Thank you for all your help.

    -1507648072282.log

  6. added
    investigation-needed
    windows
    on Oct 18, 2017
  7. stale commented on Nov 1, 2017

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

  8. niik commented on Nov 2, 2017

    @niik
    Member

    Thanks for that log file @andrew-davis, that does indeed look like the same problem that you reported in the atom issue. It would appear as if electron has trouble with exposing IndexedDB (the storage solution where we keep, amongst other things usernames and tracked repositories) and a few other critical pieces from a redirected folder.

    I had the same issue with Atom and I created this issue atom/atom#15663. We were able to workaround by creating an 'electronUserData' folder at C:\Users\USERNAME.atom.

    Is it possible to do something similar with Github Desktop to restore functionality?

    There isn't I'm afraid. That code is related to Atom's portable mode and GitHub Desktop currently doesn't support portable mode.

    This won't be solved by the same fix that was used with Atom.

    @shiftkey is very likely correct in that our problems run a bit deeper since we might also have to contend with Git here so even if we did implement the trick from Atom we'd still have problems. Unfortunately this setup is non-trivial to replicate so I'm not going to be able to get an environment set up any time soon. Perhaps if @shiftkey is feeling adventurous.

  9. andrew-davis commented on Nov 2, 2017

    @andrew-davis
    Author

    I understand it's difficult to reproduce. It's an edge case, for sure. I can't find any other references to it, so I could be the only one experiencing this. May I suggest that we tag the item as an acknowledged issue - but not something of high priority?

    Thanks for all your help.

  10. nerdneha commented on Feb 6, 2018

    @nerdneha
    Contributor

    Hey @andrew-davis! We'll be merging this into our "known issues" doc to track it there. You can see it being referred to in #3943

  11. added this to the 1.1.x milestone on Feb 22, 2018
  12. locked as resolved and limited conversation to collaborators on Jul 18, 2018
  13. unlocked this conversation on Sep 27, 2018
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

    investigation-neededwindows

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions