2

I am trying submit one Magento2 Extension on Magento2 marketplace but i am getting following error:

Problem 1

Environment: Operating System - Centos 7, PHP Version - 5.6 , Magento Platform - 2.1 CE

Command: deploy:mode:set production

Installation issue: Enabled maintenance mode Starting compilation Something went wrong while compiling generated code. See the error log for details.

Command returned non-zero exit code: /usr/bin/php -f /var/www/html/bin/magento setup:di:compile Build step 'Execute shell' marked build as failure [PostBuildScript] - Execution post build scripts. [DockerOperationsPHP56Magento21CE] $ /bin/sh -xe /tmp/hudson8419337065117254776.sh

Problem 2

Environment: Operating System - Centos 7, PHP Version - 7.0 , Magento Platform - 2.1 CE

Command: deploy:mode:set production

Installation issue:

Enabled maintenance mode Starting compilation Something went wrong while compiling generated code. See the error log for details. Command returned non-zero exit code: /usr/bin/php -f /var/www/html/bin/magento setup:di:compile Build step 'Execute shell' marked build as failure [PostBuildScript] - Execution post build scripts. [DockerOperationsPHP70Magen...

What i tried: I have tried to execute the same command on local and i am getting similar kind of error like following : enter image description here

When i checked the system.log for error. It is giving the me following error:

enter image description here

but that is my local machine php memory issue. How can can i solve it to get it done on magento connect to upload my extension successfully.

8
  • Have try to compile your code before submit using this "php bin/magento setup:di:compile" Feb 9, 2017 at 6:35
  • Yes,when we try to put it on production mode it will automatically compile code but problem is the same memory exhausted and give Fatal error: Allowed memory size of 134217728 bytes exhausted. Feb 9, 2017 at 6:39
  • Before puting in production mode, you can verify extension code using this command, And if any error show on screen, try to solve that. It will help you. Feb 9, 2017 at 6:40
  • Yes @DhirenVasoya already did that but issue that generate using that command is memory limit. Feb 9, 2017 at 6:43
  • Try to update memory limit for php cli (not Apache) stackoverflow.com/questions/4096582/… . After that try to run recompilation command.
    – Max
    Feb 12, 2017 at 7:21

3 Answers 3

2
+100

I don't work in the Marketplace team, but my understanding is they have been iteratively increasing tests performed on marketplace, then going back to extension developers to have them address the issues. This particular issue sounds similar to a recent issue that had a bulk mail out to extension developers. (I have not checked your specific case, but it looks similar.) We are already working with a list of extension developers to address the issue (which does not help you in the short term). The cases I know of the extension needs adjustment - its not your fault.

Another similar case is we were allowing extensions to pick the subset of PHP versions it supports. This however also causes problems as different extensions may only support different versions of PHP - so we are clarifying the policy (and adding checks) so that "you must support all versions of PHP that Magento officially supports for that version of Magento (2.0 and 2.1 support different versions of PHP).

There are more checks coming along as well which are being retrospectively applied, then failing extension developers are being informed of the issues to be corrected. E.g. Varnish support is another one. Some issues however area easier than others to detect reliably.

I have not checked what you did closely, but I think completely reasonable to pass these instructions on to the extension developer. I will pass this issue on to the Marketplace team as well to see if this extension is already being talked to on the same issue.

Or (rereading) did I misunderstand and you are saying you are submitting to the marketplace and getting the error, but don't understand the cause? In which case I have not responded to your question at all! It is mandatory for extensions to work in production mode. That is not a marketplace problem - that is a problem with an error in your code not being visible until you turn on production mode.

If you are running out of memory locally, you may need to increase your memory limit in the php.ini file in scope. If Marketplace is failing during the submissions process, it may be we need to upgrade the limit internally on our test script. Composer is unfortunately quite memory hungry at times as well.

So sorry if I am not quite following, but on second reading I would say it is insufficient memory being allocated (controlled by the php.ini file). You need to adjust this on your site - have a look at http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements-tech.html For more details on memory limits etc.

2
  • We are also facing the same issue during the marketplace upload in the installation phase. By your statement, does that means this have been the issue from the Magento Marketplace or is there a fix available to this from our side if anything we could do.?
    – Sankar_k
    Oct 9, 2017 at 11:10
  • Our issue is: Command: composer require custom/module-payment:1.1.1' Installation issue: Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested package custom/module-payment could not be found in any version, there may be a typo in the package name. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting
    – Sankar_k
    Oct 9, 2017 at 11:13
1

Did you try to re-upload you extension on Marketplace? A few days before we implemented new feature for installation step, so, if you will have such errors during extension installation - the error log from system.log will be added to the report. I think it's an issue with non-existing interface in model. Try to re-upload you extension and you will see it.

Now we have memory_limit = -1 on our docker environments. But soon we will fix it according to http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements-tech.html.

6
  • Yes , i uploaded my extension to connect. I had the same problem Feb 14, 2017 at 4:15
  • Are you sure that issue is the same? Because we found errors during compilation. Could you send me ([email protected]) your extension name, so we will double check it? Feb 14, 2017 at 7:37
  • So as I understood it's not the same error with memory limitation - it's other error during compilation, related to error in your code. Please, fix it and re-upload your extension. Feb 14, 2017 at 9:15
  • It was showing the memory error when you open system.log. Magento marketplace and my local not giving any error of that missing interface before increasing the memory limit. I would suggest MagentoMarketPlace to increase memory limit so user can get exact error while submitting extension :D Feb 14, 2017 at 9:27
  • 1
    We don't have memory limitation, for now this value is memory_limit = -1. Earlier system.log wasn't being attached to the report, so you couldn't see this error. Now this problem is fixed and you can:) Feb 14, 2017 at 10:14
1

For those who are wondering: I currently cannot see an option to download a system.log-file after submitting an extension to Magento Marketplace. I already have a question standing out on the forum and on GitHub, but for those who are in a hacky mood, here's how you can add a little hack for debugging purposes:

Rewrite Magento\Deploy\Console\Command\SetModeCommand in your di.xml:

<preference for="Magento\Deploy\Console\Command\SetModeCommand"
            type="Vendor\Module\Rewrite\Magento\Deploy\Console\Command\SetModeCommand"/>

And in your rewrite, override the execute() method and manipulate the catch-block to look something like this:

} catch (\Exception $e) {
    $output->writeln('<error>' . $e->getMessage() . '</error>');
    // Show them log files:
    $files = ['debug.log', 'system.log', 'exception.log'];
    foreach ($files as $file) {
        $path = __DIR__ . '/../../../../../../../../var/log/' . $file;
        $output->writeln('Trying: ' . $path);
        if (file_exists($path)) {
            $output->write(file_get_contents($path));
        } else {
            $output->writeln('file not found');
        }
    }
    if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
        $output->writeln($e->getTraceAsString());
    }
    // we must have an exit code higher than zero to indicate something was wrong
    return \Magento\Framework\Console\Cli::RETURN_FAILURE;
}

This surely is a hack, but it allows you to read the log files when submitting a failed extension. Be sure to remove this hack when you fixed the issue!. You don't want this to end up in the Marketplace. ;-)

Sure hope that somebody @Magento adds (or fixes?) the possibility to download the log files soon!

1
  • I'm so glad I posted this comment. I've ran into the same issue today and I hoped that I had wrote it down somewhere Jul 11, 2019 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.