Viewing repository history for SVN repository causes unhandled exception

Reproduction Instructions

Set up a repository that observes an SVN repository, then try to access the repository history through the user interface using the path /source/<repo_name>/history/.

The page shows an Unhandled Exception ("TypeError") page with the following content:

Argument 1 passed to DiffusionCommitGraphView::getBuildable() must be an instance of PhabricatorRepositoryCommit, null given, called in /var/www/phabricator/phabricator/src/applications/diffusion/view/DiffusionCommitGraphView.php on line 489

Phabricator/Arcanist Version

Library Version Date Branchpoint
phabricator 7daaaa8463e2 Sat, Sep 5
arcanist ceb082ef6b29 Jul 23 2020

Other Version Information

Binary Version Path
php 7.4.9 fpm-fcgi
diff 3.6 /usr/bin/diff
git 2.17.1 /usr/bin/git
hg 4.5.3 /usr/bin/hg
pygmentize 2.2.0 /usr/bin/pygmentize
svn 1.9.7 /usr/bin/svn

This seems to be caused by this block of code:

    $commit = $this->getCommit($hash);
    if (!$commit) {
      $buildable = $this->getBuildable($commit);

This calls getBuildable with $commit being null, which is not allowed by the type hint.

This patch prevents the error message from showing, but the history view is still totally broken:

diff --git src/applications/diffusion/view/DiffusionCommitGraphView.php src/applications/diffusion/view/Diffus                  ionCommitGraphView.php
index a43f44f033..0caf07b867 100644
--- src/applications/diffusion/view/DiffusionCommitGraphView.php
+++ src/applications/diffusion/view/DiffusionCommitGraphView.php
@@ -548,7 +548,11 @@ final class DiffusionCommitGraphView

-  private function getBuildable(PhabricatorRepositoryCommit $commit) {
+  private function getBuildable(?PhabricatorRepositoryCommit $commit) {
+    if (is_null($commit)) {
+        return null;
+    }
     $buildable_map = $this->getBuildableMap();
     return idx($buildable_map, $commit->getPHID());


At least I can click into each revision to see the details for the revision.

Thanks, this should be fixed by

1 Like

Thanks, that does fix the immediate error.

However, my history now shows Discovering… for all revisions (see above screenshot in post #3). In the past, it would show the commit messages.

Clicking through the Discovering... link does take me to the revision page (e.g. /R1:28762) though and from there I can see the full commit message and author, though the date/time is missing:

Shall I open a separate topic/issue for this?

EDIT: Narrowed this down to L151 - $item['commit'] is null, for all entries in $items.

I put a dump on L341 to dump $history at that point and it contains the commit messages.

It then calls into getCommit with a valid $hash, but $commit_map is an empty array.

It seems like DiffusionCommitQuery is returning an empty result set at L621 for some reason.

I need to dig even further down the rabbit hole to work out how/why…

Thanks, I think this is fixed by

1 Like

Perfect, that does seem to solve the issue. Thanks!

Hi, for me (phabricator 58d3f6145a85 / Thu, Sep 17, arcanist a716c4e55fdd / Fri, Sep 18) the “Authored on” is still empty. So it seems that at least this is not fixed by

Are you still talking about the History commit list view? I can’t see an Authored on bit there.

I do have a missing Authored on when viewing a single commit though (e.g. URL /R1:28861), which I’ve just noticed now that you mention it:

Right, exactly. I am talking about viewing a single commit.

1 Like

Hi Evan, shall I create a new thread for the issue mentioned below (no “Authored on” in SVN commit view?) Also in Diffusion query results (e.g. “Active Audits”), how do I display commit date or group by commit date? It was displayed some weeks ago.

Thanks and best regards