markshust / docker-magento

Mark Shust's Docker Configuration for Magento
https://m.academy/courses/set-up-magento-2-development-environment-docker/
MIT License
2.52k stars 993 forks source link

Not able to get a working installation when running from external disk #274

Closed ReindDooyeweerd closed 4 years ago

ReindDooyeweerd commented 4 years ago

Description For one or another reason it won't run from an external SSD. After various attempts i tried it to run it from my internal harddrive and it ran without issues.

Thing is, i don't have much space left on my Mac Mini internal SSD so i would like to run it from my Samsung T5 external SSD.

Steps To Reproduce

  1. curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash
  2. bin/download 2.3.5-p1
  3. bin/setup tanita.local

Expected Result An working Magento install

Actual Result A redirect to /setup and some errors in the console.

error

I also added the volume under the Docker preferences (should already work with the default /Volume i think),

prefs

markshust commented 4 years ago

Did you try blowing everything away and reinstalling after adding the volume/resource to Docker prefs? Also, need to ensure you remove the volumes and etc. as well. The correct process is:

cd {YOUR_PROJECT}
bin/removeall
cd ..
rm -rf {YOUR_PROJECT}
mkdir {YOUR_PROJECT
cd {YOUR_PROJECT}
... then reinstall
ReindDooyeweerd commented 4 years ago

Yep, i tried that already... multiple times (and finished it with a docker system prune -a)

Could it have something to do with the copy command? I just scrolled through the installation log and the only "thing" i noticed was this message,

"docker cp" requires exactly 2 arguments. See 'docker cp --help'. Usage: docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|- docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH

markshust commented 4 years ago

Are you using some kind of alternate bash/shell program? That is definitely the root of your issue.

What happens when you run bin/copytocontainer --all?

ReindDooyeweerd commented 4 years ago

When running the whole procedure from start with default Mac OS terminal,

Creating tanita_db_1 ... done Creating tanita_redis_1 ... done Creating tanita_rabbitmq_1 ... done Creating tanita_elasticsearch_1 ... done Creating tanita_phpfpm_1 ... done Creating tanita_app_1 ... done Copying all files from host to container... "docker cp" requires exactly 2 arguments. See 'docker cp --help'.

Usage: docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|- docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH

Copy files/folders between a container and the local filesystem Completed copying all files from host to container Correcting filesystem ownerships... Filesystem ownerships corrected. Correcting filesystem permissions... find: 'var': No such file or directory find: 'vendor': No such file or directory find: 'pub/static': No such file or directory find: 'pub/media': No such file or directory find: 'app/etc': No such file or directory find: 'var': No such file or directory find: 'vendor': No such file or directory find: 'pub/static': No such file or directory find: 'pub/media': No such file or directory find: 'app/etc': No such file or directory chmod: cannot access 'bin/magento': No such file or directory Filesystem permissions corrected. chmod: cannot access 'bin/magento': No such file or directory

I have ZSH / Hyper installed but when going to the default Mac OS Terminal settings it just has the setting Default login shell.

Going to take some sleep first... struggling with it all evening and still couldn't get it to run from the external SSD. Strange thing is, i did the oneline installer on the internal drive and it worked immediately.

Edit...

Just tried it one more time... things are going from bad to worse now ;),

vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryNavigationMenu.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryNotInNavigationMenu.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryOnCustomStore.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryOnCustomWebsite.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryProductsGridFilter.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryRedirect.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySaveMessage.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryWithCustomStoreOnFrontend.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCustomOptions.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertDateInvalidErrorMessage.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertFileExtensionHints.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertImagesAreVisibleOnProductPage.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertMassProductUpdateSuccessMessage.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertPaginationCorrectOnStoreFront.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertPriceOnProductPageInterface.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentCrossSells.php: (null) vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAbsentRelatedProducts.php: (null) tar: Error exit delayed from previous errors.

ReindDooyeweerd commented 4 years ago

Are you using some kind of alternate bash/shell program? That is definitely the root of your issue.

