RedpointArchive / phabricator

A Docker image that runs Phabricator, an open source software engineering tool
https://hub.docker.com/r/redpointgames/phabricator/
307 stars 98 forks source link

Not able to install with docker #56

Closed bhargavjoshi closed 7 years ago

bhargavjoshi commented 7 years ago

Sorry I am just getting started to learn docker,

I am using docker-compose, I don't know what I am doing wrong, here is my docker file.

version: '2'
services:
  phabricator:
    restart: always
    ports:
     - "62443:443"
     - "62080:80"
     - "62022:22"
    volumes:
     - /srv/docker/phabricator/repos:/repos
     - /srv/docker/phabricator/extensions:/srv/phabricator/phabricator/src/extensions
     - /srv/docker/phabricator/sshkeys:/sshkeys
     - /srv/docker/phabricator/filestore:/filestore
    depends_on:
     - mysql
    links:
     - mysql
    environment:
     - MYSQL_LINKED_CONTAINER=mysql
     - PHABRICATOR_REPOSITORY_PATH=/repos
     - PHABRICATOR_HOST_KEYS_PATH=/sshkeys
     - PHABRICATOR_HOST=myhost
     - SSL_TYPE=letsencrypt
     - SSL_EMAIL='myemail'
     - PHABRICATOR_STORAGE_TYPE=disk
     - PHABRICATOR_STORAGE_PATH=/filestore
    image: hachque/phabricator
  mysql:
    restart: always
    volumes:
     - /srv/docker/phabricator/mysql:/var/lib/mysql
    image: mysql:5.7.14
    environment:
     - MYSQL_RANDOM_ROOT_PASSWORD=yes
     - MYSQL_USER=phabricator
     - MYSQL_PASSWORD=phabricator

Here is the error messages I am getting

