Closed alexr8 closed 2 years ago
Do you have the composer.json
and composer.lock
files from before this happened? If so please post them here or send them into support@craftcms.com, and we can try to reproduce from there.
I manually upgraded from craft 3 to craft 4, editing each plugin in turn in the composer file. Plugins all installed fine although some plugins had bugs (that didnt hinder the installation at least). After this point, running update via the CLI brings the above issues. Unsure if it could be one of the plugins that is blocking the migrations running?
I ran into the same issue while updating vom 4.0.2 to 4.0.4 using nitro php craft update craft
.
@JansonChe did you find a workaround at all?
I'm getting the same error trying to update any plugin on a 3.7.43
install.
@JansonChe did you find a workaround at all?
Not really, no, I just rolled back to the version that was working (vendor folder deleted and dependencies re-installed). Because this update is not a critical/urgent one for my project, I've decided to wait and check for progress on this issue. How about you @alexr8 ?
Same problem! Migrations do not work. I have been waiting for over half an hour for something to happen. However, I still get the following message on the console.
Currently I can not recommend to upgrade to Craft4!
@christophstockinger That looks like a separate issue. (This one affects Craft 3 and 4, and is Composer-specific, not a v4 migration issue.) Please either post as a new issue here, or get in touch via support@craftcms.com.
@adrienpicard Is your local development environment Nitro as well?
@angrybrad no I should have said sorry, it's a homebrew PHP / MariaDB install running on macOS.
PHP version 8.1.5
Operating system and version macOS 12.3.1
Database type and version MariaDB 10.6.4
I'm not able to reproduce locally or with @alexr8's files, unfortunately.
Any chance anyone can replicate this on a public box we can get some SSH/Craft control panel access to?
@angrybrad I'm working on a few projects at the moment but am only facing this issue with one. All Craft 3.7.* installs, all using the same dev environment. Happy to share more details if that helps.
@angrybrad @alexr8 Hmmm I have two projects that where very similar in their environment and versions, but only one had this problem when trying to update. While comparing the two composer.json files the only real difference was:
"config": {
"allow-plugins": {
"craftcms/plugin-installer": true,
"yiisoft/yii2-composer": true
},
}
The failing project was missing these lines, but it added only "craftcms/plugin-installer": true
when updating with: nitro php craft update craft
. But when I manually added "yiisoft/yii2-composer": true and tried running the update again, it worked. I'm not sure why and how, but maybe it's a hint?
@JansonChe @angrybrad can confirm manually adding "yiisoft/yii2-composer": true
to my composer.json
file fixed the issue for me too.
@angrybrad i've made some progress in that I:
craft update all
/admin
and clicked the 'finish up' button to apply necessary database changes, and these were made successfully. As there are currently no new updates available as i've just installed the latest, i can't test whether php craft update all
will now work, but potentially it might? If not I'll give @JansonChe suggestion a whirl.
edit: seeing that the "yiisoft/yii2-composer": true
is default in new craft 4 installs composer.json i'll go ahead and add it anyway as i guess it should in there.
Was getting the same issue. When running an update for Craft or any plugin I got an undefined error. Adding "yiisoft/yii2-composer": true under config in composer.json fixed this for me too.
I’ve just updated Craft’s internal Composer commands to ensure that yiisoft/yii2-composer
is enabled in composer.json
before triggering Composer.
That change is out now in 3.7.45.2 and 4.0.5.2, however it won’t kick in until you’re already running at least one of those Craft versions.
Sorry to bring this up again.
Actions: trying to update local
Error: A fatal error has occurred: Status: undefined, Response: undefined
Important notes:
allow-plugins
config setting in the composer file
"allow-plugins": { "craftcms/plugin-installer": true,"yiisoft/yii2-composer": true}
Hey @kellyannmcnamara01! Check storage/logs/phperrors.log
. Anything reported in there, with about the same timestamp as when the error occurred?
What happened?
Description
When running
php craft update all
orphp craft update handle
, an error is encountered that breaks the site. The error in terminal is:error: The command "'/usr/local/bin/php' '/app/craft' 'migrate/all' '--no-backup' '--no-content'" failed.
(more output below)When loading pages on the front-end, the following error is displayed:
Not instantiable – [yii\di\NotInstantiableException](http://www.yiiframework.com/doc-2.0/yii-di-notinstantiableexception.html) Failed to instantiate component or class "yii\shell\Bootstrap". ↵ Caused by: ReflectionException Class "yii\shell\Bootstrap" does not exist
To fix, i restore the database, delete my vendor folder, and run
composer install
to restore to its previous state.Steps to reproduce
php craft update
on all plugins or a single plugin (doesn't appear to matter which one) from the terminal.Expected behavior
The plugin(s) should be updated to the latest version.
Actual behavior
The update fails with the following readout (full):
`Backing up the database ... done Performing update with Composer ... done Applying new migrations ... error: The command "'/usr/local/bin/php' '/app/craft' 'migrate/all' '--no-backup' '--no-content'" failed.
Exit Code: 1(General error)
Working directory: /app
Output:
Craft CMS version
4.0.3
PHP version
8.0.11
Operating system and version
Nitro
Database type and version
MySQL 8.0
Image driver and version
No response
Installed plugins and versions
"craftcms/aws-s3": "2.0.1", "craftcms/cms": "^4.0.0", "craftcms/feed-me": "5.0.4", "craftcms/redactor": "3.0.0", "hybridinteractive/craft-position-fieldtype": "4.0.0-beta.3", "leowebguy/mix-manifest": "1.0.1", "mmikkel/retcon": "2.4.2", "nystudio107/craft-cookies": "4.0.0", "nystudio107/craft-seomatic": "4.0.0", "percipiolondon/craft-tweet-feed": "4.0.0", "putyourlightson/craft-sprig": "2.0.1", "sebastianlenz/linkfield": "2.1.3-rc", "solspace/craft-freeform": "4.0.0-beta.8", "solspace/craft3-calendar": "4.0.0-beta.4", "spacecatninja/imager-x": "4.0.1", "spicyweb/craft-embedded-assets": "3.0.1", "verbb/image-resizer": "3.0.0-beta.1", "verbb/knock-knock": "2.0.0-beta.1", "verbb/super-table": "3.0.0-beta.4", "vlucas/phpdotenv": "^3.4.0"