Unhandled Exception ("Error") Call to a member function setExternalURI() on null

Thanks for developing Phabricator! When we open the overview page of a repository that contains git submodules an error is thrown:


This happens with all repos that uses git submodules. Repos without work as expected.

Reproduction Instructions
First create a new Phabricator hosted git repository in Diffusion. Go to the repositorys page (e.g https://phabricator.example.com/source/myprog/). Check that error is not fired. Next clone the repo to a local machine. Add a submodule with

git submodule add ssh://git@phabricator.example.com/sources/greatlib

arc land or git push it to Phabricator. Try to open the overview page again. Now the Unhandled Exception is thrown.

Phabricator/Arcanist Version
We are using Phabricator branch stable on a Ubuntu 18.04 machine with php version 7.2.
Phabricator last commit:

commit 69870a6bc26822b058a8a8f7a568d8dec0baa6b7 (HEAD -> stable, origin/stable)
Author: epriestley <git@epriestley.com>
Date:   Mon Jan 25 09:06:02 2021 -0800

As far as we can tell, the problem is in file DiffusionBrowseQueryConduitAPIMethod.php. $path is null, so php can not invoke the method. If we change $path to $path_result (which is a DiffusionRepositoryPath object) we do not get the Unhandled Exception anymore. Here you can find a diff:

diff --git a/src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php
index 4402c2a5d0..ea6a4f98c2 100644
--- a/src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php
@@ -240,7 +240,7 @@ final class DiffusionBrowseQueryConduitAPIMethod
           $full_path = $submodule_path->getFullPath();
           $key = 'submodule.'.$full_path.'.url';
           if (isset($dict[$key])) {
-            $path->setExternalURI($dict[$key]);
+            $path_result->setExternalURI($dict[$key]);

We don’t know if this is realy a solution, but it might help you to find the root cause.

1 Like

We’re seeing the same issue as well, also on the same commit.

Thanks. See https://secure.phabricator.com/T13595.

I believe this is fixed by https://secure.phabricator.com/D21520, which is now in master. This change should be available in stable (and deployed to the Phacility cluster) later this morning.

(The patch above identified the problem correctly and was helpful in narrowing this down, but I think we want $submodule_path as a replacement rather than $path_result. See T13595 for some context.)

Thanks for the quick reply and the reference to the ticket T13595.