-
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
Magento 2.1 RC1 - Error when running CLI upgrade command #4795
Comments
@toddwolaver why would you run compile before upgrade? Also, if you are installing a fresh 2.1.0-rc1 why do you need to run upgrade? did you have an older code base? |
@mazhalai The steps in this issue only illustrate the basic steps to recreate the error. In a real world example, this would be run on a production deployment of an existing codebase. I run upgrade, compile DI and generate static assets off of the production server, move the updated codebase with generated files into place on production and re-run the upgrade with --keep-generated to update the production database. With the current error introduced in 2.1 RC1, this process is no longer viable. |
@toddwolaver in this case, you will need to clear your var/generation and var/di manually before pushing to the server, since the previous generated files still exist and are no longer relevant since the code has been updated. |
@mazhalai Just to be clear, are you saying that in Magento 2.1 'setup:upgrade' will no longer be supported after DI has been compiled? If so, I would recommend updating the error message and removing the --keep-generated option from setup:upgrade, since it now serves no purpose (i.e. to keep the previously generated files) The process of building a production 'image' 'off site' minimizes the amount of processing needed in the production environment and limits need to put the production environment into maintenance mode during code deployments. The files are relevant since they were compiled against the updated codebase, just on a different server. However there is still need to update the production database after moving the production 'image' into place in the production environment, hence the need to run 'setup:upgrade --keep-generated' with the compiled files in place. Thank you, |
@toddwolaver No, what I mean is, setup:upgrade will not work with |
Thank you @mazhalai I still get an error when running 'php bin/magento setup:upgrade'. The only way to resolve the error is to manually remove var/di Thank you,
|
@toddwolaver what version were you on prior to rc1? Also, can you give us more info on your environment like web server, php version, etc. |
@toddwolaver we have created ticket MAGETWO-53777 to investigate and fix. |
@mazhalai I had been using 2.0.7 prior to RC1 Environment details:
|
Same problem here. ( 2.1-RC2 ) on production deploy. ( Development local copy works with no di compilation ). Environment:
2.0.7 worked, upgraded to RC2 and now fails. The commands i run:
Log:
|
@maksek @pboisvert This is a critical bug which I'm rather shocked was not addressed before the release of the GA for 2.1. It was reported nearly a month ago, and kills the ability to do fast atomic deployments of code either by capistrano, imaging, etc, etc. When can we expect to see this fixed? All deployments via the capistrano-magento2 Gem are now busted, and there is not really a good workaround, as running setup:upgrade on a production server before setup:di:compile is run on the new code is not very feasible, as it would mean having a site in maintenance mode while the compilation (which takes ~3 min) runs. |
We also run into this now, like wth? @ Magento guys, do you even know how people are deploying Magento 2 shops to a production server? I keep getting the impression you haven't got the faintest idea about how this works. Would also be great if you could write some documentation about how to do this according to you, because we have to keep guessing what steps in what order we have to execute, it seems to change with every release you are putting out ... |
@davidalger @hostep bug has been raised to P0 and folks are reviewing. We will investigate why not addressed for RC. Early comments indicate cause was known and a fix was available but that fix did not pass testing and bug sat with the lower priority in error so it was not flagged as a blocker for 2.1. |
I found a temporary fix for this issue. If you can't wait until Magento comes with an update for this issue, you can follow these steps to fix it. My solution makes sure a This involves creating a very small module with the following files:
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Vendor_TempSetupDiCompileFix',
__DIR__
);
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_TempSetupDiCompileFix" setup_version="0.0.1"/>
</config>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Framework\App\AreaList">
<arguments>
<argument name="areas" xsi:type="array">
<item name="setup" xsi:type="array">
<item name="frontName" xsi:type="string">temporary-fix-for-magento2-github-issue-4795</item>
</item>
</argument>
</arguments>
</type>
</config> And then run bin/magento module:enable Vendor_TempSetupDiCompileFix The |
same problem here! |
Having this issue as well on the release of 2.1. Is there a way to have a production server without the need for some sort of build server to compile on? Ideally I'd like to for example: With no down-time on the production server. |
@rob1256: When they fix this issue, it will be possible :) We've been using it for a couple of days, and deploys work again. They take around 8 minutes (way too long in my opinion), with only about 10 seconds of downtime (also too long), while we put the shop in maintenance mode just before running On the devdocs project, there is also a request for proper documentation about how to perform deploys, but it hasn't been adressed yet: magento/devdocs#419 |
@hostep: Thanks for your help :) |
@pboisvert It's been seven days since this was moved to P0, but no communication regarding timeline of fix, so I figured I'd check back in on this. Can you comment on about how soon we can expect a patch release which resolves this? |
We now have the same problem, which keeps us blocked from upgrading to 2.1. Is there any eta available? |
Same problem here, this really is an issue. |
@mazhalai do you have a solution for us? we can´t go live with this... |
Getting the same issue, when will this be fixed? |
Same issue and cannot migrate without this command |
Same problem here, can we get an update please @pboisvert ? |
Same issue here as well on 2.1. The module that @hostep put together does seem to get around it but this appears to be a core issue that needs to be resolved. It would be nice to see Magento 2 in a more stable and usable state. |
same |
I've added the temporary fix from @hostep to my magento installation, but i think there is a other way to fix this problem. Simply disable en re-enable a (random) module for example: |
I had this issue. Set developer mode, run upgrade command and it started working. However I haven't moved to a production status yet- |
@rhiensch Thanks, your solution worked for me! |
@stevekem No problem, i've been searching for hours and i finally found that this is the best solution. Glad it helped you! |
@rhiensch thanks your workaround worked for me as well. 👍 |
Thanks, all, for the many solutions offered here. Simply "rm -rf var/di" worked for me as noted by @yokoishioka and @karl-ravn and elsewhere by @antbates1991 bug issue here: #5954 |
Hi, the issue has been solved in 2.1.1, so closing the ticket. If you have some additional comments, please feel free to reopen if needed. |
Tnx @elenleonova for releasing version 2.1.1 so swiftly (please ignore the sarcasm 😉 ) @ everyone who used my temporary fix:
So my advice to everyone who has been using my temporary fix is that before you upgrade to version 2.1.1, you do these things:
|
Thx @elenleonova, was the bugfix applied to the enterprise version as well? |
I did the fix.
SELECT * then, re run the magento cammand sudo ./magento setup:upgrade and it works for me. |
I'm getting a similar error when running
Did anybody ever find a workaround for this? |
@thdoan That's not related to this issue, but I have encountered that as well. That command expects a composer.json for your modules, even when it's just in your |
It is UNBELIEVABLE how unstable these deployment and setup processes are. I am curious how people are suppose to deploy any updates to this platform with any level of confidence. |
@esakki08 First, try running the commands from your root folder where you have magento installed. Is C:\xampp\htdocs\mtgo where you have magento installed? |
@Ctucker9233 yes "C:\xampp\htdocs\mtgo" is the my magento root folder. |
@esakki08 this is not the right place for your question. Try the forums or StackExchange. This place here is for bug reports. |
@pantaoran: If you suggest the links, would be better. The application is keep on crashing.... |
@esakki08 Try running the commands using php56 or php70 depending on your php version. |
On my side, the module have been enabled with the
|
This worked for me in Magento 2.1.7 : The -m means that Magento should parse all its files (without -m, only the specified directory is parsed). |
Simply replace the magento file in bin directory with the new one and run the following command on magento file if your host is linux: sudo chmod u+x bin/magento Note: Before running bash command make sure your current working directory must be Magento 2.x root. |
Please run below commands and check it like |
[TSG] Fixes for 2.3 (pr67) (2.3-develop)
Attempting to run setup:upgrade after compiling DI results in an error. I have tried with just 'setup:upgrade' and 'setup:upgrade --keep-generated'.
Steps to reproduce
Expected result
Actual result
Note: contents of var/di are:
The text was updated successfully, but these errors were encountered: