[3.x]: ./craft install handles errors poorly
What happened?
Description
./craft install fails on the "applying existing project config ... " step. The only way I've found to fix this is to go to another instance of the site (eg. one of my colleague's development versions), rebuild the project yaml and commit the changes.
Once I've got the new yaml files, I run ./craft install again but it says "Craft is already installed!" and exits, but the site does not work as
- there's no security key
- the project config has not been synced from the yaml
- there is no default admin
- default pages don't exist
I also found that I could not create a homepage (after manually creating a security key, user, and syncing the config) as none of the "Singles" sections appeared under entries where the homepage would normally be configured.
Steps to reproduce
- Clone a project
- run
./craft install. This almost always fails in my experience but i'm hoping if I start manually running./craft project-config/rebuildevery time I change something in the settings it will fix it. - fix the project config
- run
./craft installagain
Expected behavior
If ./craft install fails once and you rerun it, it will check if it needs subtask individually and execute them if required
Actual behavior
./craft install skips all subtasks regardless of if they need running
Craft CMS version
5.7.44
PHP version
7.4
Operating system and version
php:7.4-apache
Database type and version
mysql:latest
Image driver and version
n/a
Installed plugins and versions
From project.yaml
- buttonbox
- cp-css
- cp-field-inspect
- cp-js
- embedded-assets-link
- embeddedassets
- expanded-singles
- formie
- imager-x
- instagramfeed
- linkit
- neo
- recaptcha
- redactor
- seomatic
- tablemaker
from composer.json
"codemonauts/craft-instagram-feed": "1.1.8",
"craftcms/cms": "3.7.44",
"craftcms/fix-fks": "^1.0.2.1",
"craftcms/redactor": "2.10.8",
"doublesecretagency/craft-cpcss": "2.4.0",
"doublesecretagency/craft-cpjs": "2.4.0",
"fruitstudios/linkit": "^1.1.12.1",
"marionnewlevant/embedded-assets-link": "^1.0.3",
"matt-west/craft-recaptcha": "1.5.3",
"mmikkel/cp-field-inspect": "1.4.4",
"nystudio107/craft-seomatic": "3.4.31",
"spacecatninja/imager-x": "v3.5.8",
"spicyweb/craft-embedded-assets": "2.10.7",
"spicyweb/craft-neo": "2.13.11",
"verbb/buttonbox": "3.0.0",
"verbb/expanded-singles": "1.2.0",
"verbb/formie": "1.5.19",
"verbb/tablemaker": "3.0.0",
"vlucas/phpdotenv": "^3.4.0"
Did you catch the actual error that occurred? It may still be in your logs (storage/logs/console.log and subsequent files – search for [error]). Please check and post the full error message and stack trace, if you can find it.
I will try to organize some time to reproduce this and get the log