-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Media sources not working - Error 500 [2.4.2] #32341
Comments
Hi @Dutch77. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Hello @Dutch77 Thank you for your report. Can you please clarify step number 4 Try to visit image public URL and if possible provide a screen or video. Thank you in advance |
Hi @engcom-Bravo. Thank you for working on this issue.
|
I will clarify that
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions! |
I think it has something to do with server settings. When media image exists then server has to show it immediately. But for some reason handling this request is given to Magento I'm not good with server settings. It is quite hard for me to understand such behavior. But form PHP side I have found quick solution. Move Magento bootstrat initialization earlier in code. ObjectManager is initialized in --- /pub/get.php
+++ /pub/get.php (Unsaved)
@@ -33,6 +33,15 @@
)
);
$relativePath = $request->getPathInfo();
+
+// Materialize file in application
+$params = $_SERVER;
+if (empty($mediaDirectory)) {
+ $params[ObjectManagerFactory::INIT_PARAM_DEPLOYMENT_CONFIG] = [];
+ $params[Factory::PARAM_CACHE_FORCED_OPTIONS] = ['frontend_options' => ['disable_save' => true]];
+}
+$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
+
if (file_exists($configCacheFile) && is_readable($configCacheFile)) {
$config = json_decode(file_get_contents($configCacheFile), true);
@@ -67,13 +76,6 @@
}
}
-// Materialize file in application
-$params = $_SERVER;
-if (empty($mediaDirectory)) {
- $params[ObjectManagerFactory::INIT_PARAM_DEPLOYMENT_CONFIG] = [];
- $params[Factory::PARAM_CACHE_FORCED_OPTIONS] = ['frontend_options' => ['disable_save' => true]];
-}
-$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
/** @var \Magento\MediaStorage\App\Media $app */
$app = $bootstrap->createApplication(
\Magento\MediaStorage\App\Media::class,
|
That is the exact workaround we're currently using :D |
Hi @engcom-Lima. Thank you for working on this issue.
|
Hi @Dutch77 I saw your issue, it is looking configuration settings related. Can you please provide me some screenshots and more steps to investigate this in details. |
Hi @Dutch77 Can't reproduce the issue. I tested Magento ver. dev-2.4-develop. Hence closing this ticket. |
Hello,
|
Hello @engcom-Lima Make sure you goes trough this condition with you test case. @Dutch77 |
@engcom-Lima This is exactly how I could reproduce/enforce the issue locally as well. We see this error message on our LIVE system. |
I just realized that this issue has been solved already in the latest 2.4-develop branch of magento and in version 2.4.5: f142625 |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
What exactly is wrong here
Magento\Framework\File\Mime
. Class has now constructor that needsMagento\Framework\Filesystem
. https://github.com/magento/magento2/blob/2.4.2/lib/internal/Magento/Framework/File/Mime.php#L82ObjectManager
ObjectManager
is instantiated later in flow see line 76 and line 64 https://github.com/magento/magento2/blob/2.4.2/pub/get.phpWorkaround
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
The text was updated successfully, but these errors were encountered: