Git push failed with Filesize limit on

#1

Observed Behavior:
Failed to push the commit with Filesize limit is on. If I set Filesize to unlimited, I can push normally again. Error:

    Counting objects: 4, done.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 2.33 KiB | 0 bytes/s, done.
    Total 3 (delta 0), reused 0 (delta 0)
    remote: [2019-04-13 10:44:34] EXCEPTION: (CommandException) Command failed with error #129!
    remote: COMMAND
    remote: git cat-file --batch-check='%(objectsize)'
    remote:
    remote: STDOUT
    remote: (empty)
    remote:
    remote: STDERR
    remote: error: option `batch-check' takes no value
    remote: usage: git cat-file (-t|-s|-e|-p|<type>|--textconv) <object>
    remote:    or: git cat-file (--batch|--batch-check) < <list_of_objects>
    remote:
    remote: <type> can be one of: blob, tree, commit, tag
    remote:     -t                    show object type
    remote:     -s                    show object size
    remote:     -e                    exit with zero when there's no error
    remote:     -p                    pretty-print object's content
    remote:     --textconv            for blob objects, run textconv on object's content
    remote:     --batch               show info and content of objects fed from the standard input
    remote:     --batch-check         show info about objects fed from the standard input
    remote:
    remote:  at [<phutil>/src/future/exec/ExecFuture.php:380]
    remote: arcanist(head=master, ref.master=9830c9316d38), phabricator(head=master, ref.master=fb193106314e), phutil(head=master, ref.master=70ac0d66e300)
    remote:   #0 ExecFuture::resolvex() called at [<phutil>/src/filesystem/linesofalarge/LinesOfALargeExecFuture.php:108]
    remote:   #1 LinesOfALargeExecFuture::readMore() called at [<phutil>/src/filesystem/linesofalarge/LinesOfALarge.php:199]
    remote:   #2 LinesOfALarge::next() called at [<phutil>/src/filesystem/linesofalarge/LinesOfALarge.php:111]
    remote:   #3 LinesOfALarge::rewind() called at [<phabricator>/src/applications/diffusion/query/lowlevel/DiffusionLowLevelFilesizeQuery.php:102]
    remote:   #4 DiffusionLowLevelFilesizeQuery::loadGitFilesizes() called at [<phabricator>/src/applications/diffusion/query/lowlevel/DiffusionLowLevelFilesizeQuery.php:21]
    remote:   #5 DiffusionLowLevelFilesizeQuery::executeQuery() called at [<phabricator>/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php:23]
    remote:   #6 DiffusionLowLevelQuery::execute() called at [<phabricator>/src/applications/diffusion/engine/DiffusionCommitHookEngine.php:1361]
    remote:   #7 DiffusionCommitHookEngine::loadFileSizesForCommit(string) called at [<phabricator>/src/applications/diffusion/engine/DiffusionCommitHookEngine.php:1348]
    remote:   #8 DiffusionCommitHookEngine::getFileSizesForCommit(string) called at [<phabricator>/src/applications/diffusion/engine/DiffusionCommitHookEngine.php:1289]
    remote:   #9 DiffusionCommitHookEngine::rejectOversizedFiles(array) called at [<phabricator>/src/applications/diffusion/engine/DiffusionCommitHookEngine.php:170]
    remote:   #10 DiffusionCommitHookEngine::execute() called at [<phabricator>/scripts/repository/commit_hook.php:199]
    To https://example.com/source/repo1.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://example.com/source/repo1.git'

Expected Behavior:
The commit should be pushed successfully.

Phabricator Version:
phabricator 7e1743a959e01e63d306dcc670685f678effe540 (Fri, Apr 5)
arcanist 9830c9316d38988b2dc283ac1a124b73bc8e6c5f (Mar 8 2019)
phutil 70ac0d66e300302eeef1381343371fa06922c81b (Tue, Apr 2)
php 7.1.27
diff 3.3 at /usr/bin/diff
git 1.8.3.1 at /usr/bin/git
hg Not Available
pygmentize Not Available
svn Not Available

Reproduction Steps:

  1. In Phabricator repo manage page, set Filesize limit to 5MB.
  2. Clone repo to local PC.
  3. Add new file ~24KB.
  4. Push new changes to repo -> Failed.
0 Likes

#2

git 1.8.3.1 at /usr/bin/git

Your git is about three and a half years old. Update to git 1.8.4 (which introduced --batch-check=<format>) or newer to use this feature. See:

0 Likes

#3

See https://secure.phabricator.com/D20431.

0 Likes

closed #4
0 Likes