Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Jan 26, 2023 · 6 comments

Comments

@willatplatform
Copy link

willatplatform commented Jan 26, 2023

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 rfay changed the title Magento2 issues. Magento2 doesn't work with add-on: "Cannot find the main route for Magento. Please add id: magento_route to your routes.yaml" Jan 26, 2023
@rfay
Copy link
Member

rfay commented Jan 26, 2023

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

@willatplatform
Copy link
Author

correct.

@gilzow
Copy link
Collaborator

gilzow commented Jan 26, 2023

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
Copy link

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
Copy link
Member

rfay commented Aug 25, 2023

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

Now we're dependent on getting the template fixed:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants