Page MenuHomePhabricator

Commit hook in Phabricator has not PHABRICATOR_ENV and tries to login in mysql as root without a password
Closed, ResolvedPublic

Description

when i try to push into my git repo (through the file protocol, like /home/user/www/phabricator/repo/TEST) - Phabricator's commit hook throws the exception with message:

remote: [2014-02-24 12:08:17] EXCEPTION: (AphrontQueryConnectionException) Attempt to connect to root@localhost failed with error #1045: Access denied for user 'root'@'localhost' (using password: NO). at [/home/user/www/phabricator/libphutil/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php:62]

I use root:123123@localhost in my config and web application runs well.

There is no PHABRICATOR_ENV in getSelectedEnvironmentName method (class PhabricatorEnv) and it doesn't use needed config file.

Event Timeline

Great-Antique raised the priority of this task from to Needs Triage.
Great-Antique updated the task description. (Show Details)

The easiest fix is to write the environment name into this file:

phabricator/conf/local/ENVIRONMENT

For example, if you normally set PHABRICATOR_ENV=custom/example, you could write the value like this:

phabricator/ $ echo custom/example > conf/local/ENVIRONMENT

Phabricator will look in this file if PHABRICATOR_ENV is not defined.

We might try to propagate PHABRICATOR_ENV more broadly in the future, but it's now considered an advanced feature (after we introduced database configuration) and few installs still rely on it.

epriestley, thank you! this problem is solved, but i have a new one.

remote: [2014-02-25 12:12:50] EXCEPTION: (Exception) usage: PHABRICATOR_USER should be defined! at [/home/user/www/phabricator/phabricator/scripts/repository/commit_hook.php:36]

and i think that some another variables is not defined.

so i think that i need to stop testing in that way and configure access to my repo through web server.

Please, close this issue and thank you for help

epriestley claimed this task.
This comment was removed by epriestley.