gabrielmoreira / craftman

Craft CMS Manager
MIT License
124 stars 11 forks source link

404 error during install #7

Closed hotdocs closed 8 years ago

hotdocs commented 8 years ago

I'm using OSX, but running the new Docker for Mac beta which should make the Docker interface identical to the Linux version. Of course "beta" and "should" are the key words in that sentence.

After a couple of failed tests I purged all my images and containers from my system:

''' Spazsquatch@MacBook-Pro:~$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE Spazsquatch@MacBook-Pro:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES '''

and set up a new folder to try craftman in

''' Spazsquatch@MacBook-Pro:~$ mkdir ~/Workspaces/heroku/craftman-test005 && cd ~/Workspaces/heroku/craftman-test005 Spazsquatch@MacBook-Pro:~/Workspaces/heroku/craftman-test005$ TRACE=1 DEBUG=1 craftman --port=8080 install ---> Project path: /Users/Spazsquatch/Workspaces/heroku/craftman-test005 ---> Loading custom plugins from /Users/Spazsquatch/.craftman/plugins ---> All plugins: ---> Loading core plugins from /Users/Spazsquatch/.craftman/bin/plugins ---> + Loading plugin /Users/Spazsquatch/.craftman/bin/plugins/composer/composer.plugin ---> + Plugin added composer ---> + Loading plugin /Users/Spazsquatch/.craftman/bin/plugins/heroku/heroku.plugin ---> + Plugin added heroku ---> + Loading plugin /Users/Spazsquatch/.craftman/bin/plugins/mysql/mysql.plugin ---> + Plugin added mysql ---> + Loading plugin /Users/Spazsquatch/.craftman/bin/plugins/phpimage/phpimage.plugin ---> + Plugin added phpimage ---> All plugins: composer heroku mysql phpimage _*> Run composer__config > Run herokuconfig > Run mysqlconfig > Run phpimageconfig > Run composerinit > Run herokuinit > Run mysqlinit > Run phpimageinit CM_APACHE_MODS_ENABLE='rewrite setenvif deflate headers filter' CM_APP_DIR=site CM_APP_PATH=/Users/Spazsquatch/Workspaces/heroku/craftman-test005/site CM_APT_INSTALL=' libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev libmagickwand-dev vim curl git wget unzip' CM_BACKUPS_DIR=backups CM_BACKUPS_PATH=/Users/Spazsquatch/Workspaces/heroku/craftman-test005/backups CM_CACHE=/Users/Spazsquatch/.craftman/cache CM_CONFIG_PATH=/Users/Spazsquatch/.craftman/config CM_CRAFT_DB_CONFIG_PATH=/Users/Spazsquatch/Workspaces/heroku/craftman-test005/site/craft/config/db.php CM_CRAFT_DOWNLOAD_URL='https://craftcms.com/latest.zip?accept_license=yes' CM_CRAFT_GENERAL_CONFIG_PATH=/Users/Spazsquatch/Workspaces/heroku/craftman-test005/site/craft/config/general.php CM_CRAFT_HTTP_PORT= CM_CRAFT_ZIP=/Users/Spazsquatch/.craftman/cache/craft-2016-05.zip CM_CRAFT_ZIPNAME=craft-2016-05.zip CM_CUSTOM_CONFIG_PATH=/Users/Spazsquatch/.craftman/config.d CM_CUSTOM_INSTALL= CM_DOCKER_COMPOSE=docker-compose.yml CM_DOCKER_COMPOSE_PATH=/Users/Spazsquatch/Workspaces/heroku/craftman-test005/docker-compose.yml CM_DOCKER_CRAFT_CUSTOM_VOLUMES= CM_DOCKER_CRAFT_DEFAULT_ENV=' - CRAFT_DEVMODE=true' CM_DOCKER_CRAFT_DEFAULT_VOLUMES=' - "./site:/var/www" CM_DOCKER_CRAFT_ENVS=() CM_DOCKER_DATA_IMAGE=debian:jessie CM_DOCKER_MYSQL_DATA_VOLUMES=' - /var/lib/mysql' CM_DOCKER_MYSQL_ENV=' - MYSQL_DATABASE=craft CM_DOCKER_MYSQL_IMAGE=mariadb:10.1 CM_DOCKER_PHP_IMAGE=php:5-apache CM_FORCE_DOWNLOAD=0 CM_FORCE_OVERWRITE=0 CM_FORCE_RECREATE=0 CM_GROUP= CM_INSTALLER_DIR=install CM_INSTALLER_PATH=/Users/Spazsquatch/Workspaces/heroku/craftman-test005/scripts/install CM_INSTALL_DEPENDENCIES=010_dependencies.sh CM_INSTALL_DEPS_PATH=/Users/Spazsquatch/Workspaces/heroku/craftman-test005/scripts/install/010_dependencies.sh CM_PECL_INSTALL=imagick CM_PHP_EXT_ENABLE=imagick CM_PHP_EXT_INSTALL='iconv mcrypt gd mbstring pdo pdo_mysql zip' CM_PHP_INI_PATH=/Users/Spazsquatch/Workspaces/heroku/craftman-test005/scripts/override/usr/local/etc/php/php.ini CM_PLUGINS=([0]="composer" [1]="heroku" [2]="mysql" [3]="phpimage") CM_PLUGINS_CORE_DIR=/Users/Spazsquatch/.craftman/bin/plugins CM_PLUGINS_DIR=/Users/Spazsquatch/.craftman/plugins CM_PLUGIN_PREFIX= CM_PROJECT_CONFIG=.craftman CM_PROJECT_CRAFTMAN_CONFIG=/Users/Spazsquatch/Workspaces/heroku/craftman-test005/.craftman/config CM_PROJECT_CRAFTMAN_PATH=/Users/Spazsquatch/Workspaces/heroku/craftman-test005/.craftman CM_PROJECT_CUSTOM_CONFIG_PATH=/Users/Spazsquatch/Workspaces/heroku/craftman-test005/.craftman/config.d CM_PROJECT_DIR=craftman-test005 CM_PROJECT_NAME=craftman-test005 CM_PROJECT_PATH=/Users/Spazsquatch/Workspaces/heroku/craftman-test005 CM_ROOT=/Users/Spazsquatch/.craftman/bin CM_SCRIPTS_DIR=scripts CM_SCRIPTS_PATH=/Users/Spazsquatch/Workspaces/heroku/craftman-test005/scripts CM_USER= CM_wwwPERMISSIONS=775 ---> Removing /Users/Spazsquatch/Workspaces/heroku/craftman-test005/.craftman/config.d/docker-ports.conf ---> Creating craftman project at /Users/Spazsquatch/Workspaces/heroku/craftman-test005/.craftman/config ===> Installing Craft... ===> Preparing to download Craft CMS ===> + Using Craft CMS from local cache ===> Extracting Craft CMS zip ===> + Unzipping craft.zip to /Users/Spazsquatch/Workspaces/heroku/craftman-test005/site ===> Generating Craft CMS configurations ---> + Adding '.ok' to '/Users/Spazsquatch/Workspaces/heroku/craftman-test005/scripts/install/.gitignore' ===> + Generating 'scripts/install/010dependencies.sh' ===> + Generating 'site/craft/config/db.php' ===> + Generating 'site/craft/config/general.php' ===> + Generating 'docker-compose.yml' ===> + Generating 'scripts/override/usr/local/etc/php/php.ini' *> Run composer__generate ---> + Adding 'composer.phar' to '/Users/Spazsquatch/Workspaces/heroku/craftman-test005/scripts/.gitignore' ===> + Generating 'scripts/install/100_composer.sh' > Run herokugenerate > Run mysqlgenerate _*> Run phpimage__generate ===> Starting Craft CMS containers Pulling mysql_data (debian:jessie)... jessie: Pulling from library/debian 8b87079b7a06: Pull complete a3ed95caeb02: Pull complete Digest: sha256:32a225e412babcd54c0ea777846183c61003d125278882873fb2bc97f9057c51 Status: Downloaded newer image for debian:jessie Pulling mysql (mariadb:10.1)... 10.1: Pulling from library/mariadb 8b87079b7a06: Already exists a3ed95caeb02: Pull complete 8b31a672b2e4: Pull complete f959b6b404b6: Pull complete 9474f626fd77: Pull complete 8b9beff43c30: Pull complete bac5b85f382e: Pull complete b5afe408f722: Pull complete 336a899336bf: Pull complete 1f35fa63a903: Pull complete 4c9af553aed4: Pull complete 65beec678ddf: Pull complete 2def8a54380a: Pull complete Digest: sha256:a7df76f2376d71a2c957d2e2ae575122fac0bb6ab4311ea0f3677960cabe8a81 Status: Downloaded newer image for mariadb:10.1 Pulling craft (php:5-apache)... 5-apache: Pulling from library/php 8b87079b7a06: Already exists a3ed95caeb02: Pull complete af1704cb90e1: Pull complete 6acdef7ebe13: Pull complete 4fc566a7c22a: Pull complete b06a1bacee51: Pull complete c5fc21fb6c09: Pull complete df319b61c869: Pull complete f958e5267409: Pull complete b06010f04fa8: Pull complete 17c1b5f8acff: Pull complete 2ed292d591c7: Pull complete 5ea0585ac6f2: Pull complete Digest: sha256:dd9b161707dc6a9ec80dc9f7817f8d56e49e111f38c0a0a0ae28e5a0a8587f38 Status: Downloaded newer image for php:5-apache Creating craftmantest005_mysql_data_1 Creating craftmantest005_mysql_1 Creating craftmantest005_craft_1 ===> Copying all files and directories from '/Users/Spazsquatch/Workspaces/heroku/craftman-test005/scripts/override' to craft container root '/'.' Error response from daemon: 404 page not found '''

