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

Windows agents failing to clone Git (LongPathsEnabled disabled) #4574

Open
jglick opened this issue Mar 4, 2025 · 49 comments
Open

Windows agents failing to clone Git (LongPathsEnabled disabled) #4574

jglick opened this issue Mar 4, 2025 · 49 comments

Comments

@jglick
Copy link

jglick commented Mar 4, 2025

Service(s)

ci.jenkins.io

Summary

https://github.com/jenkinsci/pipeline-model-definition-plugin/runs/38184754576 (blocking deployment of jenkinsci/pipeline-model-definition-plugin#770)

 > git.exe init C:\Jenkins\agent\workspace\e-model-definition-plugin_master\pipeline-model-definition\target\tmp\j h13373974888129494271\workspace\test0@script\5878204d05f31ba38b85152718c2798e20a41786a9ccbc2012fefa3fbdfb649c # timeout=10
…
error: unable to write file .git/objects/62/0ab9904dc383c8c2bf662dfc3392d15588be5e: Invalid argument

The filename here is 263 characters long, which may exceed path length limitations.

Please

  • Ensure that the agent remotefs path is as short as it can be.
  • git config core.longpaths true

Context: jenkinsci/branch-api-plugin#129 (comment)

Reproduction steps

No response

@jglick jglick added the triage Incoming issues that need review label Mar 4, 2025
@MarkEWaite
Copy link

Please

  • Ensure that the agent remotefs path is as short as it can be.

We may need to perform several reductions in order to reduce that path.

Infra might be able to shorten "C:\Jenkins\agent" to "C:\J\A", but that is probably not enough to fit inside the 256 character limit.

I think that we may need to change the temporary directory name to use fewer characters, instead of "j h13373974888129494271", maybe "j h1337". I believe that is a test configuration change, not something that the Jenkins infrastructure team can change.

If the temporary directory name of the scripts directory could be changed from 5878204d05f31ba38b85152718c2798e20a41786a9ccbc2012fefa3fbdfb649c to a much shorter version, that would also help.

Are those changes that you can explore @jglick or that you can point me to a general area in the build system where I could explore?

  • git config core.longpaths true

Unfortunately, git config core.longpaths true is already being used and has been shown to be insufficient. That was also my experience while working on the git client plugin trying to allow longer paths on Windows. All attempts ultimately failed and we were stuck with goal to keep paths for git commands to be less than 256 characters on Windows.

@jglick
Copy link
Author

jglick commented Mar 4, 2025

FWIW I can reproduce a more descriptive failure in my own Windows 10 VM using

mvn -pl pipeline-model-definition surefire:test -Dtest=AgentTest#agentNone
error: unable to open loose object a4aab9250fcf4bb8aa15745c5c8f2c670e8ed471: Filename too long

After

git config --list --show-origin --show-scope

the test passes.

@jglick
Copy link
Author

jglick commented Mar 4, 2025

The temporary directory name inside scripts is the length it is due to a security fix jenkinsci/workflow-cps-plugin@f7ae7b7 so I do not think that can be reduced.

@jglick
Copy link
Author

jglick commented Mar 4, 2025

Using e.g. C:\a would trim 12 characters, which may suffice given that the test failure above shows the file path being only 3 characters over the limit.

@jglick
Copy link
Author

jglick commented Mar 4, 2025

The temporary directory name is being created by Java: https://github.com/jenkinsci/jenkins-test-harness/blob/1e79b0dc94b7b05e695838d3209d8ffd88504e8b/src/main/java/org/jvnet/hudson/test/TemporaryDirectoryAllocator.java#L90 We could try to make it shorter (at the loss of atomicity and with the risk of occasional path conflicts).

I could shave off three or four characters by using a shorter project name in the test, perhaps.

You could set e.g. -Djenkins.branch.WorkspaceLocatorImpl.MAX_LENGTH=10

@jglick
Copy link
Author

jglick commented Mar 4, 2025

Note that PR builds pass; it is master that fails, perhaps because master has one more character than PR-771?!

@jglick
Copy link
Author

jglick commented Mar 4, 2025

git config core.longpaths true is already being used

In these agents? After the switch to AWS?

@jglick
Copy link
Author

jglick commented Mar 4, 2025

the 256 character limit

Actually 260, IIUC. (because Windows)

@jtnord
Copy link

jtnord commented Mar 4, 2025

git config core.longpaths true is already being used

has the setting been enabled on windows though?
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled = 1

(I beleive it is still needed in the registry on server versions)

@MarkEWaite
Copy link

MarkEWaite commented Mar 4, 2025

git config core.longpaths true is already being used

In these agents? After the switch to AWS?

On that job in the console log it shows:

administrator@EC2AMAZ-71HDD0G C:\Jenkins\agent\workspace\e-model-definition-plugin_PR-770>git config --global core.autocrlf true 
administrator@EC2AMAZ-71HDD0G C:\Jenkins\agent\workspace\e-model-definition-plugin_PR-770>git config --global core.longpaths true 

@jtnord
Copy link

jtnord commented Mar 4, 2025