ubuntu@phabricator:~/phabricator$ sudo docker-compose up
Creating phabricator_mysql_1
Creating phabricator_phabricator_1
Attaching to phabricator_mysql_1, phabricator_phabricator_1
mysql_1        | Initializing database
phabricator_1  | [ STARTING ] /etc/init.simple/10-boot-conf
phabricator_1  | + '[' -f /baked ']'
phabricator_1  | + '[' mysql '!=' '' ']'
phabricator_1  | + MYSQL_HOST_VARIABLE=mysql_PORT_3306_TCP_ADDR
phabricator_1  | + MYSQL_HOST=
phabricator_1  | + MYSQL_PORT_VARIABLE=mysql_PORT_3306_TCP_PORT
phabricator_1  | + MYSQL_PORT=
phabricator_1  | + unset MYSQL_HOST_VARIABLE
phabricator_1  | + unset MYSQL_PORT_VARIABLE
phabricator_1  | + '[' '' == '' ']'
phabricator_1  | + MYSQL_STORAGE_NAMESPACE=phabricator
phabricator_1  | + '[' letsencrypt == '' ']'
phabricator_1  | + '[' '' == '' ']'
phabricator_1  | + PHABRICATOR_VCS_USER=git
phabricator_1  | + '[' '' == '' ']'
phabricator_1  | + PHABRICATOR_STORAGE_TYPE=mysql
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' -f /config/script.pre ']'
phabricator_1  | + '[' -f /config/script.premig ']'
phabricator_1  | + '[' -f /config/script.post ']'
phabricator_1  | + '[' -f /config/script.phd ']'
phabricator_1  | + '[' -f /config/script.letsencrypt ']'
phabricator_1  | + '[' -f /config/letsencrypt.config ']'
phabricator_1  | + '[' -d /config/keycache ']'
phabricator_1  | + cat
phabricator_1  | + source /config.saved
phabricator_1  | ++ OVERRIDE_PHABRICATOR_URI=
phabricator_1  | ++ OVERRIDE_PHABRICATOR_BRANCH=
phabricator_1  | ++ OVERRIDE_ARCANIST_URI=
phabricator_1  | ++ OVERRIDE_ARCANIST_BRANCH=
phabricator_1  | ++ OVERRIDE_LIBPHUTIL_URI=
phabricator_1  | ++ OVERRIDE_LIBPHUTIL_BRANCH=
phabricator_1  | ++ PHABRICATOR_HOST=example.com
phabricator_1  | ++ PHABRICATOR_CDN=
phabricator_1  | ++ PHABRICATOR_REPOSITORY_PATH=/repos
phabricator_1  | ++ PHABRICATOR_STORAGE_TYPE=mysql
phabricator_1  | ++ PHABRICATOR_STORAGE_PATH=/filestore
phabricator_1  | ++ PHABRICATOR_STORAGE_BUCKET=
phabricator_1  | ++ PHABRICATOR_VCS_USER=git
phabricator_1  | ++ PHABRICATOR_VCS_PORT=
phabricator_1  | ++ PHABRICATOR_HOST_KEYS_PATH=/sshkeys
phabricator_1  | ++ AWS_S3_ACCESS_KEY=
phabricator_1  | ++ AWS_S3_SECRET_KEY=
phabricator_1  | ++ MYSQL_HOST=
phabricator_1  | ++ MYSQL_PORT=
phabricator_1  | ++ MYSQL_USER=
phabricator_1  | ++ MYSQL_PASS=
phabricator_1  | ++ MYSQL_STORAGE_NAMESPACE=phabricator
phabricator_1  | ++ ENABLE_APCU=
phabricator_1  | ++ ENABLE_UPDATE_ON_START=
phabricator_1  | ++ SSL_TYPE=letsencrypt
phabricator_1  | ++ SSL_CERTIFICATE=
phabricator_1  | ++ SSL_PRIVATE_KEY=
phabricator_1  | ++ SSL_EMAIL=''\''myemail'\'''
phabricator_1  | ++ SCRIPT_BEFORE_UPDATE=
phabricator_1  | ++ SCRIPT_BEFORE_MIGRATION=
phabricator_1  | ++ SCRIPT_AFTER_MIGRATION=
phabricator_1  | ++ SCRIPT_AFTER_LETS_ENCRYPT=
phabricator_1  | ++ SCRIPT_BEFORE_DAEMONS=
phabricator_1  | ++ SCRIPT_AFTER_DAEMONS=
phabricator_1  | + sed -i s/PHABRICATOR/git/g /etc/passwd
phabricator_1  | + sed s/__PHABRICATOR_VCS_USER__/git/g /etc/phabricator-ssh/sshd_config.phabricator.template
phabricator_1  | + sed s/__PHABRICATOR_VCS_USER__/git/g /etc/phabricator-ssh/phabricator-ssh-hook.sh.template
phabricator_1  | + sed s/__PHABRICATOR_VCS_USER__/git/g /etc/php5/fpm/php-fpm.conf.template
phabricator_1  | + chmod 755 /etc/phabricator-ssh/phabricator-ssh-hook.sh
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' '' == true ']'
phabricator_1  | + pushd /srv/phabricator/phabricator
phabricator_1  | /srv/phabricator/phabricator /
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' phabricator '!=' '' ']'
phabricator_1  | + sudo -u git ./bin/config set storage.default-namespace phabricator
phabricator_1  | Set 'storage.default-namespace' in local configuration.
phabricator_1  | + '[' example.com '!=' '' ']'
phabricator_1  | + '[' letsencrypt == none ']'
phabricator_1  | + sudo -u git ./bin/config set phabricator.base-uri example.com
phabricator_1  | Set 'phabricator.base-uri' in local configuration.
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + sudo -u git ./bin/config set phd.user git
phabricator_1  | Set 'phd.user' in local configuration.
phabricator_1  | + sudo -u git ./bin/config set pygments.enabled true
phabricator_1  | Set 'pygments.enabled' in local configuration.
phabricator_1  | + '[' /repos '!=' '' ']'
phabricator_1  | + sudo -u git ./bin/config set repository.default-local-path /repos
phabricator_1  | Set 'repository.default-local-path' in local configuration.
phabricator_1  | + '[' mysql == mysql ']'
phabricator_1  | + sudo -u git ./bin/config set storage.mysql-engine.max-size 67108864
mysql_1        | Database initialized
mysql_1        | MySQL init process in progress...
phabricator_1  | Set 'storage.mysql-engine.max-size' in local configuration.
phabricator_1  | + '[' mysql == disk ']'
phabricator_1  | + '[' mysql == s3 ']'
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + '[' letsencrypt == none ']'
phabricator_1  | + APHLICT_PROTOCOL=https
phabricator_1  | + APHLICT_PORT=443
phabricator_1  | + sudo -u git ./bin/config set notification.servers '[{"type": "client","host": "example.com","port": 443,"protocol": "https","path": "/ws/"},{"type": "admin","host": "127.0.0.1","port": 22281,"protocol": "http"}]'
phabricator_1  | Set 'notification.servers' in local configuration.
phabricator_1  | + unset APHLICT_PROTOCOL
phabricator_1  | + unset APHLICT_PORT
phabricator_1  | + popd
phabricator_1  | /
phabricator_1  | + '[' '' == true ']'
phabricator_1  | + '[' '' '!=' '' ']'
phabricator_1  | + mysqlcheck --host= --port= --user= --password= --databases phabricator_search
phabricator_1  | mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory") when trying to connect
phabricator_1  | + true
phabricator_1  | + /srv/phabricator/phabricator/bin/storage upgrade --force
phabricator_1  | MySQL Credentials Not Configured
phabricator_1  |
phabricator_1  | Unable to connect to MySQL using the configured credentials. You must
phabricator_1  | configure standard credentials before you can upgrade storage. Run these
phabricator_1  | commands to set up credentials:
phabricator_1  |
phabricator_1  |   phabricator/ $ ./bin/config set mysql.host __host__
phabricator_1  |   phabricator/ $ ./bin/config set mysql.user __username__
phabricator_1  |   phabricator/ $ ./bin/config set mysql.pass __password__
phabricator_1  |
phabricator_1  | These standard credentials are separate from any administrative credentials
phabricator_1  | provided to this command with __--user__ or __--password__, and must be
phabricator_1  | configured correctly before you can proceed.
phabricator_1  |
phabricator_1  | Raw MySQL Error: Attempt to connect to root@localhost failed with error
phabricator_1  | #2002: No such file or directory.
phabricator_1  | [ FAILED ] /etc/init.simple/10-boot-conf
mysql_1        | Warning: Unable to load '/usr/share/zoneinfo/Factory' as time zone. Skipping it.
mysql_1        | Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
mysql_1        | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
mysql_1        | Warning: Unable to load '/usr/share/zoneinfo/posix/Factory' as time zone. Skipping it.
mysql_1        | Warning: Unable to load '/usr/share/zoneinfo/right/Factory' as time zone. Skipping it.
phabricator_phabricator_1 exited with code 1
rswhiting commented 7 years ago