docker ps shows a running instance on 8080

''' Spazsquatch@MacBook-Pro:~/Workspaces/heroku/craftman-test005$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a9a328496201 php:5-apache "apache2-foreground" 3 minutes ago Up 3 minutes 0.0.0.0:8080->80/tcp craftmantest005_craft_1 b9a4aaa07b99 mariadb:10.1 "docker-entrypoint.sh" 3 minutes ago Up 3 minutes 3306/tcp craftmantest005_mysql_1 '''

If I go to localhost:8080 in a browser on my Mac I get a 503 error. If I "craftman start" from this point, I'll get the same 404 error.

Crafts files are in place on the container. The override folders/path look like they are in place. From my (poor) understanding of the script I would expect to see 'cm_log "All configuration files synced"' output in the terminal before any web-based request is made.

Is there something I could do to log the specific request that is failing?

Ideas?

gabrielmoreira commented 8 years ago

@hotdocs Sorry for the delay.

I think it's a bug on Docker 1.11: https://github.com/docker/docker/issues/22909 I'm having this error too. Can you confirm if you are running 1.11?

gabrielmoreira commented 8 years ago

@hotdocs Can you try to change directory name from craftman-test005 to test005?

Upgrade craftman to latest version. craftman --upgrade and try again... i think it can be my fault.

