Page MenuHomePhabricator

Error with new hosted repository
Closed, DuplicatePublic

Description

Reproduction steps

  • create new git repository
  • activate it (it should become hosted)
  • open repository page

Expected result:

  • main repository page opens

Actual result:

  • Unhandled Exception ("CommandException")
Command failed with error #128!
COMMAND
git for-each-ref --sort='-creatordate' --format='%(objectname)%01%(objecttype)%01%(refname)%01%(*objectname)%01%(*objecttype)%01%(subject)%01%(creator)' -- 'refs/'

STDOUT
(empty)

STDERR
fatal: Not a git repository (or any of the parent directories): .git

Stack trace:
ExecFuture::resolvex called at [/var/www/phabricator/src/applications/repository/storage/PhabricatorRepository.php:532]
PhabricatorRepository::execxLocalCommand called at [/var/www/phabricator/src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php:65]
DiffusionLowLevelQuery::execute called at [/var/www/phabricator/src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php:74]
DiffusionLowLevelResolveRefsQuery::resolveGitRefs called at [/var/www/phabricator/src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php:41]
DiffusionLowLevelResolveRefsQuery::executeQuery called at [/var/www/phabricator/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php:23]
DiffusionLowLevelQuery::execute called at [/var/www/phabricator/src/applications/diffusion/conduit/DiffusionResolveRefsConduitAPIMethod.php:37]
DiffusionResolveRefsConduitAPIMethod::getResult called at [/var/www/phabricator/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php:158]
DiffusionQueryConduitAPIMethod::execute called at [/var/www/phabricator/src/applications/conduit/method/ConduitAPIMethod.php:123]
ConduitAPIMethod::executeMethod called at [/var/www/phabricator/src/applications/conduit/call/ConduitCall.php:131]
ConduitCall::executeMethod called at [/var/www/phabricator/src/applications/conduit/call/ConduitCall.php:81]
ConduitCall::execute called at [/var/www/phabricator/src/applications/diffusion/query/DiffusionQuery.php:82]
DiffusionQuery::callConduitWithDiffusionRequest called at [/var/www/phabricator/src/applications/diffusion/request/DiffusionRequest.php:676]
DiffusionRequest::resolveRefs called at [/var/www/phabricator/src/applications/diffusion/request/DiffusionRequest.php:584]
DiffusionRequest::queryStableCommit called at [/var/www/phabricator/src/applications/diffusion/request/DiffusionRequest.php:342]
DiffusionRequest::getStableCommit called at [/var/www/phabricator/src/applications/diffusion/request/DiffusionRequest.php:608]
DiffusionRequest::getRefAlternatives called at [/var/www/phabricator/src/applications/diffusion/controller/DiffusionRepositoryController.php:378]
DiffusionRepositoryController::buildPropertiesTable called at [/var/www/phabricator/src/applications/diffusion/controller/DiffusionRepositoryController.php:29]
DiffusionRepositoryController::handleRequest called at [/var/www/phabricator/src/aphront/configuration/AphrontApplicationConfiguration.php:269]
phlog called at [/var/www/phabricator/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
PhabricatorDefaultRequestExceptionHandler::handleRequestException called at [/var/www/phabricator/src/aphront/configuration/AphrontApplicationConfiguration.php:678]
AphrontApplicationConfiguration::handleException called at [/var/www/phabricator/src/aphront/configuration/AphrontApplicationConfiguration.php:274]
AphrontApplicationConfiguration::processRequest called at [/var/www/phabricator/src/aphront/configuration/AphrontApplicationConfiguration.php:177]
AphrontApplicationConfiguration::runHTTPRequest called at [/var/www/phabricator/webroot/index.php:17]

Arguments passed to proc_open in \ExecFuture::isReady method ($unmasked_command, $spec, $pipes, $cwd, $env):

Array
(
    [0] => git for-each-ref --sort='-creatordate' --format='%(objectname)%01%(objecttype)%01%(refname)%01%(*objectname)%01%(*objecttype)%01%(subject)%01%(creator)' -- 'refs/'
    [1] => Array
        (
            [0] => Array
                (
                    [0] => pipe
                    [1] => r
                )

            [1] => Array
                (
                    [0] => pipe
                    [1] => w
                )

            [2] => Array
                (
                    [0] => pipe
                    [1] => w
                )

        )

    [2] => Array
        (
            [0] => Resource id #15
            [1] => Resource id #16
            [2] => Resource id #17
        )

    [3] => /var/repo/4/
    [4] => Array
        (
            [LANG] => en_US.UTF-8
            [HOME] => /var/www/phabricator/support/empty/
            [PATH] => /var/www/phabricator/support/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/usr/bin:/usr/local/bin:/usr/lib/git-core
        )

)
If I run git for-each-ref --sort='-creatordate' --format='%(objectname)%01%(objecttype)%01%(refname)%01%(*objectname)%01%(*objecttype)%01%(subject)%01%(creator)' -- 'refs/' in repository directory (/var/repo/4/) it does nothing and exit status is 0.

Versions:

git version 2.12.0

Operating System: CentOS Linux 7 (Core)
Kernel: Linux 3.10.0-514.10.2.el7.x86_64

Misc

"phd.user": "daemon"
$ ls -al /var/repo
total 8
drwxr-xr-x.  3 daemon daemon   14 Mar 20 23:54 .
drwxr-xr-x. 22 root   root   4096 Mar 21 01:18 ..
drwxr-xr-x.  7 daemon daemon 4096 Mar 20 23:54 4
$ ls -la /var/repo/4
total 20
drwxr-xr-x. 7 daemon daemon 4096 Mar 20 23:54 .
drwxr-xr-x. 3 daemon daemon   14 Mar 20 23:54 ..
drwxr-xr-x. 2 daemon daemon    6 Mar 20 23:54 branches
-rw-r--r--. 1 daemon daemon   66 Mar 20 23:54 config
-rw-r--r--. 1 daemon daemon   73 Mar 20 23:54 description
-rw-r--r--. 1 daemon daemon   23 Mar 20 23:54 HEAD
drwxr-xr-x. 3 daemon daemon 4096 Mar 20 23:54 hooks
drwxr-xr-x. 2 daemon daemon   20 Mar 20 23:54 info
drwxr-xr-x. 4 daemon daemon   28 Mar 20 23:54 objects
drwxr-xr-x. 4 daemon daemon   29 Mar 20 23:54 refs
$ cat /var/repo/4/config
[core]
	repositoryformatversion = 0
	filemode = true
	bare = true

Event Timeline

Do you maybe have SELinux or AppArmor running?

Also, really great bug report :)

You are my hero! :)

Problem is solved by disabling SELinux:

$ sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28
$ getenforce
Enforcing
$ setenforce 0
$ getenforce
Permissive

I can't reproduce this with the steps provided. Here's what I tested:

  • Go to Phacility and launch a new temporary instance.
  • Navigate to new instance once launched
  • Go to Diffusion and click Create Repository
  • Set up new git repository
  • Use "Test" as name and "T" as callsign
  • From Repository Manage page, click "Activate Repository"
  • Click "View Repository" from the Header

Page displays as expected. Do you have additional steps we can follow in order to reproduce this issue?

well that was a waste. lolz. ๐Ÿˆ