Their seems to be a bug when setting the Magento 2 store from developer to production. I have tried the following command:
php -f bin/magento deploy:mode:set production
Some people here have solved the problem to increase the memory_limit however I have checked the memory_limit and this is as high as 2GB.
$ php -i | grep memory
memory_limit => 2048M => 2048M
Collecting memory statistics => No
Shared memory model => mmap
Used memory => 14151928
Free memory => 3234336520
Wasted memory => 0
Interned Strings Used memory => 486776
Interned Strings Free memory => 7901832
opcache.memory_consumption => 3098 => 3098
opcache.preferred_memory_model => no value => no value
opcache.protect_memory => 0 => 0
Error:
Enabled maintenance mode
Static content deployment start Requested languages: nl_NL
=== frontend -> Magento/blank -> nl_NL ===
....more....
Successful: 2068 files; errors: 0
---
=== frontend -> Magento/luma -> nl_NL ===
....more....
Successful: 2141 files; errors: 0
---
=== frontend -> Bluebursttheme/theme-frontend-blueburst -> nl_NL ===
....more....
Successful: 2142 files; errors: 0
---
=== adminhtml -> Magento/backend -> nl_NL ===
....more....
Successful: 1922 files; errors: 0
---
=== Minify templates ===
....more....
Successful: 860 files modified
---
New version of deployed files: 1458553439
Static content deployment complete
Start compilation
Command returned non-zero exit code:
`php -f /home/telefoon/domains/blueburst.nl/public_html/bin/magento setup:di:compile-multi-tenant 2>&1`
Please let me know if you know a solution to solve this bug.
can you run php -f /home/telefoon/domains/blueburst.nl/public_html/bin/magento setup:di:compile-multi-tenant
manually and post the output?
Thank you for your reply. I get the following error:
$ php -f /home/telefoon/domains/blueburst.nl/public_html/bin/magento setup:di:compile-multi-tenant
[ReflectionException]
Class \Issuers does not exist
setup:di:compile-multi-tenant [--serializer="..."] [--extra-classes-file="..."] [--generation="..."] [--di="..."] [--exclude-pattern="..."] [--magento-init-params="..."]
@MichielTG do you have any custom modules? Cannot find any reference to Issuers in Magento2 code base. Also, can you pleas try cleaning your var/di
and var/generation
folder and try again
Thank you for your reply Mazhalai!
There is indeed a problem with one of my Modules 1. Yotpo (Red lines) and 2. Multisafepay (Class Issuers). A nice improvement would be if Magento 2 would give the possibility to skip certain modules or give an error message which module is causing the problem.
The following workarround fixed my issue:
php -f bin/magento setup:upgrade
I'm wondering what the Cons are about skipping certain modules from the compilation?
Script 1
# Remove files in pub/static + the folder 'di' in var
php -f bin/magento maintenance:enable
php -f bin/magento cache:clean
php -f bin/magento cache:flush
php -f bin/magento indexer:reindex
# Delete the static view files directory and compile directory
rm -rf ~Location to your root~/var/di
rm -rf ~Location to your root~/var/generation
rm -rf ~Location to your root~/pub/static
php -f bin/magento setup:upgrade
# Deploy static content of nl_NL language
php -d set_time_limit=3600 bin/magento setup:static-content:deploy nl_NL
# This will only compile DEFAULT language "en_US"
php -d set_time_limit=3600 bin/magento setup:static-content:deploy
php -d set_time_limit=3600 bin/magento setup:di:compile-multi-tenant
find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento
php -f bin/magento cache:clean
php -f bin/magento cache:flush
php -f bin/magento indexer:reindex
php -f bin/magento maintenance:disable
# Finish (enter)
Update
For people using Multisafepay. Add the following line to Issuers.php and Gateways.php
namespace MultiSafepay\Connect\Model\Api\Objects;
+1 @MichielTG and @mazhalai
I tried setup:di:compile-multi-tenant
and I got the following error:
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 32 bytes) in /chroot/home/ozforest/ozforest.com/html/setup/src/Magento/Setup/Module/Di/Code/Scanner/PhpScanner.php on line 231
..still trying to figure it out...
try:
php -d set_time_limit=3600 -d memory_limit=1024M bin/magento setup:di:compile-multi-tenant
thanks! +1 @MichielTG !
here what we got:
[ReflectionException]
Class \Smartwave\Megamenu\Model\Attribute\SubcatColumns does not exist
setup:di:compile-multi-tenant [--serializer="..."] [--extra-classes-file="..."] [--generation="..."] [--di="..."] [--exclude-pattern="..."] [--magento-init-params="..."]
we'll contact our theme developers (Smartwave guys..)
@romeof1980 Let me know what they say. I have the exact same error message and they try to solve it since weeks now :(
ok @marcb85 !
let's stay in touch and post the updates here.
have a great day,
romeo
Find the file: SubcatColumns.php
Smartwave\Megamenu\Model\Attribute\SubcatColumns.php and add the line:
namespace Smartwave\Megamenu\Model\Attribute;
thanks @MichielTG
anyway in /app/code/Smartwave\Megamenu\Model\Attribute\SubcatColumns.php
the line
namespace Smartwave\Megamenu\Model\Attribute;
is already there (just after the opening php tag)
anyway really appreciate your help,
have a great day,
romeo
Same here. line is already there.
Next hint I've found:
running php Subcatcolumns.php
in /app/code/Smartwave/Megamenu/Model/Attribute produces this output:
PHP Fatal error: Class 'Magento\Eav\Model\Entity\Attribute\Source\AbstractSource' not found in /var/www/html/magento2/app/code/Smartwave/Megamenu/Model/Attribute/Subcatcolumns.php on line 4
I'm going to check now if the class exists which SubcatColums is referring to
@romeof1980
Can you check if the "Magento" folder in "app/code" does exist? For me it is not the case. But here it does exist: https://github.com/magento/magento2/tree/2.0/app/code
background information: This is the folder which should contain the class which SubcatColumns.php is trying to access.
@marcb85
same for me (same error and folder "Magento" not there)
I'm taking a look here:
http://magento.stackexchange.com/questions/91072/magento-2-where-is-app-code-magento-pool
in order to see if it can help better understanding our issue too
thanks a lot for sharing the steps you've been taking @marcb85
@romeof1980 have you heard something from the Smartwave guys, i'm facing the same issue you mentioned, any progress yet?
thanx,
Adil
hi @adilbenmoussa !
they answered and the problem is solved for us.
temporarily workaround: php magento deploy:mode:set production --skip-compilation
their answer:
Hi romeo
As Magento 2 cannot complete Porto compilaltion process at this time, so installation theme but skipping compilation is choosen.
Could you pls ignore compilation at this time. We will update it in upcomming version.
guess that will help.
have a great day,
romeo
thanx @romeof1980 for the quick reply and their answer, will try it out, hopefully they can fix the compilation issue it soon!
regards,
Adil
@MichielTG ,
@romeof1980,
At my site, we got this error while openning the categories management in admin.I renamed the file SubcatColumns.php to Subcatcolumns.php (do the same in the class name).
This fix also require disabling the cache to get the categories page work.
Still keep investigating!:)
This problem was solved in last release of Porto theme.
@sigismund Really, not this side
Most helpful comment
hi @adilbenmoussa !
they answered and the problem is solved for us.
temporarily workaround:
php magento deploy:mode:set production --skip-compilation
their answer:
guess that will help.
have a great day,
romeo