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

Unable to install Windows Terminal Fragment to C:\ProgramData\Microsoft\Windows Terminal\Fragments\Git\git-bash.json error while updating #3312

Closed
1 task done
darkred opened this issue Jul 6, 2021 · 25 comments · Fixed by git-for-windows/build-extra#363
Milestone

Comments

@darkred
Copy link

darkred commented Jul 6, 2021

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

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

git version 2.32.0.windows.2
cpu: x86_64
built from commit: 3d45ac813c4adf97fe3733c1f763ab6617d5add5
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19043.1081]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Core
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

(nothing)

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

MINGW64

I just ran Git-2.32.0.2-64-bit.exe to upgrade from Git-2.32.0-64-bit.exe

  • What did you expect to occur after running these commands?

No error, just to complete.

  • What actually happened instead?

I got this error:

Line 2798: Unable to install Windows Terminal Fragment to C:\ProgramData\Microsoft\Windows Terminal\Fragments\Git\git-bash.json

2021-07-07_004135

Note: there is no C:\ProgramData\Microsoft\Windows Terminal path in my system.
But, I have Windows Terminal 1.8.1521.0 installed via Microsoft Store.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

(nothing)

@darkred darkred changed the title Unable to install Windows Terminal Fragment to C:\ProgramData\Microsoft\Windows Terminal\Fragments\Git\git-bash.json Unable to install Windows Terminal Fragment to C:\ProgramData\Microsoft\Windows Terminal\Fragments\Git\git-bash.json error while updating Jul 6, 2021
@jeremyd2019
Copy link

I saw this too. It seems to be an upgrade situation when the fragment was installed by old version and is trying to be installed by the new version. Re-running the installer resulted in it successfully installing the fragment.

@dscho
Copy link
Member

dscho commented Jul 7, 2021

