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

unknown "mage_run_code" variable #996

Open
Dramorian opened this issue Oct 9, 2023 · 3 comments
Open

unknown "mage_run_code" variable #996

Dramorian opened this issue Oct 9, 2023 · 3 comments

Comments

@Dramorian
Copy link

Dramorian commented Oct 9, 2023

Description
https://courses.m.academy/courses/487758/lectures/14780970
When trying to configure a multi-store instance, I get the error in nginx app container unknown "mage_run_code" variable

Steps To Reproduce

  1. Follow the video

Expected Result
Both websites working which are set in images/nginx/conf/default.conf

Actual Result
Ubuntu terminal giving this error:
/compose.yaml: yaml: line 12: did not find expected key

Docker app container log this one:
[emerg] 1#1: unknown "mage_run_type" variable

If you comment out these lines, it works as usual, but apparently it doesn't let me access my second website and instead redirects to the default one.

fastcgi_param MAGE_RUN_TYPE $MAGE_RUN_TYPE;

fastcgi_param MAGE_RUN_CODE $MAGE_RUN_CODE;

I use Windows 10 and WSL2.

@markshust
Copy link
Owner

markshust commented Dec 30, 2023

Can you post your full compose.yaml file?

This error is telling:

/compose.yaml: yaml: line 12: did not find expected key

I'd recommend fixing one error at a time, as fixing one thing could resolve others. The error above is leading to an invalidly formatted YAML file.

@emp1211
Copy link

emp1211 commented Jan 30, 2024

I'm experiencing a very similar issue. Local AC instance working fine when the following lines are commented out of the nginx.conf:
fastcgi_param MAGE_RUN_CODE $MAGE_RUN_CODE;
fastcgi_param MAGE_RUN_TYPE $MAGE_RUN_TYPE;

STEPS TAKEN / STEPS TO REPRODUCE
-starting from working docker-magento instance, following Mark's video:
-compose.yml - replaced with image command with build command
-/images/nginx/Dockerfile created & configured
-/images/nginx/conf/default.conf created & configured
-nginx.conf updated with MAGE_RUN_CODE and MAGE_RUN_TYPE vars
-compose.dev.yml updated to bind-mount nginx.conf instead of nginx.conf.sample
-run setup ssl command

EXPECTED RESULT
-additional websites in magento instance are hit by the browser at correct URLs

ACTUAL RESULT
-app (nginx) container fails/crashes - log returns unknown "mage_run_type" variable
-if those lines mentioned above are commented out, app (nginx) container working but redirecting to base URL

Is this a known issue? Are there any known fixes? It seems like it may be a permissions issue.

@craig-bartlett
Copy link

craig-bartlett commented Jun 25, 2024

I had a similar issue as above, but found that the images/nginx/conf/default.conf was not copying over - verified by checking the /etc/nginx/conf.d/default.conf file in the app container. I rebuilt the image from the Dockerfile with:

docker build --pull --rm -f "images/nginx/Dockerfile" -t magento:latest "images/nginx"

And found an error had been thrown due to a typo in the images/nginx/Dockerfile. After I corrected this and rebuilt the container the problem was solved.

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

No branches or pull requests

4 participants