You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 25, 2019. It is now read-only.
I have a mysql db running on docker (name: mysql). When I try to start the phabricator container with: docker run \ --rm -p 80:80 -p 443:443 -p 3306:3306 \ --env PHABRICATOR_HOST=localhost \ --env MYSQL_HOST=mysql \ --env MYSQL_USER=phabricator \ --env MYSQL_PASS=secretpassword \ --link mysql:mysql \ --env PHABRICATOR_REPOSITORY_PATH=/repos \ -v /host/repo/path:/repos \ hachque/phabricator
I receive the following error:
[2016-12-13 11:40:23] ERROR 2: mysqli::set_charset(): invalid object or resource mysqli
at [/srv/phabricator/libphutil/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php:81]
arcanist(head=master, ref.master=fad85844314b), phabricator(head=master, ref.master=776a1f3aec35), phutil(head=master, ref.master=5ac2ca121489)
#0 mysqli::set_charset(string) called at [/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php:81] #1 AphrontMySQLiDatabaseConnection::connect() called at [/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:101] #2 AphrontBaseMySQLDatabaseConnection::establishConnection() called at [/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:124] #3 AphrontBaseMySQLDatabaseConnection::requireConnection() called at [/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:31] #4 AphrontBaseMySQLDatabaseConnection::openConnection() called at [/src/infrastructure/cluster/PhabricatorDatabaseRef.php:456] #5 PhabricatorDatabaseRef::isReachable(AphrontMySQLiDatabaseConnection) called at [/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php:85] #6 PhabricatorLiskDAO::newClusterConnection(string, string, string) called at [/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php:66] #7 PhabricatorLiskDAO::establishLiveConnection(string) called at [/src/infrastructure/storage/lisk/LiskDAO.php:1008] #8 LiskDAO::establishConnection(string) called at [/src/infrastructure/storage/lisk/LiskDAO.php:516] #9 LiskDAO::loadRawDataWhere(string, string) #10 call_user_func_array(array, array) called at [/src/infrastructure/storage/lisk/LiskDAO.php:476] #11 LiskDAO::loadAllWhere(string, string) called at [/src/infrastructure/env/PhabricatorConfigDatabaseSource.php:19] #12 PhabricatorConfigDatabaseSource::loadConfig(string) called at [/src/infrastructure/env/PhabricatorConfigDatabaseSource.php:7] #13 PhabricatorConfigDatabaseSource::__construct(string) called at [/src/infrastructure/env/PhabricatorEnv.php:249] #14 PhabricatorEnv::buildConfigurationSourceStack(boolean) called at [/src/infrastructure/env/PhabricatorEnv.php:95] #15 PhabricatorEnv::initializeCommonEnvironment(boolean) called at [/src/infrastructure/env/PhabricatorEnv.php:75] #16 PhabricatorEnv::initializeScriptEnvironment(boolean) called at [/scripts/init/lib.php:22] #17 init_phabricator_script(array) called at [/scripts/init/init-setup.php:12] #18 require_once(string) called at [/scripts/setup/manage_config.php:5]
[2016-12-13 11:40:23] ERROR 2: mysqli::escape_string(): invalid object or resource mysqli
at [/srv/phabricator/libphutil/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php:15]
arcanist(head=master, ref.master=fad85844314b), phabricator(head=master, ref.master=776a1f3aec35), phutil(head=master, ref.master=5ac2ca121489)
#0 mysqli::escape_string(string) called at [/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php:15] #1 AphrontMySQLiDatabaseConnection::escapeBinaryString(string) called at [/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php:11] #2 AphrontMySQLiDatabaseConnection::escapeUTF8String(string) called at [/src/xsprintf/qsprintf.php:178] #3 xsprintf_query(AphrontMySQLiDatabaseConnection, string, integer, string, integer) called at [/src/xsprintf/xsprintf.php:70] #4 xsprintf(string, AphrontMySQLiDatabaseConnection, array) called at [/src/xsprintf/qsprintf.php:64] #5 qsprintf(AphrontMySQLiDatabaseConnection, string, string, string, string) #6 call_user_func_array(string, array) called at [/src/xsprintf/queryfx.php:5] #7 queryfx(AphrontMySQLiDatabaseConnection, string, string, string, string) #8 call_user_func_array(string, array) called at [/src/xsprintf/queryfx.php:13] #9 queryfx_all(AphrontMySQLiDatabaseConnection, string, string, string, string) #10 call_user_func_array(string, array) called at [/src/aphront/storage/connection/AphrontDatabaseConnection.php:52] #11 AphrontDatabaseConnection::queryData(string, string, string, string) #12 call_user_func_array(array, array) called at [/src/infrastructure/storage/lisk/LiskDAO.php:535] #13 LiskDAO::loadRawDataWhere(string, string) #14 call_user_func_array(array, array) called at [/src/infrastructure/storage/lisk/LiskDAO.php:476] #15 LiskDAO::loadAllWhere(string, string) called at [/src/infrastructure/env/PhabricatorConfigDatabaseSource.php:19] #16 PhabricatorConfigDatabaseSource::loadConfig(string) called at [/src/infrastructure/env/PhabricatorConfigDatabaseSource.php:7] #17 PhabricatorConfigDatabaseSource::__construct(string) called at [/src/infrastructure/env/PhabricatorEnv.php:249] #18 PhabricatorEnv::buildConfigurationSourceStack(boolean) called at [/src/infrastructure/env/PhabricatorEnv.php:95] #19 PhabricatorEnv::initializeCommonEnvironment(boolean) called at [/src/infrastructure/env/PhabricatorEnv.php:75] #20 PhabricatorEnv::initializeScriptEnvironment(boolean) called at [/scripts/init/lib.php:22] #21 init_phabricator_script(array) called at [/scripts/init/init-setup.php:12] #22 require_once(string) called at [/scripts/setup/manage_config.php:5]
[2016-12-13 11:40:23] EXCEPTION: (AphrontQueryException) #0: at [/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:355]
arcanist(head=master, ref.master=fad85844314b), phabricator(head=master, ref.master=776a1f3aec35), phutil(head=master, ref.master=5ac2ca121489)
#0 AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:289] #1 AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:185] #2 AphrontBaseMySQLDatabaseConnection::executeRawQuery(string) called at [/src/xsprintf/queryfx.php:8] #3 queryfx(AphrontMySQLiDatabaseConnection, string, string, string, string) #4 call_user_func_array(string, array) called at [/src/xsprintf/queryfx.php:13] #5 queryfx_all(AphrontMySQLiDatabaseConnection, string, string, string, string) #6 call_user_func_array(string, array) called at [/src/aphront/storage/connection/AphrontDatabaseConnection.php:52] #7 AphrontDatabaseConnection::queryData(string, string, string, string) #8 call_user_func_array(array, array) called at [/src/infrastructure/storage/lisk/LiskDAO.php:535] #9 LiskDAO::loadRawDataWhere(string, string) #10 call_user_func_array(array, array) called at [/src/infrastructure/storage/lisk/LiskDAO.php:476] #11 LiskDAO::loadAllWhere(string, string) called at [/src/infrastructure/env/PhabricatorConfigDatabaseSource.php:19] #12 PhabricatorConfigDatabaseSource::loadConfig(string) called at [/src/infrastructure/env/PhabricatorConfigDatabaseSource.php:7] #13 PhabricatorConfigDatabaseSource::__construct(string) called at [/src/infrastructure/env/PhabricatorEnv.php:249] #14 PhabricatorEnv::buildConfigurationSourceStack(boolean) called at [/src/infrastructure/env/PhabricatorEnv.php:95] #15 PhabricatorEnv::initializeCommonEnvironment(boolean) called at [/src/infrastructure/env/PhabricatorEnv.php:75] #16 PhabricatorEnv::initializeScriptEnvironment(boolean) called at [/scripts/init/lib.php:22] #17 init_phabricator_script(array) called at [/scripts/init/init-setup.php:12] #18 require_once(string) called at [/scripts/setup/manage_config.php:5]
[ FAILED ] /etc/init.simple/10-boot-conf
The text was updated successfully, but these errors were encountered:
My initial guess is that this has something to do with the MySQL instance you are connecting to.
The stack trace looks like a bug in upstream code. This Docker container doesn't change how Phabricator itself connects to MySQL, we just configure it based on environment variables. The docker run command looks fine to me.
You should try to replicate the environment as close as possible, including getting the Phabricator you set up manually to connect to the same MySQL instance that you are trying to connect this container to.
Set up mysql container to expose the ports on the outside: docker run -p 93306:3306 --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql
and set phabricator container to use it:
I just ran into this during testing. It's because --link mysql causes MYSQL_PORT to be set to something silly like tcp://...:3306/, because of the link name.
We expect MYSQL_PORT to either empty or to have an integer (like 3306) in it. I'm going to add a startup check to make this failure more clear as to the issue it causes.
Hi,
(DAU question incoming, I'm new to docker)
I have a mysql db running on docker (name: mysql). When I try to start the phabricator container with:
docker run \ --rm -p 80:80 -p 443:443 -p 3306:3306 \ --env PHABRICATOR_HOST=localhost \ --env MYSQL_HOST=mysql \ --env MYSQL_USER=phabricator \ --env MYSQL_PASS=secretpassword \ --link mysql:mysql \ --env PHABRICATOR_REPOSITORY_PATH=/repos \ -v /host/repo/path:/repos \ hachque/phabricator
I receive the following error:
The text was updated successfully, but these errors were encountered: