I'm unable to push any commit to any repo. I use this docker for my company Phabricator instance. Unfortunately the recent update has broken the pre-receive hook.
I started up a fresh local instance of the docker and created an empty repo. See below (domain info replaced with xxxx):
$ git clone ssh://git@phabricator.xxxx.com/diffusion/1/test.git Cloning into 'test'... warning: You appear to have cloned an empty repository. Checking connectivity... done. $ cd test $ touch file.txt $ git status On branch master Initial commit Untracked files: (use "git add <file>..." to include in what will be committed) file.txt nothing added to commit but untracked files present (use "git add" to track) $ git add -A $ git commit -m "Added empty file" [master (root-commit) 61a46cf] Added empty file 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 file.txt $ git push origin master Counting objects: 3, done. Writing objects: 100% (3/3), 226 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) remote: [2016-12-04 18:32:56] EXCEPTION: (CommandException) Command failed with error #128! remote: COMMAND remote: git log --format='%H' '61a46cf3d362b903a85cde2d0ea132703462c57a' --not --all remote: remote: STDOUT remote: (empty) remote: remote: STDERR remote: fatal: bad object 61a46cf3d362b903a85cde2d0ea132703462c57a remote: at [<phutil>/src/future/exec/ExecFuture.php:369] remote: arcanist(head=stable, ref.master=fad85844314b, ref.stable=e17fe43ca3fe), phabricator(head=stable, ref.master=f0bf0419f12a, ref.stable=ad65d933fa75), phutil(head=stable, ref.master=6296b5d0f1e9, ref.stable=3230179f3ce5) remote: #0 ExecFuture::resolvex() called at [<phabricator>/src/applications/diffusion/engine/DiffusionCommitHookEngine.php:565] remote: #1 DiffusionCommitHookEngine::findGitContentUpdates(array) called at [<phabricator>/src/applications/diffusion/engine/DiffusionCommitHookEngine.php:250] remote: #2 DiffusionCommitHookEngine::findContentUpdates(array) called at [<phabricator>/src/applications/diffusion/engine/DiffusionCommitHookEngine.php:133] remote: #3 DiffusionCommitHookEngine::execute() called at [<phabricator>/scripts/repository/commit_hook.php:186] To ssh://git@phabricator.xxxx.com/diffusion/1/test.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'ssh://git@phabricator.xxxx.com/diffusion/1/test.git'
Existing repos with existing commit history will get the 'dragon' (see below), even after a fresh clone. Then, if I allow dangerous actions, I get the error output above, same as a new repo.
$ git push origin dev Counting objects: 2, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (2/2), 283 bytes | 0 bytes/s, done. Total 2 (delta 1), reused 0 (delta 0) remote: +---------------------------------------------------------------+ remote: | * * * PUSH REJECTED BY EVIL DRAGON BUREAUCRATS * * * | remote: +---------------------------------------------------------------+ remote: \ remote: \ ^ /^ remote: \ / \ // \ remote: \ |\___/| / \// .\ remote: \ /V V \__ / // | \ \ *----* remote: / / \/_/ // | \ \ \ | remote: @___@` \/_ // | \ \ \/\ \ remote: 0/0/| \/_ // | \ \ \ \ remote: 0/0/0/0/| \/// | \ \ | | remote: 0/0/0/0/0/_|_ / ( // | \ _\ | / remote: 0/0/0/0/0/0/`/,_ _ _/ ) ; -. | _ _\.-~ / / remote: ,-} _ *-.|.-~-. .~ ~ remote: \ \__/ `/\ / ~-. _ .-~ / remote: \____(Oo) *. } { / remote: ( (--) .----~-.\ \-` .~ remote: //__\\ \ DENIED! ///.----..< \ _ -~ remote: // \\ ///-._ _ _ _ _ _ _{^ - - - - ~ remote: remote: remote: DANGEROUS CHANGE: The change you're attempting to push updates the branch 'dev' from '9c8002769cbb' to '37772df5de48', but this is not a fast-forward. Pushes which rewrite published branch history are dangerous. remote: Dangerous change protection is enabled for this repository. remote: Edit the repository configuration before making dangerous changes. remote: To ssh://git@phabricator.xxxx.com/diffusion/72/xxxx.git ! [remote rejected] dev -> dev (pre-receive hook declined) error: failed to push some refs to 'ssh://git@phabricator.xxxx.com/diffusion/72/xxxx.git'
Initially I though it was a specific repo that got corrupted, but soon realised that all repos are doing exactly the same.
Version Info:
arcanist(head=stable, ref.master=fad85844314b, ref.stable=e17fe43ca3fe), phabricator(head=stable, ref.master=f0bf0419f12a, ref.stable=ad65d933fa75)
Replicate:
- Start fresh instance of the docker with stable branches passed as the env vars or setup manually (untested).
- Run through initial admin account creation.
- Add your public key via settings.
- Create and empty self hosted repository using Diffusion.
- Clone the repo.
- Create a file and commit it.
- Attempt to push it to origin