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

Error 500 in Module Manager #15211

Merged
merged 2 commits into from
May 25, 2018
Merged

Error 500 in Module Manager #15211

merged 2 commits into from
May 25, 2018

Conversation

flancer64
Copy link
Contributor

@flancer64 flancer64 commented May 15, 2018

Description

There is an error in Module Manager (http://store.com/setup/index.php/moduleGrid/modules) if some module has no "moduleName" property:

{
  "name": "amzn\/amazon-pay-and-login-magento-2-module",
  "type": "magento2-module",
  "version": "2.0.4"
}

Fixed Issues (if relevant)

  1. Module Manager module grid is not working Magento 2.2.4 #15192

Manual testing scenarios

Module Manager doesn't show module grid when going through below step:

  • System > Tools > Web Setup Wizard > Module Manager

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

There is an error in Module Manager (http://store.com/setup/index.php/moduleGrid/modules) if some module has no "moduleName" property:
```
{
  "name": "amzn\/amazon-pay-and-login-magento-2-module",
  "type": "magento2-module",
  "version": "2.0.4"
}
```
@@ -178,7 +178,7 @@ private function getModulesInfo(array $moduleList)
private function addGeneralInfo(array $items)
{
foreach ($items as &$item) {
$item['moduleName'] = $item['moduleName'] ?: $this->packageInfo->getModuleName($item['name']);
$item['moduleName'] = isset($item['moduleName']) ? $item['moduleName'] : $this->packageInfo->getModuleName($item['name']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line length exceeds 120 characters. According to PSR-2 coding style, a line length must be <= 120 characters. Also as an improvement, I would recommend using null coalescing operator to simplify the construction (http://php.net/manual/en/language.operators.comparison.php#language.operators.comparison.coalesce)

@rogyar
Copy link
Contributor

rogyar commented May 15, 2018

Hello @flancer64. Thank you for your collaboration. Please, consider fixing issues mentioned in the review. Also, adjust the PR description using the template you have upon the PR creation which includes Fixed Issues, Steps to Reproduce and other required sections.
Thank you

@rogyar rogyar self-assigned this May 15, 2018
@flancer64
Copy link
Contributor Author

Hi, guys. Thanks for your responses. Feel free to change this code as you wish. It is just my proposal to fix the bug.

@magento-engcom-team
Copy link
Contributor

@flancer64 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@hostep
Copy link
Contributor

hostep commented May 21, 2018

@flancer64: can you edit your opening post, follow the template and add issue #15192 under the Fixed Issues (if relevant) so that issue automatically gets marked as fixed when this PR gets approved.

Thanks for the fix!

@flancer64
Copy link
Contributor Author

@hostep , done.

@flancer64
Copy link
Contributor Author

@magento-engcom-team , done.

@magento-engcom-team
Copy link
Contributor

Hi @flancer64. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.2.5 release.

Please, consider porting this solution across release lines.
You may use Porting tool to port commits automatically.

@Donnerberg
Copy link

I am having same problem Screenshoot: http://prntscr.com/jojvx0

But changing module.php line 181 did not solved my problem.

Does any1 have any other idea ?

Many thanks.
Nikola

@flancer64
Copy link
Contributor Author

PHP version? ?? is a 7.x feature. Try to get error message from web server error log, not from browser console.

@Donnerberg
Copy link

There is nothing in log files: http://prntscr.com/jokvek
( At least nothing when I press Module Manager button )

My PHP version is 7.0. I can upgrade it to version 7.1 if I need.

@flancer64
Copy link
Contributor Author

No, not in Magento logs. Try to look up for error message in /var/log/[apache2|nginx]/your_host_error.log

@Donnerberg
Copy link

Hm,

I'm going to find apache log files.

For now I have found only this: http://prntscr.com/jolgx0

@flancer64
Copy link
Contributor Author

Does the file /usr/home/donner/www_logs/donnerber.net/error.log exist?

@Donnerberg
Copy link

error.log.20180530.gz
I found log files at exactly location.

Before I downloaded log files, I have initiated Module Manager a few times.

Is there anything which could tell where is the problem ?

@flancer64
Copy link
Contributor Author

Sorry, @Donnerberg , I see nothing in error log. Could you give me an access log? We need to found request with HTTP result code 500.

@Donnerberg
Copy link

access.log.20180530.gz

Oh, I should send you both. I hope there is something what could help.

Many thanks for helping me with this.

1day older access log file you could find here:
access.log.20180529.gz

@flancer64
Copy link
Contributor Author

Sorry, @Donnerberg . I see that these error log & access log are from one server but I cannot see the error message in the log. Did you try to go directly to the URL "http://donnerberg.net.dedivirt595.your-server.de/setup/index.php/module-grid" under admin account (authorized)? You should see smth. like

image

If you will not see & will get error 500 try to debug app. Set breakpoint in ./setup/src/Magento/Setup/Controller/ModuleGrid.php (if you will go down to this class without errors).

@Donnerberg
Copy link

Yes you were right: http://prntscr.com/jp0tpm

But I am not sure how to set breakpoint in ./setup/src/Magento/Setup/Controller/ModuleGrid.php ?

@flancer64
Copy link
Contributor Author

I suppose, you can't if you ask me about it. Perhaps, nobody can, if this server is not under your full control. The last thing I can advise to you - try to look into the HTTP response (this is Dev tools in Chrome - Ctrl + Shift + I):
image

@Donnerberg
Copy link

Dear Flancer,

I have full access SSH and FTP control of server.

This is error from Network: http://prntscr.com/jp1vk8

What do you think about that ?

@flancer64
Copy link
Contributor Author

@Donnerberg , do you have "root" access?

You need to click on entry with error (red one) then go to tab "Response".

@Donnerberg
Copy link

@flancer64 , Yes I have full root access.

Here is screenshoot of response tab: http://prntscr.com/jp2f8u

@flancer64
Copy link
Contributor Author

Try to setup remote debugging then walk through the code starting from ./setup/index.php

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

Successfully merging this pull request may close these issues.

7 participants