BTW there is a bug in git clone on windows where the clone fails as something is broken (using an ascii based API?) but a fetch and a checkout (or a clone, followed by a checkout and reset) do work and do create the files.
(not reported upstream as I was on a version of git that is a 2 releases behind, but nothing was visible in the release notes or tracker, and I was busy getting other things done to report it)

@MarkEWaite
Copy link

MarkEWaite commented Mar 4, 2025

BTW there is a bug in git clone on windows where the clone fails as something is broken (using an ascii based API?) but a fetch and a checkout (or a clone, followed by a checkout and reset) do work and do create the files.

The git client plugin uses fetch and checkout. I'm actually a little ashamed of that, but it is the best way to retain compatibility for existing users. There are some cases where fetch and checkout can do things that clone cannot, at least on some git versions

@jtnord
Copy link

jtnord commented Mar 4, 2025

git config core.longpaths true is already being used

has the setting been enabled on windows though? HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled = 1

(I beleive it is still needed in the registry on server versions)

reg.exe query HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled will tell you quickly if it is set.

@MarkEWaite
Copy link

reg.exe query HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
    LongPathsEnabled    REG_DWORD    0x0

@jtnord
Copy link

jtnord commented Mar 4, 2025

the kernel has not enabled long paths, so it doesn't matter what the git config is :)
(needs a reboot to take effect so you will likely need to rebuild the images)

@jtnord
Copy link

jtnord commented Mar 4, 2025

FWIW I can reproduce a more descriptive failure in my own Windows 10 VM using

mvn -pl pipeline-model-definition surefire:test -Dtest=AgentTest#agentNone

FWIW works for me. my checkout is in D:\source\github\jenkinsci\pipeline-model-definition-plugin
(both kernel and git.config are set to enable long paths)

@lemeurherveCB
Copy link

lemeurherveCB commented Mar 5, 2025

I've tested new images from jenkinsci/docker-agent#949 with LongPathsEnabled on a Windows machine, but even with HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled = 1 and git config --global core.longpaths true I get errors when cloning any repository from inside a folder with a long path:

PS C:\Users\jenkins> reg.exe query HKLM\SYSTEM\CurrentControlSet\Control\FileSystem

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
    DisableDeleteNotification    REG_DWORD    0x0
    FilterSupportedFeaturesMode    REG_DWORD    0x0
    LongPathsEnabled    REG_DWORD    0x1
    NtfsAllowExtendedCharacter8dot3Rename    REG_DWORD    0x0
    NtfsBugcheckOnCorrupt    REG_DWORD    0x0
    NtfsDisable8dot3NameCreation    REG_DWORD    0x2
    NtfsDisableCompression    REG_DWORD    0x0
    NtfsDisableEncryption    REG_DWORD    0x0
    NtfsDisableLastAccessUpdate    REG_DWORD    0x1
    NtfsDisableLfsDowngrade    REG_DWORD    0x0
    NtfsDisableVolsnapHints    REG_DWORD    0x0
    NtfsEncryptPagingFile    REG_DWORD    0x0
    NtfsMemoryUsage    REG_DWORD    0x0
    NtfsMftZoneReservation    REG_DWORD    0x0
    NtfsQuotaNotifyRate    REG_DWORD    0xe10
    SymlinkLocalToLocalEvaluation    REG_DWORD    0x1
    SymlinkLocalToRemoteEvaluation    REG_DWORD    0x1
    SymlinkRemoteToLocalEvaluation    REG_DWORD    0x0
    SymlinkRemoteToRemoteEvaluation    REG_DWORD    0x0
    UdfsCloseSessionOnEject    REG_DWORD    0x1
    UdfsSoftwareDefectManagement    REG_DWORD    0x0
    Win31FileSystem    REG_DWORD    0x0
    Win95TruncatedExtensions    REG_DWORD    0x1

PS C:\Users\jenkins> cat .\.gitconfig
[core]
        longpaths = true

PS C:\Users\jenkins> $longPath = 'C:\' + ('a' * 200) ; mkdir $longPath ; cd $longPath

    Directory: C:\

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----            3/5/2025 10:14 AM                aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

C:\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa> git clone https://github.com/jenkins-infra/helpdesk
Cloning into 'helpdesk'...
remote: Enumerating objects: 677, done.
remote: Counting objects: 100% (389/389), done.
remote: Compressing objects: 100% (257/257), done.
remote: Total 677 (delta 242), reused 198 (delta 131), pack-reused 288 (from 1)
Receiving objects: 100% (677/677), 148.46 KiB | 3.09 MiB/s, done.
Resolving deltas: 100% (283/283), done.
error: unable to write file C:/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/helpdesk/.git/objects/pack/pack-abf4bcaf373f8c9b99ded37cce80458b37ee334c.pack: No such file or directory
fatal: unable to rename temporary '*.pack' file to 'C:/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/helpdesk/.git/objects/pack/pack-abf4bcaf373f8c9b99ded37cce80458b37ee334c.pack'
fatal: fetch-pack: invalid index-pack output

PS C:\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa> git clone https://github.com/jenkinsci/pipeline-model-definition-plugin
Cloning into 'pipeline-model-definition-plugin'...
fatal: '$GIT_DIR' too big
fatal: remote helper 'https' aborted session

FWIW I can reproduce a more descriptive failure in my own Windows 10 VM using
mvn -pl pipeline-model-definition surefire:test -Dtest=AgentTest#agentNone

FWIW works for me. my checkout is in D:\source\github\jenkinsci\pipeline-model-definition-plugin (both kernel and git.config are set to enable long paths)

@jtnord does it work if you try it in a longer folder?

@jtnord
Copy link

jtnord commented Mar 5, 2025

@jtnord does it work if you try it in a longer folder?

check #4574 (comment) try with use init/fetch and checkout not clone. (and if that works you have a reproducable test case to file for git-for-windows!)

@lemeurherveCB
Copy link

lemeurherveCB commented Mar 5, 2025

Thanks, I forgot about that comment, retrying.

(and if that works you have a reproducable test case to file for git-for-windows!)

Yes, that's exactly what I wanted for jenkinsci/docker-agent#949, I'll look into their repo to propose something.

@jtnord
Copy link

jtnord commented Mar 5, 2025

  D:\s\t\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa  ☸ docker-desktop default  echo %Cd%
D:\source\temp\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

  D:\s\t\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa  ☸ docker-desktop default  git init helpdesk^C
  D:\s\t\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa  ☸ docker-desktop default  mkdir helpdesk^C
❯ git clone https://github.com/jenkins-infra/helpdesk
Cloning into 'helpdesk'...
fatal: '$GIT_DIR' too big

❯ dir
 Volume in drive D is dev
 Volume Serial Number is EEA4-4AF8

 Directory of D:\source\temp\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

05/03/2025  09:53    <DIR>          .
05/03/2025  09:53    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  189,440,303,104 bytes free

❯ mkdir heldesk

❯ cd heldesk\

  D:\s\t\a\heldesk  ☸ docker-desktop default  git init .                                                                                                                                   09:54:19 
Initialized empty Git repository in D:/source/temp/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/heldesk/.git/

❯ git remote add origin https://github.com/jenkins-infra/helpdesk

❯ git fetch origin
remote: Enumerating objects: 677, done.
remote: Counting objects: 100% (389/389), done.
remote: Compressing objects: 100% (257/257), done.
remote: Total 677 (delta 242), reused 198 (delta 131), pack-reused 288 (from 1)
Receiving objects: 100% (677/677), 148.46 KiB | 7.81 MiB/s, done.
Resolving deltas: 100% (283/283), done.
From https://github.com/jenkins-infra/helpdesk
 * [new branch]      main       -> origin/main
 * [new tag]         infra-team-sync-2022-07-08_1 -> infra-team-sync-2022-07-08_1
 * [new tag]         infra-team-sync-2022-07-12_2 -> infra-team-sync-2022-07-12_2
 * [new tag]         infra-team-sync-2022-07-19_4 -> infra-team-sync-2022-07-19_4
 * [new tag]         infra-team-sync-2022-07-26_8 -> infra-team-sync-2022-07-26_8
 * [new tag]         infra-team-sync-2022-08-02_9 -> infra-team-sync-2022-08-02_9
 * [new tag]         infra-team-sync-2022-08-09_10 -> infra-team-sync-2022-08-09_10
 * [new tag]         infra-team-sync-2022-08-16_11 -> infra-team-sync-2022-08-16_11
 * [new tag]         infra-team-sync-2022-08-23_12 -> infra-team-sync-2022-08-23_12
 * [new tag]         infra-team-sync-2022-08-30_13 -> infra-team-sync-2022-08-30_13
 * [new tag]         infra-team-sync-2022-09-06_19 -> infra-team-sync-2022-09-06_19
 * [new tag]         infra-team-sync-2022-09-13_20 -> infra-team-sync-2022-09-13_20
 * [new tag]         infra-team-sync-2022-09-20_21 -> infra-team-sync-2022-09-20_21
 * [new tag]         infra-team-sync-2022-10-04_22 -> infra-team-sync-2022-10-04_22
 * [new tag]         infra-team-sync-2022-10-11_24 -> infra-team-sync-2022-10-11_24
 * [new tag]         infra-team-sync-2022-10-18_26 -> infra-team-sync-2022-10-18_26
 * [new tag]         infra-team-sync-2022-10-25_27 -> infra-team-sync-2022-10-25_27
 * [new tag]         infra-team-sync-2022-11-08_28 -> infra-team-sync-2022-11-08_28
 * [new tag]         infra-team-sync-2022-11-15_29 -> infra-team-sync-2022-11-15_29
 * [new tag]         infra-team-sync-2022-11-22_30 -> infra-team-sync-2022-11-22_30
 * [new tag]         infra-team-sync-2022-11-29_31 -> infra-team-sync-2022-11-29_31
 * [new tag]         infra-team-sync-2022-12-06_33 -> infra-team-sync-2022-12-06_33

❯ git checkout master
error: pathspec 'master' did not match any file(s) known to git

❯ git checkout origin/master
error: pathspec 'origin/master' did not match any file(s) known to git

  D:\s\t\a\heldesk  ☸ docker-desktop default    master  ^C                                                                                                                         1  09:54:51 