Hmm. I guess we cannot rely on the directory to exist when InstallWindowsTerminalFragment() is running? Even if it should have been created (but maybe that comes after what we do in the post-install phase. Puzzled.

It would probably paper over the issue if we called ForceDirectories() in InstallWindowsTerminalFragment(), but I would love to understand how this is happening.

@rimrul
Copy link
Member

rimrul commented Jul 7, 2021

[Dirs] is processed during the so called "actual installation process", ssPostInstall happens after that, so the directory should exist.

@darkred
Copy link
Author

darkred commented Jul 7, 2021

[Dirs] is processed during the so called "actual installation process", ssPostInstall happens after that, so the directory should exist.

No, the C:\ProgramData\Microsoft\Windows Terminal parent directory didn't exist for me yesterday that I did the upgrade.
It was only created just now, when I re-ran the installer, as @jeremyd2019 described:

Re-running the installer resulted in it successfully installing the fragment.

and contains just 1 file, git-bash.json:

screenshot (click to expand)

2021-07-07_123619

@liayn
Copy link

liayn commented Jul 7, 2021

I do get the same error message. Let me know if you need system details which help to narrow the root cause.

@rimrul
Copy link
Member

rimrul commented Jul 7, 2021

No, the C:\ProgramData\Microsoft\Windows Terminal parent directory didn't exist for me yesterday that I did the upgrade.

Sorry, I wasn't clear there. I didn't mean to say the directory exists on your computer.

I meant to clarify to dscho that our understanding of what part of the iss file gets proccessed in what order was as documented and the issue seems to be that processing of the [Dirs] section can apparently silently fail to create the expected directories under certain conditions.

@rimrul
Copy link
Member

rimrul commented Jul 7, 2021

I found a slight discrepancy between [Dirs] and InstallWindowsTerminalFragment() but from my understanding it can't be the cause of this error.

We check IsAdminInstallMode() in InstallWindowsTerminalFragment(), but IsAdminLoggedOn() in [Dirs]. If I understand the difference correctly, this could cause us to create the directory for a System install and then fail to put the file into the target directory for a per-user install, under cetrain circumstances, but the resulting error message would be about C:\users\xyz\appdata\local\Microsoft\Windows Terminal\Fragments\Git\git-bash.json (or similar).

I don't think IsAdminInstallMode() can return true without IsAdminLoggedOn() also returning true, though.

@dscho
Copy link
Member

dscho commented Jul 7, 2021

Oh, I think I know what it is: during an upgrade, we uninstall the previous version. That also happens during ssPostInstall.

I actually started putting together a PR (using the occasion for some other improvements in the installer I've been meaning to work on for ages), but got side-tracked by a vaccination.

Watch this space for updates from my side.

@dscho
Copy link
Member

dscho commented Jul 8, 2021

Here is the update: git-for-windows/build-extra#363

dscho added a commit to git-for-windows/build-extra that referenced this issue Jul 15, 2021
The installer no longer [shows an error
dialog](git-for-windows/git#3312) when
upgrading while the Windows Terminal Profile option is checked.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho added this to the Next release milestone Jul 15, 2021
@dscho
Copy link
Member

dscho commented Jul 15, 2021

Once the Git artifacts run has completed, the Snapshots release pipeline should be triggered automatically to upload a new snapshot.

@darkred once this snapshot is available, could I ask you to test?

@darkred
Copy link
Author

darkred commented Jul 15, 2021

@dscho Yes, of course, I'd gladly help!

So, I just ran the new snapshot from here, both as an update and as clean install(after uninstalling),
and in both cases I had checked the: (NEW) Add a Git Bash Profile to Windows Terminal during installation
(I mean the last checkbox in:
2021-07-15_162421
and it completed successfully(=without errors) in both cases.

@dscho
Copy link
Member

dscho commented Jul 15, 2021

Yay! Thanks for verifying the fix.

@Ronald-G-Andrade
Copy link

Hello dear people. I encounter this error in the latest v2.33.0-rc1

Runtime Error (at 325:19181)
Could not call proc.

Thanks a lot :) !!

@dscho
Copy link
Member

dscho commented Aug 8, 2021

Runtime Error (at 325:19181)
Could not call proc.

That error message, as you most likely guessed, does not help. A full bug report, with as much information as you can provide, would most likely help more.

@dscho
Copy link
Member

dscho commented Aug 8, 2021

(For the record, I cannot reproduce the reported issue.)

@Ronald-G-Andrade
Copy link

Runtime Error (at 325:19181)
Could not call proc.

That error message, as you most likely guessed, does not help. A full bug report, with as much information as you can provide, would most likely help more.

Hello dear friend, sorry I don't know (yet) how to dump a full bug report :(

I've just installed the new version 2.33.0 RC2, previously (on version 2.33.0 RC0) I checked the option to install the Git Bash of the Windows Terminal (Release version - Not Preview version). Everything did well.

But since the installation of 2.33.0 RC1 I'm facing this issue. I still have the Git Bash on Windows Terminal

imagen

@dscho
Copy link
Member

dscho commented Aug 13, 2021

Looking at the code, from the shown status message "Writing Windows Terminal Profile" I deduce that this error must happen some time during the InstallWindowsTerminalFragment() function.

But I can't see where it would cause a "Could not call proc", as we're not calling any native function directly.

I also don't see this error in my setup, therefore I assume that there is something very special about your setup. Searching around for "could not call proc", I could imagine that you try to run this via Wine or Crossover?

@Ronald-G-Andrade
Copy link

Ronald-G-Andrade commented Aug 13, 2021

Looking at the code, from the shown status message "Writing Windows Terminal Profile" I deduce that this error must happen some time during the InstallWindowsTerminalFragment() function.

But I can't see where it would cause a "Could not call proc", as we're not calling any native function directly.

I also don't see this error in my setup, therefore I assume that there is something very special about your setup. Searching around for "could not call proc", I could imagine that you try to run this via Wine or Crossover?

Hello dear friend, first, thank you very much for your reply 😃

No dear @dscho, I'm using:
Windows 10 21H2 (19044.1165). I have the Host File with Only-Read mode (the file cannot be written unless I approve it).
I really don't know why Git Bash wants to write the Host File 😞

The part of my Windows Terminal settings where Git Bash is configured is:

"guid": "{2ece5bfe-50ed-5f3a-ab87-5cd4baafed2b}",
"hidden": false,
"name": "Git Bash",
"source": "Git"

When I open Windows Terminal and the Git Bash Console, I'm facing this issue:
Captura de pantalla 2021-08-13 185016

@dscho
Copy link
Member

dscho commented Aug 14, 2021

I guess it doesn't like only-read mode.

@dscho
Copy link
Member

dscho commented Aug 14, 2021

I have the Host File with Only-Read mode

@Ronald-G-Andrade For my curiosity: how do you turn this mode on or off?

@Ronald-G-Andrade
Copy link

I guess it doesn't like only-read mode.

🤔😕

I have the Host File with Only-Read mode

@Ronald-G-Andrade For my curiosity: how do you turn this mode on or off?

Captura de pantalla 2021-08-14 135203

@dscho
Copy link
Member

dscho commented Aug 14, 2021

Now I understand better what you meant by "Host File", but I am more puzzled why this should have anything to do with writing the Windows Terminal Profile... Strange.

@Ronald-G-Andrade
Copy link

Dear mate @dscho the bug is still present 😞
I installed the latest version 2.33.0 and the error dialog still appear.

@jeremyd2019
Copy link

Hello dear people. I encounter this error in the latest v2.33.0-rc1

Runtime Error (at 325:19181)
Could not call proc.

Thanks a lot :) !!

I just got this error message upgrading from 2.32.0.2 to 2.33.0 installing the 32-bit version on a Raspberry Pi 4 running Windows 10 21H1 ARM64. I don't know if it matters, but I had Windows Terminal open at the time. After the install, the Git Bash profile was still present in Windows Terminal, even after restarting it.

@dscho
Copy link
Member

dscho commented Aug 19, 2021

For the record, I cannot reproduce with the 64-bit version, even after setting the C:\Windows\system32\drivers\etc\hosts file to read-only, as this report suggested. The installation passes without problems.

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

Successfully merging a pull request may close this issue.

6 participants