hotdocs commented 8 years ago

I am running 1.11

Spazsquatch@MacBook-Pro:~$ docker -v Docker version 1.11.1, build 5604cbe

Updated and things are looking better, but still not working. I'm pasting some things below before I've taken much of look myself. Browser still returning a "Service Unavailable" (503) but I'm getting past the "Copying all files and directories" I was getting stuck at before, so that's good.

... ===> Copying all files and directories from '/Users/Spazsquatch/Workspaces/heroku/cmtest003/scripts/override' to craft container root '/'.' ***> cm_craft_exec: [docker exec -t "cmtest003_craft_1" sh -c "cd /scripts/override/ && yes | cp -rf . /"] ===> All configuration files synced ===> Prepare to run install scripts ===> Running install script 010_dependencies.sh stty: stdin isn't a terminal ***> cm_craft_exec: [docker exec -t "cmtest003_craft_1" sh -c "/scripts/install/010_dependencies.sh"] stty: stdin isn't a terminal ===> Installing dependencies ===> + Configuring user and group ===> + User id: 0 ===> + Group id: 0 root:x:0: usermod: UID '0' already exists

I assume that's not how it's suppose to finish... looks like it's only about half way through 010_dependencies.sh, so yeah. Unfortunately my grasp of bash scripting is rudimentary.

Oh, and I had to do "cmtest" because it causes me great pain to not have any designation on what the test represents. I assume the hyphen was the element you were concerned about but feel free to call me out for not following your simple instruction if its necessary.

gabrielmoreira commented 8 years ago

Hi @hotdocs , can you craftman --upgrade and test again?

hotdocs commented 8 years ago

To quote Batman in The Lego Movie, "First Try!".

Restarting cmtest004_craft_1 ... done ===> ===> ************************************************* ===> ===> Run 'craftman admin' to complete installation, ===> and 'craftman open' to access your site ===> ===> ************************************************* ===> ===> Opening http://0.0.0.0:8080/admin in your browser

Ran the Craft installer and it went smoothly. So far it looks to be perfect.

tony2nite commented 7 years ago

I also had similar symptoms after upgrading Docker from the old version to the "native" one, where older version had been working fine. Remove and purging containers, restarting didn't help. Eventually craftman reconfigure did.