Page MenuHomePhabricator

Unhandled Exception ("FilesystemException") after adding Github repo
Closed, InvalidPublic

Description

I have just added a Github repro to Diffusion. It seems that the import process was failed (I haven't input SSH key).
Then after saving, I cannot open that repro anymore.
When I go to domain.com/diffusion/JS/, there is a error message:

Unhandled Exception ("FilesystemException")	
File system entity '/var/repo/JS/' does not exist.
  • I checked in /var/repo, there is no directory there. (I imported successfully 2 SVN projects) before.
  • The permission of the directory is root (I used Ubuntu script to install Phabricator). I tried to create /JS directory but the issue is still the same.
  • I chown and /var/repo to the user used for Phabricator but nothing changed.
  • Go to /diffusion/JS/edit didn't work

deamon is running as root user

Log Daemon       Host      Overseer Started                 Class                                Arguments
269 31010:w4uwzp localhost 31010    Feb 13 2016, 1:57:58 AM PhabricatorRepositoryPullLocalDaemon
270 31010:weud5i localhost 31010    Feb 13 2016, 1:57:58 AM PhabricatorTriggerDaemon
271 31010:dft32r localhost 31010    Feb 13 2016, 1:57:58 AM PhabricatorTaskmasterDaemon

I restarted the daemons and manually add /JS directory by root. Then that message disappears and new message appears:

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/heads/'

STDOUT
(empty)

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

Ref: T9190

Event Timeline

/var/repo/ needs to be owned by the daemon user (The user that phd runs as), and the daemons need to be running.
When importing git/mercurial repos, the daemons copy all the content to /var/repo/CALLSIGN; That doesn't happen with SVN, which is why you didn't run into this before.

What do you mean by "/diffusion/JS/edit didn't work"? Was there an error message?

deamon is running as root user

Log Daemon       Host      Overseer Started                 Class                                Arguments
269 31010:w4uwzp localhost 31010    Feb 13 2016, 1:57:58 AM PhabricatorRepositoryPullLocalDaemon
270 31010:weud5i localhost 31010    Feb 13 2016, 1:57:58 AM PhabricatorTriggerDaemon
271 31010:dft32r localhost 31010    Feb 13 2016, 1:57:58 AM PhabricatorTaskmasterDaemon

I restarted the daemons and manually add /JS directory by root. Then that message disappears and new message appears:

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/heads/'

STDOUT
(empty)

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

In T9190, Even suggested to go to diffusion/Repo/edit directly to test

Delete the JS directory, and visit the /edit page; It should show information about the state of the daemons.
Look also at the daemons console (Navigate to /daemon/), and look for failing daemons and logs.

Deleted JS directory.
/daemon/ link shows no failing task recently:

pasted_file (831×1 px, 135 KB)

Updated:
/diffusion/JS/edit/ shows this error:

Initialization Error	Pull of 'rJS' failed: Command failed with error #128! COMMAND git clone --bare -- 'xxxxx' '/var/repo/JS' STDOUT (empty) STDERR Cloning into bare repository '/var/repo/JS'... fatal: I don't handle protocol 'git@github.com:https'
epriestley added a subscriber: epriestley.

This report does not include reproduction steps. Bug reports must include complete, self-contained reproduction steps to be accepted by the upstream. See Providing Reproduction Steps for help.

I ran into this same issue, it was caused by user error, but the error handling of diffusion could still be fixed. Here's how to reproduce:

  • Create a remote repository with an incorrect URL (in my case I missed a '/')
  • The repository is created but fails to update from remote due to the user error
  • Click on the repository and met with error: Unhandled Exception ("FilesystemException") - filesystem shows the directory hasn't been created.
  • There is no option to edit the repository

This is where I was stuck, but found this thread via search. Following an earlier post, I manually added /edit/ to the end of the URL (note that you MUST have the trailing slash after /edit/). This brought me to the repository page and let me find the mistake I had made entering the remote URL. Fix the details, save and the problem is resolved.

My recommandation is that there is an option to edit the repository even if it has suffered an unhandled expection. Even though this was user error, the interface provided no direct way to correct the mistake.