It looks like you don't have MYSQL_USER=phabricator or MYSQL_PASSWORD=phabricator in the phabricator section of your config. Note this line in the output:

phabricator_1  | + mysqlcheck --host= --port= --user= --password= --databases phabricator_search
phabricator_1  | mysqlcheck: Got error: 2002: Can't connect to local MySQL server...

I think this case is still relevant though, because I'm getting the same error with this configuration:

version: '2'
services:
  phabricator:
    ports:
     - "62443:443"
     - "62080:80"
     - "62022:22"
    depends_on:
     - mysql
    links:
     - mysql
    environment:
     - MYSQL_LINKED_CONTAINER=mysql
     - MYSQL_USER=phabricator
     - MYSQL_PASS=phabricator
    image: hachque/phabricator
  mysql:
    volumes:
     - /mnt/docker/phabricator/mysql:/var/lib/mysql
    image: mysql:5.7.16
    environment:
     - MYSQL_RANDOM_ROOT_PASSWORD=yes
     - MYSQL_USER=phabricator
     - MYSQL_PASSWORD=phabricator

with this error

phabricator_1  | + mysqlcheck --host= --port= --user=phabricator --password=phabricator --databases phabricator_search
phabricator_1  | mysqlcheck: Got error: 2002: Can't connect to local MySQL server 

It looks like the MYSQL_LINKED_CONTAINER isn't functioning as expected.

bhargavjoshi commented 7 years ago

I added this

   - MYSQL_USER=phabricator
   - MYSQL_PASS=phabricator

Still getting the following error, does it still requires host and port?

If so what should be the value?

mysqlcheck --host= --port= --user=phabricator --password=phabricator --databases phabricator_search
phabricator_1  | mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory") when trying to connect
phabricator_1  | + true
rswhiting commented 7 years ago

I don't know. I have the same problem. MYSQL_LINKED_CONTAINER=mysql should fill in the host and port automatically, but it's not. If someone more knowledgeable about this project doesn't look at it, I'll start poking around in the source.

hach-que commented 7 years ago

I think this is because the version of Docker you have no longer exposes linked container environment variables. I was under the impression that someone had sent a fix through so that MYSQL_LINKED_CONTAINER did the right thing on newer versions of Docker, but it looks like that hasn't happened.

On newer versions of Docker you can just do MYSQL_HOST=linkedcontainername and Docker's internal DNS should resolve it (in the Docker compose case I think it would be mysql).

hach-que commented 7 years ago

I pushed a potential fix here: https://github.com/hach-que-docker/phabricator/tree/untested-fix.

Can someone using Docker compose or otherwise having issues with MYSQL_LINKED_CONTAINER run docker build . -t local-phabricator in that branch, then test starting local-phabricator with the MYSQL_LINKED_CONTAINER variable on a their version of Docker to see if it resolves the issue?

bhargavjoshi commented 7 years ago

Tested it, I am still getting the same error. Here is a snippet

+ mysqlcheck --host= --port= --user= --password= --databases phabricator_search
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory") when trying to connect
+ true
+ /srv/phabricator/phabricator/bin/storage upgrade --force
MySQL Credentials Not Configured

Unable to connect to MySQL using the configured credentials. You must
configure standard credentials before you can upgrade storage. Run these
commands to set up credentials:

  phabricator/ $ ./bin/config set mysql.host __host__
  phabricator/ $ ./bin/config set mysql.user __username__
  phabricator/ $ ./bin/config set mysql.pass __password__

These standard credentials are separate from any administrative credentials
provided to this command with __--user__ or __--password__, and must be
configured correctly before you can proceed.

Raw MySQL Error: Attempt to connect to root@localhost failed with error
#2002: No such file or directory.
[ FAILED ] /etc/init.simple/10-boot-conf
hach-que commented 7 years ago

Does it work if you just replace MYSQL_LINKED_CONTAINER with MYSQL_HOST?

On Thu., 10 Nov. 2016, 6:35 am bhargavjoshi, notifications@github.com wrote:

Tested it, I am still getting the same error. Here is a snippet

  • mysqlcheck --host= --port= --user= --password= --databases phabricator_search mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory") when trying to connect
  • true
  • /srv/phabricator/phabricator/bin/storage upgrade --force MySQL Credentials Not Configured

Unable to connect to MySQL using the configured credentials. You must configure standard credentials before you can upgrade storage. Run these commands to set up credentials:

phabricator/ $ ./bin/config set mysql.host host phabricator/ $ ./bin/config set mysql.user username phabricator/ $ ./bin/config set mysql.pass password

These standard credentials are separate from any administrative credentials provided to this command with --user or --password, and must be configured correctly before you can proceed.

Raw MySQL Error: Attempt to connect to root@localhost failed with error

2002: No such file or directory.

[ FAILED ] /etc/init.simple/10-boot-conf

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/hach-que-docker/phabricator/issues/56#issuecomment-259504704, or mute the thread https://github.com/notifications/unsubscribe-auth/AAez-hq1ghta0P74yspTo3_pPYo-cm_pks5q8iBigaJpZM4Kpq24 .

rswhiting commented 7 years ago

The untested-fix branch errors out because I don't seem to have preflight.

Replacing MYSQL_LINKED_CONTAINER with MYSQL_HOST results in an access denied which is progress, I think.