❯ git checkout origin/main
Note: switching to 'origin/main'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 88bd27b Merge pull request #4305 from jenkins-infra/dependabot/github_actions/tibdex/github-app-token-2.1.0

git version 2.46.0.windows.1

@jtnord
Copy link

jtnord commented Mar 5, 2025

git-for-windows/git#5464

@lemeurherveCB
Copy link

git init still failing unfortunately:

https://ci.jenkins.io/job/Packaging/job/docker-agent/job/PR-949/7/pipeline-console/log?nodeId=168
(with $longPath = 'C:\' + ('a' * 250))

[2025-03-05T10:51:24.165Z] [cmd] docker exec pester-jenkins-agent_jdk17-windowsservercore-ltsc2019_2134388960 powershell.exe -C "New-Item -ItemType Directory -Path C:\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ; cd C:\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ; git init ; git remote add origin https://github.com/jenkinsci/pipeline-model-definition-plugin.git ; git fetch origin ; git checkout master"
[2025-03-05T10:51:24.165Z] [stdout] 
[2025-03-05T10:51:24.165Z] 
[2025-03-05T10:51:24.165Z]     Directory: C:\
[2025-03-05T10:51:24.165Z] 
[2025-03-05T10:51:24.165Z] 
[2025-03-05T10:51:24.165Z] Mode                LastWriteTime         Length Name                          
[2025-03-05T10:51:24.165Z] ----                -------------         ------ ----                          
[2025-03-05T10:51:24.165Z] d-----         3/5/2025  10:51 AM                aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[2025-03-05T10:51:24.165Z]                                                  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[2025-03-05T10:51:24.165Z]                                                  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[2025-03-05T10:51:24.165Z]                                                  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[2025-03-05T10:51:24.165Z]                                                  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[2025-03-05T10:51:24.165Z]                                                  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[2025-03-05T10:51:24.165Z]                                                  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[2025-03-05T10:51:24.165Z]                                                  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[2025-03-05T10:51:24.165Z]                                                  aaaaaaaaaa                    
[2025-03-05T10:51:24.165Z] 
[2025-03-05T10:51:24.165Z] 
[2025-03-05T10:51:24.165Z] 
[2025-03-05T10:51:24.165Z] [stderr] warning: unable to access 'C:/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/.git/config': Filename too long
[2025-03-05T10:51:24.165Z] error: could not write config file C:/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/.git/config: No such file or directory
[2025-03-05T10:51:24.165Z] fatal: could not set 'core.repositoryformatversion' to '0'
[2025-03-05T10:51:24.165Z] fatal: not a git repository (or any of the parent directories): .git
[2025-03-05T10:51:24.166Z] fatal: not a git repository (or any of the parent directories): .git
[2025-03-05T10:51:24.166Z] fatal: not a git repository (or any of the parent directories): .git

@lemeurherveCB
Copy link

Failing with a short repo folder inside the long named one too, retried with hardcoded path like yours cf jenkinsci/docker-agent@f192d43

Some progress, git init passes but still fails:

https://ci.jenkins.io/job/Packaging/job/docker-agent/job/PR-949/10/pipeline-console/log?nodeId=166

[2025-03-05T11:46:14.891Z] [cmd] docker exec pester-jenkins-agent_jdk17-windowsservercore-1809_2126308980 powershell.exe -C "git version ; reg.exe query HKLM\SYSTEM\CurrentControlSet\Control\FileSystem ; cat .\.gitconfig ; New-Item -ItemType Directory -Path C:\source\temp\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\heldesk ; cd C:\source\temp\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\heldesk ; git init ; git remote add origin https://github.com/jenkinsci/pipeline-model-definition-plugin.git ; git fetch origin ; git checkout master"
[2025-03-05T11:46:14.891Z] [stdout] git version 2.48.1.windows.1
[2025-03-05T11:46:14.891Z] 
[2025-03-05T11:46:14.891Z] HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
[2025-03-05T11:46:14.891Z]     DisableDeleteNotification    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     FilterSupportedFeaturesMode    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     LongPathsEnabled    REG_DWORD    0x1
[2025-03-05T11:46:14.891Z]     NtfsAllowExtendedCharacter8dot3Rename    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     NtfsBugcheckOnCorrupt    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     NtfsDisable8dot3NameCreation    REG_DWORD    0x2
[2025-03-05T11:46:14.891Z]     NtfsDisableCompression    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     NtfsDisableEncryption    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     NtfsDisableLastAccessUpdate    REG_DWORD    0x80000003
[2025-03-05T11:46:14.891Z]     NtfsDisableLfsDowngrade    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     NtfsDisableVolsnapHints    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     NtfsEncryptPagingFile    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     NtfsMemoryUsage    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     NtfsMftZoneReservation    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     NtfsQuotaNotifyRate    REG_DWORD    0xe10
[2025-03-05T11:46:14.891Z]     RefsDisableLastAccessUpdate    REG_DWORD    0x1
[2025-03-05T11:46:14.891Z]     ScrubMode    REG_DWORD    0x1
[2025-03-05T11:46:14.891Z]     SymlinkLocalToLocalEvaluation    REG_DWORD    0x1
[2025-03-05T11:46:14.891Z]     SymlinkLocalToRemoteEvaluation    REG_DWORD    0x1
[2025-03-05T11:46:14.891Z]     SymlinkRemoteToLocalEvaluation    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     SymlinkRemoteToRemoteEvaluation    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     UdfsCloseSessionOnEject    REG_DWORD    0x3
[2025-03-05T11:46:14.891Z]     UdfsSoftwareDefectManagement    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     Win31FileSystem    REG_DWORD    0x0
[2025-03-05T11:46:14.891Z]     Win95TruncatedExtensions    REG_DWORD    0x1
[2025-03-05T11:46:14.891Z] 
[2025-03-05T11:46:14.891Z] [core]
[2025-03-05T11:46:14.891Z] 	longpaths = true
[2025-03-05T11:46:14.891Z] 
[2025-03-05T11:46:14.891Z] 
[2025-03-05T11:46:14.892Z]     Directory: C:\source\temp\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[2025-03-05T11:46:14.892Z]     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[2025-03-05T11:46:14.892Z]     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[2025-03-05T11:46:14.892Z]     a
[2025-03-05T11:46:14.892Z] 
[2025-03-05T11:46:14.892Z] 
[2025-03-05T11:46:14.892Z] Mode                LastWriteTime         Length Name                          
[2025-03-05T11:46:14.892Z] ----                -------------         ------ ----                          
[2025-03-05T11:46:14.892Z] d-----         3/5/2025  11:46 AM                heldesk                       
[2025-03-05T11:46:14.892Z] Initialized empty Git repository in C:/source/temp/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/heldesk/.git/
[2025-03-05T11:46:14.892Z] 
[2025-03-05T11:46:14.892Z] 
[2025-03-05T11:46:14.892Z] 
[2025-03-05T11:46:14.892Z] [stderr] hint: Using 'master' as the name for the initial branch. This default branch name
[2025-03-05T11:46:14.892Z] hint: is subject to change. To configure the initial branch name to use in all
[2025-03-05T11:46:14.892Z] hint: of your new repositories, which will suppress this warning, call:
[2025-03-05T11:46:14.892Z] hint:
[2025-03-05T11:46:14.892Z] hint: 	git config --global init.defaultBranch <name>
[2025-03-05T11:46:14.892Z] hint:
[2025-03-05T11:46:14.892Z] hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
[2025-03-05T11:46:14.892Z] hint: 'development'. The just-created branch can be renamed via this command:
[2025-03-05T11:46:14.892Z] hint:
[2025-03-05T11:46:14.892Z] hint: 	git branch -m <name>
[2025-03-05T11:46:14.892Z] error: unable to write file .git/objects/pack/pack-39f746c759b9d248c2b5d0c73d66caa13b3fa25b.pack: No such file or directory
[2025-03-05T11:46:14.892Z] fatal: unable to rename temporary '*.pack' file to '.git/objects/pack/pack-39f746c759b9d248c2b5d0c73d66caa13b3fa25b.pack'
[2025-03-05T11:46:14.892Z] fatal: fetch-pack: invalid index-pack output
[2025-03-05T11:46:14.892Z] error: pathspec 'master' did not match any file(s) known to git

@dduportal
Copy link
Contributor

dduportal commented Mar 5, 2025

@dduportal
Copy link
Contributor

New setting delivered: let's see how it behaves in

* https://ci.jenkins.io/job/Packaging/job/docker-agent/job/PR-949/

* https://ci.jenkins.io/job/Plugins/job/pipeline-model-definition-plugin/job/master/644/

* https://github.com/jenkinsci/docker-ssh-agent

The problem looks gone on the ci.jenkins.io agents.

I'm closing the issue and defering to @lemeurherveCB for the jenkinsci agents (which issues are managed outside the jenkins-infra helpdesk).

Thanks y'all for the help!

@jglick
Copy link
Author

jglick commented Mar 5, 2025

Does not seem fixed to me: jenkinsci/pipeline-model-definition-plugin#774 (comment)

@dduportal dduportal reopened this Mar 5, 2025
@dduportal
Copy link
Contributor

Damn, I misunderstood the issue. I thought the initial agent cloning steps where the problem. The change we applied did fix the initial cloning, but it looks like it was jgit, while the issue here is git.exe.

@dduportal
Copy link
Contributor

I don't understand what the error is. When replaying the pipeline, I got the expected git and kernel setups:

20:11:03  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
20:11:03      LongPathsEnabled    REG_DWORD    0x1
20:11:03  
20:11:03  
20:11:03  administrator@EC2AMAZ-AHVJ76A C:\Jenkins\agent\workspace\inition-plugin_revert-773-no-win>git config get --global core.longpaths 
20:11:03  true

@jonesbusy
Copy link

Seen also jenkinsci/pipeline-as-yaml-plugin#131 (comment)

Linux work fine.

No changes on code, simple parent bump

remote: Compressing objects: 100% (4/4), done.        
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)        
error: unable to write file .git/objects/88/5d62fd3383b2b55160833372cd33968adc3a97: Invalid argument
fatal: failed to write object
fatal: unpack-objects failed

 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2852)

