Arc patch fails with git lfs files


#1

Hi folks,

I’m encountering a git lfs problem when updating any lfs tracked files and trying to patch them with arc patch

I can reproduce this with the latest arcanist version with: GIT_TRACE=true arc patch --diff XXXX --trace

09:44:36.145344 trace git-lfs: HTTP: {"objects":[{"oid":"0a1066fd8132ddd3fe805482d5a13eee00c025f4c6f120602079b5c9b852ecb1","size":35062}]}
09:44:36.145344 trace git-lfs: tq: starting transfer adapter "basic"
Error downloading object: src/sysadmin.jpg (0a1066f): Smudge error: Error opening media file.: open C:\Temp\jenk\.git\lfs\objects\0a\10\0a1066fd8132ddd3fe805482d5a13eee00c025f4c6f120602079b5c9b852ecb1: The system cannot find the file specified.

Errors logged to C:\Temp\jenk\.git\lfs\logs\20190226T094436.1453448.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: src/sysadmin.jpg: smudge filter lfs failed
<<< [11] (+3,086) <exec> 1,119,192 us

Unfortunately I didn’t found much details or help yet. I’ve already found https://secure.phabricator.com/T7789 and would like to note we also don’t use the alternate-file-domain.

Environment Details

Phabricator

  • Phabricator OS
    • CentOs 7.6.1810 (Core)
  • Relevant installed packages
    • git-1.8.3.1-20.el7.x86_64

Build System

  • Jenkins Build Server OS
    • CentOs 7.6
  • Installed Packages
    • jenkins-2.150.2-1.1.noarch
    • git-1.8.3.1-20.el7.x86_64
  • Installed Jenkins Plugins
    • Phabricator Differential Plugin

Dev Systems & Build Slaves

  • OS

    • Windows Server 2k12r2
    • Windows 7 - 10
  • Installed git version

    • >= 2.18.0.windows.1
    • LFS: >= git-lfs/2.4.2

Arcanist / libphutil

all systems using the same libphutil / arcanist versions including the windows patches (D15675, D15693)

Error log

R0-I01-BHWINR01+jenkins@r0-i01-bhwinr01 MINGW64 /c/Temp/jenk/src (master)
$ arc patch --diff 3638 --trace
 ARGV  C:/tools/src/arcanist/bin/../scripts/arcanist.php patch --diff 3638 --trace
 LOAD  Loaded "phutil" from "C:\tools\src\libphutil\src".
 LOAD  Loaded "arcanist" from "C:\tools\src\arcanist\src".
Config: Reading user configuration file "C:\Users\jenkins\AppData\Roaming/.arcrc"...
Config: Reading system configuration file "C:\ProgramData\Phabricator\Arcanist\config"...
Working Copy: Reading .arcconfig from "C:\Temp\jenk/.arcconfig".
Working Copy: Path "C:\Temp\jenk\src" is part of `git` working copy "C:\Temp\jenk".
Working Copy: Project root is at "C:\Temp\jenk".
Config: Did not find local configuration at "C:\Temp\jenk\.git\arc/config".
>>> [0] (+0) <http> https://phabricator.XXXXX.net/api/differential.querydiffs
<<< [0] (+468) <http> 468,904 us
>>> [1] (+469) <http> https://phabricator.XXXXX.net/api/user.whoami
<<< [1] (+681) <http> 211,750 us
>>> [2] (+681) <http> https://phabricator.XXXXX.net/api/differential.querydiffs
<<< [2] (+914) <http> 232,764 us
>>> [3] (+919) <exec> $ git symbolic-ref --quiet HEAD
<<< [3] (+1,021) <exec> 101,795 us
>>> [4] (+1,027) <exec> $ git rev-parse --symbolic-full-name master@{upstream}
<<< [4] (+1,128) <exec> 101,290 us
>>> [5] (+1,129) <exec> $ git --version
<<< [5] (+1,229) <exec> 100,634 us
>>> [6] (+1,229) <exec> $ git ls-remote --get-url origin
<<< [6] (+1,331) <exec> 101,567 us
>>> [7] (+1,331) <http> https://phabricator.XXXXX.net/api/repository.query
<<< [7] (+1,547) <http> 215,304 us
>>> [8] (+1,547) <exec> $ git status --porcelain=2 -z
<<< [8] (+1,748) <exec> 200,623 us
>>> [9] (+1,748) <exec> $ git show -s --format=^%H 12158ce3276b36bcf984095762fac62c5465810f --
<<< [9] (+1,849) <exec> 100,938 us
>>> [10] (+1,849) <exec> $ git symbolic-ref --quiet HEAD
<<< [10] (+1,951) <exec> 101,358 us
>>> [11] (+1,951) <exec> $ git rev-parse --verify arcpatch-D934
<<< [11] (+2,052) <exec> 101,104 us
>>> [12] (+2,052) <exec> $ git show -s --format=^%H 12158ce3276b36bcf984095762fac62c5465810f --
<<< [12] (+2,154) <exec> 101,639 us
>>> [13] (+2,154) <exec> $ git checkout -b arcpatch-D934 12158ce3276b36bcf984095762fac62c5465810f
<<< [13] (+2,355) <exec> 200,776 us
Created and checked out branch arcpatch-D934.
>>> [14] (+2,355) <exec> $ git show -s --format=^%H 12158ce3276b36bcf984095762fac62c5465810f --
<<< [14] (+2,456) <exec> 101,269 us
>>> [15] (+2,470) <exec> $ git apply --whitespace nowarn --index --reject -- C:\Users\jenkins\AppData\Local\Temp\1\cwjr332v8hcsksk8\2157798.tmp
Checking patch src/sysadmin.jpg...
Downloading src/sysadmin.jpg (35 KB)
Error downloading object: src/sysadmin.jpg (0a1066f): Smudge error: Error opening media file.: open C:\Temp\jenk\.git\lfs\objects\0a\10\0a1066fd8132ddd3fe805482d5a13eee00c025f4c6f120602079b5c9b852ecb1: The system cannot find the file specified.