phabricator_1  | + '[' '' == true ']'
phabricator_1  | + pushd /srv/phabricator/phabricator
phabricator_1  | + '[' mysql '!=' '' ']'
phabricator_1  | + sudo -u git ./bin/config set mysql.host mysql
phabricator_1  | [2016-11-10 05:29:05] EXCEPTION: (AphrontAccessDeniedQueryException) #1044: Access denied for user 'phabricator'@'%' to database 'phabricator_config' at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:319]
phabricator_1  | arcanist(head=master, ref.master=fad85844314b), phabricator(head=master, ref.master=e9b861ff1583), phutil(head=master, ref.master=2b7b1007bf87)
phabricator_1  |   #0 AphrontBaseMySQLDatabaseConnection::throwCommonException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:334]
phabricator_1  |   #1 AphrontBaseMySQLDatabaseConnection::throwConnectionException(integer, string, string, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php:76]
phabricator_1  |   #2 AphrontMySQLiDatabaseConnection::connect() called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:101]
phabricator_1  |   #3 AphrontBaseMySQLDatabaseConnection::establishConnection() called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:124]
phabricator_1  |   #4 AphrontBaseMySQLDatabaseConnection::requireConnection() called at [<phutil>/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php:15]
phabricator_1  |   #5 AphrontMySQLiDatabaseConnection::escapeBinaryString(string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php:11]
phabricator_1  |   #6 AphrontMySQLiDatabaseConnection::escapeUTF8String(string) called at [<phutil>/src/xsprintf/qsprintf.php:178]
phabricator_1  |   #7 xsprintf_query(AphrontMySQLiDatabaseConnection, string, integer, string, integer) called at [<phutil>/src/xsprintf/xsprintf.php:70]
phabricator_1  |   #8 xsprintf(string, AphrontMySQLiDatabaseConnection, array) called at [<phutil>/src/xsprintf/qsprintf.php:64]
phabricator_1  |   #9 qsprintf(AphrontMySQLiDatabaseConnection, string, string, string, string)
phabricator_1  |   #10 call_user_func_array(string, array) called at [<phutil>/src/xsprintf/queryfx.php:5]
phabricator_1  |   #11 queryfx(AphrontMySQLiDatabaseConnection, string, string, string, string)
phabricator_1  |   #12 call_user_func_array(string, array) called at [<phutil>/src/xsprintf/queryfx.php:13]
phabricator_1  |   #13 queryfx_all(AphrontMySQLiDatabaseConnection, string, string, string, string)
phabricator_1  |   #14 call_user_func_array(string, array) called at [<phutil>/src/aphront/storage/connection/AphrontDatabaseConnection.php:52]
phabricator_1  |   #15 AphrontDatabaseConnection::queryData(string, string, string, string)
phabricator_1  |   #16 call_user_func_array(array, array) called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:535]
phabricator_1  |   #17 LiskDAO::loadRawDataWhere(string, string)
phabricator_1  |   #18 call_user_func_array(array, array) called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:476]
phabricator_1  |   #19 LiskDAO::loadAllWhere(string, string) called at [<phabricator>/src/infrastructure/env/PhabricatorConfigDatabaseSource.php:19]
phabricator_1  |   #20 PhabricatorConfigDatabaseSource::loadConfig(string) called at [<phabricator>/src/infrastructure/env/PhabricatorConfigDatabaseSource.php:7]
phabricator_1  |   #21 PhabricatorConfigDatabaseSource::__construct(string) called at [<phabricator>/src/infrastructure/env/PhabricatorEnv.php:238]
phabricator_1  |   #22 PhabricatorEnv::buildConfigurationSourceStack(boolean) called at [<phabricator>/src/infrastructure/env/PhabricatorEnv.php:95]
phabricator_1  |   #23 PhabricatorEnv::initializeCommonEnvironment(boolean) called at [<phabricator>/src/infrastructure/env/PhabricatorEnv.php:75]
phabricator_1  |   #24 PhabricatorEnv::initializeScriptEnvironment(boolean) called at [<phabricator>/scripts/init/lib.php:22]
phabricator_1  |   #25 init_phabricator_script(array) called at [<phabricator>/scripts/init/init-setup.php:12]
phabricator_1  |   #26 require_once(string) called at [<phabricator>/scripts/setup/manage_config.php:5]
phabricator_1  | [ FAILED ] /etc/init.simple/10-boot-conf
Gracefully stopping... (press Ctrl+C again to force)

I've run out of time today. I'll debug more tomorrow. Thanks for the help!

hach-que commented 7 years ago

Hmm, that just looks like a permission problem with the MySQL database itself - I mean it clearly has the username at this point (and presumably the password). Can you verify that you can connect to the database with those credentials?

rswhiting commented 7 years ago

I setup the mysql database as a docker container with a user/password in the env variables. I tried it using the root password, and it connected. Thanks for helping me through this, I guess it's a problem with how I'm using mysql user setup on initialization.

