Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

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!

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top