phundament / app

Dockerized Yii2 web application base
http://phundament.com
Other
310 stars 129 forks source link

make dev crashes at Detecting web service port of 'app': Couldn't get a file descriptor referring to the console #186

Closed lpanebr closed 8 years ago

lpanebr commented 8 years ago

After running make dev it seems to go well until the "Detecting web service port of 'app'" part where the error bellow appears:

Below is the shell output.

$ make dev
# --------------------------------------------
#
# Setting up database, schema and admin user (docker-compose.yml)
#   
docker-compose -p app -f docker-compose.yml \
        run --rm -e YII_ENV=dev appcli \
        sh -c '\
            /app/yii app/create-mysql-db && \
            sleep 1 && \
            /app/yii migrate --interactive=0 --migrationLookup=@app/migrations && \
            /app/yii app/setup-admin-user --interactive=0 \
        '
Starting app_mariadb_1...
Starting app_appfpm_1...
Starting app_appnginx_1...
Checking database connection on DSN 'mysql:host=172.17.0.2;port=3306' with user 'admin'. [OK]
Creating database 'dev-phundament-4' and granting permissions to user 'dev' on DSN 'mysql:host=172.17.0.2;port=3306' with user 'admin'
Array
(
    [0] => 00000
    [1] => 
    [2] => 
)
Yii Migration Tool (based on Yii v2.0.6)

Database Connection: mysql:host=172.17.0.2;port=3306;dbname=dev-phundament-4

Lookup:
    @app/migrations (/app/src/migrations)
    @app/migrations (/app/src/migrations)
    @yii/rbac/migrations (/app/vendor/yiisoft/yii2/rbac/migrations)
    @dektrium/user/migrations (/app/vendor/dektrium/yii2-user/migrations)
    @vendor/lajax/yii2-translate-manager/migrations (/app/src/../vendor/lajax/yii2-translate-manager/migrations)
    @vendor/dmstr/yii2-pages-module/migrations (/app/src/../vendor/dmstr/yii2-pages-module/migrations)

No new migration found. Your system is up-to-date.

Running action 'user/confirm'...
User has been confirmed
Removing app_appcli_run_1...
#
# Creating app 'app' (detached mode)
#
docker-compose -p app -f docker-compose.yml up -d --no-recreate \
        appnginx
make[1]: Entering directory `/home/lpanebr/Dropbox/docker/yii-phundament/app'
#
# Detecting web service port of 'app'
#
docker-compose  -p app -f docker-compose.yml port appnginx 80 | sed 's/[0-9.]*://'
32769
open http://:`docker-compose -p app -f docker-compose.yml port appnginx 80 | sed 's/[0-9.]*://'`
Couldn't get a file descriptor referring to the console
make[1]: *** [docker-open] Error 1
make[1]: Leaving directory `/home/lpanebr/Dropbox/docker/yii-phundament/app'
make: *** [docker-open] Error 2
lpanebr commented 8 years ago

hmmm... I just runned the command below and discovered that the error probably happens because the output is:

0.0.0.0:32769

and now I can use the app at:

http://0.0.0.0:32769

schmunk42 commented 8 years ago

Thanks for reporting.

What's your host system? We've only tested the open commands on OS X.

The Makefile uses ENV variable DOCKER_HOST and the detected web-server port.

lpanebr commented 8 years ago

Ubuntu 14.04

sum1190 commented 8 years ago

I think that the equivalent open command for Ubuntu is xdg-open

schmunk42 commented 8 years ago

@sum1190 Thank you. @lpanebr Simply adjust the Makefile in your project.

Please note that we made a huge cleanup of the Makefile stuff for the next release, see also https://github.com/phundament/app/blob/feature/one-cleanup/Makefile

schmunk42 commented 8 years ago

This is the current approach to detect OS X or Linux https://github.com/phundament/app/blob/d37052518e3a9787e3ddab305617787c066fdcbb/Makefile#L13-L20

Would be nice, if you could let me know if this works for you ... can still be improved.