Errors logged to C:\Temp\jenk\.git\lfs\logs\20190228T084535.1528772.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: src/sysadmin.jpg: smudge filter lfs failed
<<< [15] (+3,577) <exec> 1,106,738 us

 Patch Failed!
Usage Exception: Unable to apply patch!

[2019-02-28 07:45:35] EXCEPTION: (ArcanistUsageException) Unable to apply patch! at [<arcanist>\src\workflow\ArcanistPatchWorkflow.php:714]
arcanist(head=upd2018, ref.master=e1e93271e6e0, ref.upd2018=9983d8ad6939, custom=1), phutil(head=upd2018, ref.master=ddc0e031461b, ref.upd2018=b22a1a83dafb)
  #0 ArcanistPatchWorkflow::run() called at [<arcanist>\src\workflow\ArcanistPatchWorkflow.php:390]
  #1 ArcanistPatchWorkflow::run() called at [<arcanist>\scripts\arcanist.php:394]

Client Env Details

R0-I01-BHWINR01+jenkins@r0-i01-bhwinr01 MINGW64 /c/Temp/jenk/src (arcpatch-D934)
$ git lfs env
git-lfs/2.6.1 (GitHub; windows amd64; go 1.11.1; git dc072c3e)
git version 2.20.1.windows.1

Endpoint=https://phabricator.XXXXX.net/source/jenk.git/info/lfs (auth=basic)
LocalWorkingDir=C:\Temp\jenk
LocalGitDir=C:\Temp\jenk\.git
LocalGitStorageDir=C:\Temp\jenk\.git
LocalMediaDir=C:\Temp\jenk\.git\lfs\objects
LocalReferenceDirs=
TempDir=C:\Temp\jenk\.git\lfs\tmp
ConcurrentTransfers=3
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=C:\Temp\jenk\.git\lfs
AccessDownload=basic
AccessUpload=basic
DownloadTransfers=basic
UploadTransfers=basic
GIT_EXEC_PATH=C:/Program Files/Git/mingw64/libexec/git-core
GIT_SSL_NO_VERIFY=1
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"

Git lfs itself seems to work, because I’m able to add lfs files and push them. But patching existing files with arc patch fails on the jenkins build slaves and every other systems.

Did I miss anything? - I noticed the phabricator system itself hasn’t installed the git-lfs package itself? - Is this required or is the lfs logic handled by phabricator itself?

I really hope someone could help with any ideas or advice :smiley:


#2

Unfortunately I didn’t find any solution for this

My fallback scenario is now to migrate back from lfs stored files. Is there any specific way to migrate such files in phabricator hosted git repos?