Page MenuHomePhabricator

HHVM looks for config in /usr/etc/hhvm rather than /etc/hhvm
Closed, ResolvedPublic

Description

Our puppet config expects hhvm config files to be looked up in /etc/hhhvm but the latest build () is looking in /usr/etc/hhvm instead.

strace hhvm hello.php shows:

access("/usr/etc/hhvm/php.ini", R_OK)   = -1 ENOENT (No such file or directory)
access("/usr/etc/hhvm/config.hdf", R_OK) = -1 ENOENT (No such file or directory)

This is causing the jobrunner to fail with this error in MediaWiki-Vagrant:

Failed to initialize central HHBC repository:
  Failed to open /var/www/.hhvm.hhbc: 14 - unable to open database file

This is because our config files aren't being read. It will probably break the production jobrunner in a similar way.


Version: wmf-deployment
Severity: normal

Details

Reference
bz71343

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:59 AM
bzimport set Reference to bz71343.

Partially fixed in 3.3.0-20140925+wmf2:

$ strace php hello.php 2>&1 | grep '/etc/hhvm'
access("/etc/hhvm/php.ini", R_OK) = 0
access("/etc/hhvm/config.hdf", R_OK) = 0
open("/etc/hhvm/php.ini", O_RDONLY) = 4
stat("/etc/hhvm/config.hdf", {st_mode=S_IFREG|0644, st_size=139, ...}) = 0
open("/etc/hhvm/config.hdf", O_RDONLY) = 4
open("/etc/hhvm/php.ini", O_RDONLY) = 4
open("/etc/hhvm/config.hdf", O_RDONLY) = 4
open("/etc/hhvm/php.ini", O_RDONLY) = 7
open("/etc/hhvm/config.hdf", O_RDONLY) = 7

$ strace hhvm hello.php 2>&1 | grep '/etc/hhvm'
access("/usr/etc/hhvm/php.ini", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/etc/hhvm/config.hdf", R_OK) = -1 ENOENT (No such file or directory)

In this test, php id /usr/bin/php -> /etc/alternatives/php -> /usr/bin/hhvm

This should be enough to fix the jobrunner, but is still not completely optimal.

Retested with hhvm build 3.3.0+dfsg1-1+wm1:

$ strace php hello.php 2>&1 | grep '/etc/hhvm'
access("/etc/hhvm/php.ini", R_OK) = 0
access("/etc/hhvm/config.hdf", R_OK) = 0
open("/etc/hhvm/php.ini", O_RDONLY) = 4
stat("/etc/hhvm/config.hdf", {st_mode=S_IFREG|0644, st_size=139, ...}) = 0
open("/etc/hhvm/config.hdf", O_RDONLY) = 4
open("/etc/hhvm/php.ini", O_RDONLY) = 4
open("/etc/hhvm/config.hdf", O_RDONLY) = 4
open("/etc/hhvm/php.ini", O_RDONLY) = 8
open("/etc/hhvm/config.hdf", O_RDONLY) = 8

$ strace hhvm hello.php 2>&1 | grep '/etc/hhvm'
access("/etc/hhvm/php.ini", R_OK) = 0
access("/etc/hhvm/config.hdf", R_OK) = 0
open("/etc/hhvm/php.ini", O_RDONLY) = 4
stat("/etc/hhvm/config.hdf", {st_mode=S_IFREG|0644, st_size=139, ...}) = 0
open("/etc/hhvm/config.hdf", O_RDONLY) = 4
open("/etc/hhvm/php.ini", O_RDONLY) = 4
open("/etc/hhvm/config.hdf", O_RDONLY) = 4
open("/etc/hhvm/php.ini", O_RDONLY) = 8
open("/etc/hhvm/config.hdf", O_RDONLY) = 8