ZSH is default since Catalina if i am correct, i'll try tomorrow switching back to bash (just found this, https://www.howtogeek.com/444596/how-to-change-the-default-shell-to-bash-in-macos-catalina/)

However, that still doesn't explain why it does work on local drives and it doesn't on external drives.

I just tested it again on both internal and external hard drive, it really has to do something with the copy command. Comparing both runs the main difference is this message when the copy actions take place,

Copying all files from host to container... "docker cp" requires exactly 2 arguments. See 'docker cp --help'.

Usage: docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|- docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH

Copy files/folders between a container and the local filesystem Completed copying all files from host to container Correcting filesystem ownerships... Filesystem ownerships corrected. Correcting filesystem permissions... find: 'var': No such file or directory find: 'vendor': No such file or directory find: 'pub/static': No such file or directory find: 'pub/media': No such file or directory find: 'app/etc': No such file or directory find: 'var': No such file or directory find: 'vendor': No such file or directory find: 'pub/static': No such file or directory find: 'pub/media': No such file or directory find: 'app/etc': No such file or directory chmod: cannot access 'bin/magento': No such file or directory Filesystem permissions corrected. chmod: cannot access 'bin/magento': No such file or directory

Then the authorisation part comes and some copy actions... which seem to fail also,

Authentication required (repo.magento.com, public_key and private_key): Username: xxxxxxxxxxxxxxxx Password: xxxxxxxxxxxxxxxx

[RuntimeException]
File "./composer.json" cannot be found in the current directory

config [-g|--global] [-e|--editor] [-a|--auth] [--unset] [-l|--list] [-f|--file FILE] [--absolute] [--] [] []...

Forcing reinstall of composer deps to ensure perms & reqs... Changed current directory to /var/www/.composer 1/3: http://repo.packagist.org/p/provider-latest$bfc74252da01b34dca849b409c6a7c52ee87db3745bd66aea26c165eba906683.json 2/3: http://repo.packagist.org/p/provider-2020-04$ba8a4e9d0daa20ec60ea63f3d419b3e727daf06f9d7517b3c08aed79265af76a.json 3/3: http://repo.packagist.org/p/provider-2020-01$b2c8ba1a70fb149aecb86a6310c2db5a001749eacf87967846dbab6ee6910242.json Finished: success: 3, skipped: 0, failure: 0, total: 3 Using version ^0.3.10 for hirak/prestissimo ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Generating autoload files Composer could not find a composer.json file in /var/www/html To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bin/magento\": stat bin/magento: no such file or directory": unknown Turning on developer mode.. OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bin/magento\": stat bin/magento: no such file or directory": unknown OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bin/magento\": stat bin/magento: no such file or directory": unknown Forcing deploy of static content to speed up initial requests... SOCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bin/magento\": stat bin/magento: no such file or directory": unknown Enabling Redis for cache... OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bin/magento\": stat bin/magento: no such file or directory": unknown Enabling Redis for Full Page Cache... OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bin/magento\": stat bin/magento: no such file or directory": unknown Enabling Redis for session... OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bin/magento\": stat bin/magento: no such file or directory": unknown Enabling Elasticsearch... OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bin/magento\": stat bin/magento: no such file or directory": unknown Re-indexing with Elasticsearch... OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bin/magento\": stat bin/magento: no such file or directory": unknown Clearing the cache to apply updates... OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bin/magento\": stat bin/magento: no such file or directory": unknown Copying files from container to host after install... "docker cp" requires exactly 2 arguments. See 'docker cp --help'.

Usage: docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|- docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH

Copy files/folders between a container and the local filesystem Completed copying app from container to host "docker cp" requires exactly 2 arguments. See 'docker cp --help'.

Usage: docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|- docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH

Copy files/folders between a container and the local filesystem Completed copying vendor from container to host

ReindDooyeweerd commented 4 years ago

Small update... fixed it.

Thing is that you can't use spaces in the name of your external drive, renamed the external drive to just "SSD" and it started to work.

Maybe something to mention in the docs?