ddev / ddev-platformsh

Add integration with Platform.sh hosting service
Apache License 2.0
9 stars 10 forks source link

Magento2 doesn't work with add-on: "Cannot find the main route for Magento. Please add `id: magento_route` to your routes.yaml" #95

Open willatplatform opened 1 year ago

willatplatform commented 1 year ago

when trying to use this with platform.sh and magento2 we are getting the following error and it does not fully deploy. I have redacted the project and branch.. output.txt

rfay commented 1 year ago

I believe the plain-vanilla https://github.com/platformsh-templates/magento2ce results in this problem, could you please confirm that?

willatplatform commented 1 year ago

correct.

gilzow commented 1 year ago

See: https://github.com/platformsh-templates/magento2ce/blob/master/deploy.php#L93 and https://github.com/platformsh-templates/magento2ce/blob/master/.platform/routes.yaml#L2

gilzow commented 1 year ago

IF I remember correctly, the Magento installer requires a base-url. Since any number of routes/domains can be "primary" routes, there needs to be a reliable way to get what is ultimately the default domain.

@tylerssn does that sound correct?

This isn't working with the add-on since we aren't actually parsing the routes.yaml file yet but statically creating the route information for ddev.

The script itself is running because it checks to see if the file app/etc/installed exists, and if not, proceeds to attempt to install Magento. app/etc is a file mount: https://github.com/platformsh-templates/magento2ce/blob/master/.platform.app.yaml#L56

In this case, you'll need to do a ddev pull platform and get the db and mounts before you run ddev start so the files are available locally for when ddev runs the hooks.

tylers-username commented 1 year ago

IF I remember correctly, the Magento installer requires a base-url. Since any number of routes/domains can be "primary" routes, there needs to be a reliable way to get what is ultimately the default domain.

That's right, we're essentially being explicit about which domain we want to use and we don't have a "give me the default domain" option (that I know of) that could replace this logic.

That said, Magento doesn't technically require that a base URL be set. If it is not set, Magento will answer a request made to it from any domain. I'm not sure what the impact of that would be on this setup script—I haven't looked at it in a while 😄

rfay commented 1 year ago

The "Cannot find the main route" issue is now resolved.

Now we're dependent on getting the template fixed: