improper/lando-magento2-template

lando magento:download fails

rhuffstedtler opened this issue · 10 comments

At step 2 of the quick setup, it fails with this error:

OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused "exec: \"/app/dev/lando/tooling/magento.download.sh\": stat /app/dev/lando/tooling/magento.download.sh: no such file or directory": unknown

If I'm interpreting it correctly, the tooling is going to try to execute that command in the container, which doesn't exist at this point. That path isn't valid on the host OS.

That may be a misinterpretation on my part of how tooling works, though. It looks like changing line 55 to
cmd: ./dev/lando/tooling/magento.download.sh

is working

OK, spoke too soon. After it completes, the files aren't there - looks like it's trying to copy them to the wrong path:

'/tmp/magento-extract/magento-magento2-3609773/./pub/media/import/.htaccess' -> '/app/./pub/media/import/.htaccess' '/tmp/magento-extract/magento-magento2-3609773/./pub/media/theme_customization/.htaccess' -> '/app/./pub/media/theme_customization/.htaccess' '/tmp/magento-extract/magento-magento2-3609773/./pub/opt/magento/var/resource_config.json' -> '/app/./pub/opt/magento/var/resource_config.json' cp: cannot stat 'auth.json.sample': No such file or directory

Weirdly, there's nothing in /app on the host machine, though.

Looks like I have the latest.

In line 8, should that be 'app' rather than '/app'?

That change gets it to at least populate the app directory in the project folder.

I still get
cp: cannot stat 'auth.json.sample': No such file or directory

right before the Magento has been downloaded! message.

Although I'm not sure that's what was intended. Seems like the contents of the app directory should all be at the root level of the project.

It certainly seems like that's what line 11 expects

Looks like
cp --verbose -R /tmp/magento-extract/magento*/. .

is what we're after.

Although now I'm failing at the lando start with

~/Sites/m2-demo-lemp$ lando start Let's get this party started! Starting app.. ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information. If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).

OK, false alarm on that one. Stopping and restarting docker seems to have resolved that issue.

I may be able to dive into this later this evening. In the meantime, what version of Lando are you running and which OS?

Looks like with those tweaks, I have it up and running with Luma and was able to create the admin user.

Running lando v3.0.0-rc.16 on MacOS 10.14.

Thanks for your help, btw! Really appreciate the effort you're putting into this.

@rhuffstedtler - I really appreciate you taking the time to give this a chance and providing feedback.

At step 2 of the quick setup, it fails with this error:

OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused "exec: \"/app/dev/lando/tooling/magento.download.sh\": stat /app/dev/lando/tooling/magento.download.sh: no such file or directory": unknown

If I'm interpreting it correctly, the tooling is going to try to execute that command in the container, which doesn't exist at this point. That path isn't valid on the host OS.

That may be a misinterpretation on my part of how tooling works, though. It looks like changing line 55 to
cmd: ./dev/lando/tooling/magento.download.sh

is working

I suspect that on MacOS and Windows systems that, before lando start is executed for the first time, that tooling such as lando magento:download does not mount to /app. Based on my results below, I can see that this is not an issue for Ubuntu 18.04.

Ubuntu 18.04 Test

I destroyed my local instance of this Lando app and started fresh by following the Quick Setup instructions. Everything ran successfully, resulting in an empty Magento Luma dev site.

This will probably come down to Windows/MacOS behavior which are much more similar to one another than Linux is to either. I'll test this on Windows and see if I run into the same issue.

@rhuffstedtler - I've followed the Quick Setup instructions on Windows 10 and everything completed as expected.

I'm unable to test on MacOS any time soon, but the docker setup is so similar to Windows that I expect to see the same result.

One take away from this is that on Windows and Linux $LANDO_MOUNT is available as an env variable at the time lando magento:download is executed, so, I can and should replace /app with that. I'd be interested in seeing what lando ssh -s appserver -c 'env | grep LANDO_' outputs for you in a new Lando app from a fresh clone of this repository and before lando start is executed.

Thanks again for taking the time to give this setup a test drive. I'd love to hear back if you use it on any projects moving forward and am always open to PRs.

P.S. Since you are using MacOS, I have added a code example that may help with the performance of M2 on Lando to the Important notes section.

@rhuffstedtler - Version 1.1.0 has a refactored lando magento:download. The key fix is that it now uses composer create-project.

A nice new feature is that it comes with interactive prompts so that you can select your Magento version, community or enterprise edition, and you can pass your Magento access keys so that your auth.json is automatically configured.