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

Installer doesn't request elevation, then it hangs during config near end of installation #1768

Closed
1 task done
stanwest opened this issue Jul 26, 2018 · 4 comments
Closed
1 task done

Comments

@stanwest
Copy link

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

    $ git --version --build-options
    
    git version 2.18.0.windows.1
    cpu: x86_64
    built from commit: cd1a74fc9dc8a07626c216940db9a51f25206e03
    sizeof-long: 4
    
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

    Windows 10 64-bit.

    $ cmd.exe /c ver
    
    Microsoft Windows [Version 10.0.16299.551]
    
  • What options did you set as part of the installation? Or did you choose the
    defaults?

    Editor Option: Notepad++
    Path Option: Cmd
    SSH Option: OpenSSH
    CURL Option: OpenSSL
    CRLF Option: CRLFAlways
    Bash Terminal Option: ConHost
    Performance Tweaks FSCache: Enabled
    Use Credential Manager: Enabled
    Enable Symlinks: Disabled
    
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

    None known.

Details

When I ran the installer (Git-2.18.0-64-bit.exe) from my non-privileged user account, it did not prompt for elevated privileges but proceeded into the wizard. I accepted its proposed installation path under my AppData directory. Once the installer's progress bar filled, the installer remained in that state for several minutes. With Process Explorer, I saw that a subprocess with the following command line was running within the C:\ProgramData\Git directory:

"C:\Users\stan.west\AppData\Local\Programs\Git\mingw64\bin\git.exe" config -f config core.autocrlf true

After I killed that process, the installer continued and then exited after I clicked the "Finish" button on the final pane.

I expected, if that installer is intended only for system (not user) installations, that it would prompt for elevated privileges. If it may be used for user installations, I expect it not to try to modify a system configuration file at C:\ProgramData\Git\config.

When I explicitly ran the installer as administrator, it completed without hanging and modified the system configuration file.

Cause of hanging

It appears that the cause of the installer hanging is git config waiting on input. When I used the Command Prompt to run the command line above in the correct directory, git config asked to retry (because it lacked privileges to modify the config file) and waited for a response:

C:\ProgramData\Git>"C:\Users\stan.west\AppData\Local\Programs\Git\mingw64\bin\git.exe" config -f config core.autocrlf true
Rename from 'C:/ProgramData/Git/config.lock' to 'C:/ProgramData/Git/config' failed. Should I try again? (y/n)

That left a new file C:\ProgramData\Git\config.lock. When I ran the above command thereafter, git config instead printed an error message and terminated immediately:

C:\ProgramData\Git>"C:\Users\stan.west\AppData\Local\Programs\Git\mingw64\bin\git.exe" config -f config core.autocrlf true
error: could not lock config file config: File exists

That suggests that a second run of the installer would appear to succeed, although it would have failed to alter the system configuration file.

Installer log

When I ran the installer with /log=<file> (and with no lingering config.lock file), the installer hung after writing the "Installation process succeeded" line and continued after I killed the git config subprocess. The tail of the log is as follows:

2018-07-26 14:48:29.405   Creating the icon.
2018-07-26 14:48:29.410   Successfully created the icon.
2018-07-26 14:48:29.475   Installation process succeeded.
2018-07-26 14:53:05.840   Extracting temporary file: C:\Users\STAN~1.WES\AppData\Local\Temp\1\is-6364K.tmp\edit-git-bash.exe
2018-07-26 14:53:06.861   Line 2155: Executing C:\Users\stan.west\AppData\Local\Programs\Git\post-install.bat
2018-07-26 14:53:07.712   Line 2163: post-install scripts run successfully:
                          "running post-install"
                          'C:\WINDOWS\system32\drivers\etc\hosts' -> '/etc/hosts'
                          'C:\WINDOWS\system32\drivers\etc\protocol' -> '/etc/protocols'
                          'C:\WINDOWS\system32\drivers\etc\services' -> '/etc/services'
                          'C:\WINDOWS\system32\drivers\etc\networks' -> '/etc/networks'
                          
2018-07-26 14:53:08.598   Need to restart Windows? No
2018-07-26 14:53:18.116   Deinitializing Setup.
2018-07-26 14:53:18.131   Log closed.
@kstrophus
Copy link

I have the same issue. The installer hangs and never completes. Windows 7 and Git 2.22. Using the log option produces this output and stops progressing (but a new "git" process pops into my task manager):

2019-07-22 14:14:06.800 Installation process succeeded.
2019-07-22 14:14:06.956 Extracting temporary file: C:\Users\JCC3B~1.GRO\AppData\Local\Temp\is-IUF49.tmp\programdata-config.template

@dscho
Copy link
Member

dscho commented Oct 14, 2019

I don't even know how the installer can be started without requiring elevation. In my case, it always does.

@the-j0k3r
Copy link

To any one interested in a workaround read #2158 (comment)

It worked for me. =)

@stanwest
Copy link
Author

Pull request #2358, specifically commit 5a95abc, seems to have resolved the root cause of this issue—that an installation step tried unsuccessfully to modify C:/ProgramData/Git/config and asked whether to try again, although no one was there to respond.

Also, I found that to reproduce this issue, the directory C:\Program Files\Git (or C:\Program Files (x86)\Git for 32-bit, I imagine) must not exist. When I ran the installer with that directory present (and without administrative privileges), the installer failed early, displaying the message:

Setup was unable to create the directory "C:\Program Files\Git\tmp".

Error 5: Access is denied.

(The message is similar with Git-2.26.0-64-bit.exe but with dev instead of tmp.) When the Git directory is missing, the installation path defaulted to %LOCALAPPDATA%\Programs\Git, and the installer was able to install the program files before hanging.

Although the installer for version 2.26.0 similarly does not prompt me for elevated privileges, I'm closing this issue because its root cause appears resolved.

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

4 participants