I don't know if @bhargavjoshi 's issue is resolved, but mine is.

orosellmet commented 7 years ago

Hi,

I had the same problem and I hacked it in a similar way. I entered into the mysql docker using "docker exec" and using root and command-line "mysql" I checked user table. User phabricator didn't have any privilege in there so I gave him all the privileges. After that I relaunched docker-compose and then it seems to work. Not sure what's the correct solution for the docker-compose file.

hach-que commented 7 years ago

Yeah, the Docker compose support was contributed by another person. I don't personally use Docker compose, so I can't offer much support beyond issues that affect the Phabricator container itself.

orosellmet commented 7 years ago

I was able to fix it by creating a new flavor of mysql:

FROM mysql:5.7.14
COPY grant_privileges.sql /docker-entrypoint-initdb.d

Where grant_privileges.sql has:

GRANT ALL PRIVILEGES ON * . * TO 'phabricator';

However, there is some problem when stopping and restarting the containers (docker-compose down; docker-compose up). Sometimes it just doesn't work complaining that it cannot find the mysql instance.

ghost commented 7 years ago

I got a little farther with fewer manual hacks, but I'm still stuck. I did the following:

sed -i 's/MYSQL_LINKED_CONTAINER/MYSQL_HOST/' docker-compose.yml
awk 'BEGIN {t=0}; { print }; /volumes:/ { t++; if ( t==2) { print "     - ./initdb:/docker-entrypoint-initdb.d" } }' docker-compose.yml > _
mv _ docker-compose.yml
mkdir initdb
cat > initdb/create_user.sql <<EOL
GRANT ALL PRIVILEGES ON * . * TO 'phabricator'@'%';
EOL

Maybe mysql isn't picking up the create_user.sql file; I'm now getting this (abbreviated) error, which at least feels like progress:

phabricator_1  | [2016-11-15 11:37:33] EXCEPTION: (AphrontAccessDeniedQueryException) #1044: Access denied for user 'phabricator'@'%' to database 'phabricator_config' at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:319]
phabricator_1  | arcanist(head=master, ref.master=fad85844314b), phabricator(head=master, ref.master=d5a72ca98ed2), phutil(head=master, ref.master=162c55d991df)
...
phabricator_1  |   #26 require_once(string) called at [<phabricator>/scripts/setup/manage_config.php:5]
phabricator_1  | [ FAILED ] /etc/init.simple/10-boot-conf
orosellmet commented 7 years ago

Hi,

You can try exactly my solution, using a new Dockerfile to build a mysql image derived from the original. That worked for me (although your solution looks basically the same as mine).

To debug your problem...

To check the privileges are OK just enter in the mysql docker:

 docker exec -it containerID env TERM=xterm bash

Note that containerID above has to be changed by the correct ID that "docker ps" will give you.

Once you're inside just use mysql directly:

mysql -u root -p

This will request you a password that is output by the screen when you first initialize the mysql container (and you have MYSQL_RANDOM_ROOT_PASSWORD=yes). You can also disable the RANDOM_ROOT_PASSWORD and force the MYSQL_ROOT_PASSWORD manually in the docker compose.

Once you're able to enter docker instance you can then check the user table inside mysql database.

mysql> use mysql;
mysql> SELECT * FROM user;

That should show you the privileges for all users, included phabricator (it should exist). If that shows basically N for everything then grant the privileges there.

mysql> GRANT ALL PRIVILEGES ON * . * TO 'phabricator';
mysql> SELECT * FROM user;

At this point it should show Y for basically everything. Stop the mysql, restart phabricator (docker-compose up) and check if you get further.

Hope this helps.

NOTE: To do the debug and modifications to the mysql instance I first commented out the whole phabricator section of the docker-compose file. Then the docker-compose up will just bring up the mysql. After the mysql container is modified you can reenable the phabricator part and the docker-compose up should use your already modified mysql container.

hach-que commented 7 years ago

After playing around with docker-compose for a bit, I pushed a fix for this issue. If you're still having trouble connecting, try deleting /srv/docker/phabricator/mysql (assuming you have no data you want to keep!), and everything should start up correctly when you do docker-compose up.