Git ssh conduit ping shows a vague logging issue


#1

All log elements are set up in settings (log.ssh.path, log.access.path, etc.).

When I enter the following command as my ‘git’ user
$ echo {} | ssh git@lab.linguisticteam.org conduit conduit.ping

I get back the expected
{"result":"lti.linguisticteam.org","error_code":null,"error_info":null}

But It’s immediately followed by the following traceback:

arcanist(head=master, ref.master=d581c453b83c), phabricator(head=master, ref.master=5bcca675e1c7), phutil(head=master, ref.master=20eff1c8d14f)
  #0 <#2> Filesystem::assertWritable(string) called at [<phutil>/src/filesystem/Filesystem.php:650]
  #1 <#2> Filesystem::createDirectory(string, integer, boolean) called at [<phutil>/src/filesystem/Filesystem.php:645]
  #2 <#2> Filesystem::createDirectory(string, integer, boolean) called at [<phutil>/src/filesystem/PhutilDeferredLog.php:184]
  #3 <#2> PhutilDeferredLog::__destruct()
  #4 phlog(FilesystemException) called at [<phutil>/src/filesystem/PhutilDeferredLog.php:201]
  #5 PhutilDeferredLog::write() called at [<phutil>/src/filesystem/PhutilDeferredLog.php:155]
  #6 PhutilDeferredLog::__destruct()```

Can anyone tell what system user or part of Phabricator (git, phd, etc.) is trying to write to a log so that I can provide the necessary permissions to the correct user?

#2

This should be the user git in your system.


#3

Ok, great. Providing the ‘git’ user with access all the way to the log file got me almost “there”. It seems something else wants to actually do the writing, though.

{"result":"lti.linguisticteam.org","error_code":null,"error_info":null}
[2018-06-29 22:37:06] EXCEPTION: (Exception) Unable to write to logfile "/var/log/httpd/dev/lab/lab-ssh.log"! at [<phutil>/src/filesystem/PhutilDeferredLog.php:193]
arcanist(head=master, ref.master=d581c453b83c), phabricator(head=master, ref.master=5bcca675e1c7), phutil(head=master, ref.master=20eff1c8d14f)
  #0 <#2> PhutilDeferredLog::__destruct()
  #1 phlog(Exception) called at [<phutil>/src/filesystem/PhutilDeferredLog.php:201]
  #2 PhutilDeferredLog::write() called at [<phutil>/src/filesystem/PhutilDeferredLog.php:155]
  #3 PhutilDeferredLog::__destruct()

Standard perms: (please note that I also tried the apache user, just in case.)

$ ll /var/log/httpd/dev/lab/lab-ssh.log
-rw-**rw**-r--+ 1 root **git** 0 Jun 29 21:02 /var/log/httpd/dev/lab/lab-ssh.log

Add’l acls:

$ getfacl /var/log/httpd/dev/lab/lab-ssh.log
getfacl: Removing leading '/' from absolute path names
# file: var/log/httpd/dev/lab/lab-ssh.log
# owner: root
# group: **git**
user::rw-
user:phab:rwx                   #effective:rw-
group::r-x                      #effective:r--
mask::rw-
other::r--

So I’m still a bit baffled here.


#4

Ok, it’s now working.
It seems the ‘effective:r–’ for group in the acl caused git to not have write perms, even though they are declared in the standard perms. I added an acl for git as user, and the traceback went away.

Thanks for your time, Avivey, and for the initial pointer that helped me work it out.