@jonesbusy
Copy link

Note: Was facing similar issues on Windows 10 nodes few years ago. I found the config (in my case was ansible) that was fixing all such git clone on windows

- name: Git set longpaths
  ansible.windows.win_shell: git config --system core.longpaths true
  changed_when: false
  tags: git

- name: Windows set longpaths
  ansible.windows.win_regedit:
    path: HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem
    name: LongPathsEnabled
    type: dword
    data: 1
  tags: git

@smerle33
Copy link
Contributor

smerle33 commented Mar 6, 2025

@lemeurherveCB
Copy link

lemeurherveCB commented Mar 6, 2025

You're not missing anything, the error persists even with these settings set on the host and in the image.

may or may not be the users home.. and may or may not be seen by git... git config -l --global instead?

The thing is, git config --global --list fails as it's missing less 😅 (That's why I'm using cat in my test)

@dduportal
Copy link
Contributor

dduportal commented Mar 6, 2025

and in the image.

What image are you referring to @lemeurherveCB ? The mentioned build (https://ci.jenkins.io/job/Plugins/job/pipeline-model-definition-plugin/job/master/641/) utilizes a Windows VM agents (label maven-17-windows) built by the packer-image system.

may or may not be the users home.. and may or may not be seen by git... git config -l --global instead?

The thing is, git config --global --list fails as it's missing less 😅 (That's why I'm using cat in my test)

🤔 why would we need less or cat on Windows? git.exe is working as expected (at least on a Win 2019 VM agent in which I'm SSH-ing).

I feel like the commands at https://github.com/jenkins-infra/pipeline-library/blob/e01cbb988257ae3f308c82476a4792db4960365d/vars/infra.groovy#L144-L149 should be set with the get subcommand (to avoid implicit behavior) and with the --system flag as pointed by @jonesbusy, to ensure that whatever the Maven tests are doing, they inherit from the initial agent context.

@lemeurherveCB
Copy link

lemeurherveCB commented Mar 6, 2025

I'm referring to the docker-agent image where I'm trying to reproduce a test and a fix. It's in this image that I can't call --list with git.exe as it tries to call less, and where I'm using cat instead (which is available).

I'm aware this won't resolve this infra issue, but I figured it could help finding what's wrong, that may not be the case.

@dduportal
Copy link
Contributor

I'm referring to the docker-agent image where I'm trying to reproduce a test and a fix. It's in this image that I can't call --list with git.exe as it tries to call less, and where I'm using cat instead (which is available).

I'm aware this won't resolve this infra issue, but I figured it could help finding what's wrong, that may not be the case.

Thanks for the explanation, as it wasn't clear for us before. It make sense to have a differential analysis like this one!

=> btw, if we downgrade git-windows to 2.47.x, is the problem present again?

@dduportal
Copy link
Contributor

dduportal commented Mar 6, 2025

=> btw, if we downgrade git-windows to 2.47.x, is the problem present again?

I might have missed a few messages, but https://github.com/git-for-windows/build-extra/blob/main/ReleaseNotes.md#git-for-windows-v2481-release-notes states

Many Windows programs (including the Windows Explorer) have problems with directory trees nested so deeply that the absolute path is longer than 260 characters. Therefore, Git for Windows refuses to check out such files by default. You can overrule this default by setting core.longPaths, e.g. git clone -c core.longPaths=true ....

=> so we now know what is the problem: Git 2.48.x upgrade (which is the common denominator between the Windows Server Core 2019 VMs of ci.jio and the Nanoserver Docker images mentioned by @lemeurherveCB).

I guess, it is worth checking the result with git config set --system core.longPaths=true on both pipeline library and packer-images (it should already be done in the Windows provisioning, as per https://github.com/jenkins-infra/packer-images/blob/c8607b885d068e28112be8d8b820a93612a17294/provisioning/windows-provision.ps1#L149, weird: feels like a scope issue).
=> is the case important in the setting? Could be a stupid but key mistake?

=> on short term, I believe we may think to revert git to 2.47.x until we find a viable solution. WDYT @smerle33 @MarkEWaite ?

@lemeurherveCB
Copy link

Testing 2.47.1 with jenkinsci/docker-agent@c3ed713

@lemeurherveCB
Copy link

lemeurherveCB commented Mar 6, 2025

I guess, it is worth checking the result with git config set --system core.longPaths=true on both pipeline library and packer-images (it should already be done in the Windows provisioning, as per https://github.com/jenkins-infra/packer-images/blob/c8607b885d068e28112be8d8b820a93612a17294/provisioning/windows-provision.ps1#L149, weird: feels like a scope issue). => is the case important in the setting? Could be a stupid but key mistake?

I may be wrong but it seems that core.longPaths isn't set on the agent used to build docker-agent images:
https://ci.jenkins.io/job/Packaging/job/docker-agent/job/PR-949/19/pipeline-console/log?nodeId=149

[2025-03-06T10:05:29.257Z] filter.lfs.clean=git-lfs clean -- %f
[2025-03-06T10:05:29.258Z] filter.lfs.smudge=git-lfs smudge -- %f
[2025-03-06T10:05:29.258Z] filter.lfs.process=git-lfs filter-process
[2025-03-06T10:05:29.258Z] filter.lfs.required=true
[2025-03-06T10:05:29.259Z] 
[2025-03-06T10:05:29.259Z] HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
[2025-03-06T10:05:29.260Z]     DisableDeleteNotification    REG_DWORD    0x0
[2025-03-06T10:05:29.260Z]     FilterSupportedFeaturesMode    REG_DWORD    0x0
[2025-03-06T10:05:29.260Z]     LongPathsEnabled    REG_DWORD    0x1
[2025-03-06T10:05:29.261Z]     NtfsAllowExtendedCharacter8dot3Rename    REG_DWORD    0x0
[2025-03-06T10:05:29.261Z]     NtfsBugcheckOnCorrupt    REG_DWORD    0x0
[2025-03-06T10:05:29.262Z]     NtfsDisable8dot3NameCreation    REG_DWORD    0x2
[2025-03-06T10:05:29.262Z]     NtfsDisableCompression    REG_DWORD    0x0
[2025-03-06T10:05:29.262Z]     NtfsDisableEncryption    REG_DWORD    0x0
[2025-03-06T10:05:29.263Z]     NtfsDisableLastAccessUpdate    REG_DWORD    0x80000003
[2025-03-06T10:05:29.263Z]     NtfsDisableLfsDowngrade    REG_DWORD    0x0
[2025-03-06T10:05:29.263Z]     NtfsDisableVolsnapHints    REG_DWORD    0x0
[2025-03-06T10:05:29.264Z]     NtfsEncryptPagingFile    REG_DWORD    0x0
[2025-03-06T10:05:29.264Z]     NtfsMemoryUsage    REG_DWORD    0x0
[2025-03-06T10:05:29.264Z]     NtfsMftZoneReservation    REG_DWORD    0x0
[2025-03-06T10:05:29.265Z]     NtfsQuotaNotifyRate    REG_DWORD    0xe10
[2025-03-06T10:05:29.265Z]     RefsDisableLastAccessUpdate    REG_DWORD    0x1
[2025-03-06T10:05:29.265Z]     ScrubMode    REG_DWORD    0x1
[2025-03-06T10:05:29.266Z]     SymlinkLocalToLocalEvaluation    REG_DWORD    0x1
[2025-03-06T10:05:29.266Z]     SymlinkLocalToRemoteEvaluation    REG_DWORD    0x1
[2025-03-06T10:05:29.266Z]     SymlinkRemoteToLocalEvaluation    REG_DWORD    0x0
[2025-03-06T10:05:29.267Z]     SymlinkRemoteToRemoteEvaluation    REG_DWORD    0x0
[2025-03-06T10:05:29.267Z]     UdfsCloseSessionOnEject    REG_DWORD    0x3
[2025-03-06T10:05:29.267Z]     UdfsSoftwareDefectManagement    REG_DWORD    0x0
[2025-03-06T10:05:29.267Z]     Win31FileSystem    REG_DWORD    0x0
[2025-03-06T10:05:29.267Z]     Win95TruncatedExtensions    REG_DWORD    0x1

Checked with https://github.com/jenkinsci/docker-agent/blob/84ad70558949b7e718dfd6d127d32037686e021c/build.ps1#L51-L53 in build.ps1:

# Sanity checks
Invoke-Expression 'git config --global --list'
Invoke-Expression 'reg.exe query HKLM\SYSTEM\CurrentControlSet\Control\FileSystem'

@smerle33
Copy link
Contributor

smerle33 commented Mar 6, 2025

PR ready, will be merged if previous version of git for windows is working correctly as confirmed by @lemeurherveCB
jenkins-infra/packer-images#1787

@smerle33
Copy link
Contributor

smerle33 commented Mar 6, 2025

I guess, it is worth checking the result with git config set --system core.longPaths=true on both pipeline library and packer-images (it should already be done in the Windows provisioning, as per jenkins-infra/packer-images@c8607b8/provisioning/windows-provision.ps1#L149, weird: feels like a scope issue). => is the case important in the setting? Could be a stupid but key mistake?

I may be wrong but it seems that core.longPaths isn't set on the agent used to build docker-agent images: ci.jenkins.io/job/Packaging/job/docker-agent/job/PR-949/19/pipeline-console/log?nodeId=149

[2025-03-06T10:05:29.257Z] filter.lfs.clean=git-lfs clean -- %f
[2025-03-06T10:05:29.258Z] filter.lfs.smudge=git-lfs smudge -- %f
[2025-03-06T10:05:29.258Z] filter.lfs.process=git-lfs filter-process
[2025-03-06T10:05:29.258Z] filter.lfs.required=true
[2025-03-06T10:05:29.259Z] 
[2025-03-06T10:05:29.259Z] HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
[2025-03-06T10:05:29.260Z]     DisableDeleteNotification    REG_DWORD    0x0
[2025-03-06T10:05:29.260Z]     FilterSupportedFeaturesMode    REG_DWORD    0x0
[2025-03-06T10:05:29.260Z]     LongPathsEnabled    REG_DWORD    0x1
[2025-03-06T10:05:29.261Z]     NtfsAllowExtendedCharacter8dot3Rename    REG_DWORD    0x0
[2025-03-06T10:05:29.261Z]     NtfsBugcheckOnCorrupt    REG_DWORD    0x0
[2025-03-06T10:05:29.262Z]     NtfsDisable8dot3NameCreation    REG_DWORD    0x2
[2025-03-06T10:05:29.262Z]     NtfsDisableCompression    REG_DWORD    0x0
[2025-03-06T10:05:29.262Z]     NtfsDisableEncryption    REG_DWORD    0x0
[2025-03-06T10:05:29.263Z]     NtfsDisableLastAccessUpdate    REG_DWORD    0x80000003
[2025-03-06T10:05:29.263Z]     NtfsDisableLfsDowngrade    REG_DWORD    0x0
[2025-03-06T10:05:29.263Z]     NtfsDisableVolsnapHints    REG_DWORD    0x0
[2025-03-06T10:05:29.264Z]     NtfsEncryptPagingFile    REG_DWORD    0x0
[2025-03-06T10:05:29.264Z]     NtfsMemoryUsage    REG_DWORD    0x0
[2025-03-06T10:05:29.264Z]     NtfsMftZoneReservation    REG_DWORD    0x0
[2025-03-06T10:05:29.265Z]     NtfsQuotaNotifyRate    REG_DWORD    0xe10
[2025-03-06T10:05:29.265Z]     RefsDisableLastAccessUpdate    REG_DWORD    0x1
[2025-03-06T10:05:29.265Z]     ScrubMode    REG_DWORD    0x1
[2025-03-06T10:05:29.266Z]     SymlinkLocalToLocalEvaluation    REG_DWORD    0x1
[2025-03-06T10:05:29.266Z]     SymlinkLocalToRemoteEvaluation    REG_DWORD    0x1
[2025-03-06T10:05:29.266Z]     SymlinkRemoteToLocalEvaluation    REG_DWORD    0x0
[2025-03-06T10:05:29.267Z]     SymlinkRemoteToRemoteEvaluation    REG_DWORD    0x0
[2025-03-06T10:05:29.267Z]     UdfsCloseSessionOnEject    REG_DWORD    0x3
[2025-03-06T10:05:29.267Z]     UdfsSoftwareDefectManagement    REG_DWORD    0x0
[2025-03-06T10:05:29.267Z]     Win31FileSystem    REG_DWORD    0x0
[2025-03-06T10:05:29.267Z]     Win95TruncatedExtensions    REG_DWORD    0x1

Checked with jenkinsci/docker-agent@84ad705/build.ps1#L51-L53 in build.ps1:

Sanity checks

Invoke-Expression 'git config --global --list'
Invoke-Expression 'reg.exe query HKLM\SYSTEM\CurrentControlSet\Control\FileSystem'

the build stage run on [EC2 (aws-us-east-2) - Windows 2019 x86_64 with JDK21 (i-009f1f367912a75c0)]
build from ami-0c04f43b6075e3755

Image

with tag version 2.30.0
https://github.com/jenkins-infra/packer-images/releases/tag/2.30.0

with the PR: jenkins-infra/packer-images#1779
and:

## Enabling LongPaths
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name LongPathsEnabled -type DWord -Value 1

weird

@lemeurherveCB
Copy link

lemeurherveCB commented Mar 6, 2025

This LongPaths is enabled, it seems that's the git config which is missing core.longPaths

@lemeurherveCB
Copy link

lemeurherveCB commented Mar 6, 2025

Which is weird as it should be, according to https://github.com/smerle33/packer-images/blob/c945b88cfc95db03b81fbbe439867da2c64c6212/provisioning/windows-provision.ps1#L146

EDIT: I was looking at --global, not --system 🤦

@lemeurherveCB
Copy link

Testing setting up core.longPaths directly in build.ps1 for now: jenkinsci/docker-agent@ab05d96

@jtnord
Copy link

jtnord commented Mar 6, 2025

Are these tests using the git testing repo?
There where historically some issues with it (e.g. picking up user hooks) such that the config was overwritten....

I can not recall where this was but I fixed this a few years ago, and this may be causing the issues now if it is not picking up the system config (on purpose)
Let me try and look

jenkinsci/git-plugin@8975775 should not IIUC impact settings.

@jonesbusy
Copy link

I see.

I was checking also my nodes

PS C:\Users\jenkins> git --version
git version 2.48.1.windows.1
PS C:\Users\jenkins> git config --system core.longpaths
true
PS C:\Users\jenkins>

And never saw any occurence of very long path

So this might be related to GitSampleRepoRule?

@jtnord
Copy link

jtnord commented Mar 6, 2025

So this might be related to GitSampleRepoRule?

It was a hypothesis, but if git is configured to use core.longpaths in the system (which it appears to be) then I don't see anything that would splat this.
I couldn't reproduce this locally[1] (but windows 11 24H2 is a much more recent kernel version than server 2019)

[1] I have both the windows setting and core.longpaths set (global) for my user.

@jglick
Copy link
Author

jglick commented Mar 6, 2025

For diagnostic purposes I would suggest

git config --show-origin --show-scope --list

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

No branches or pull requests

7 participants