[3.x]: ./craft install handles errors poorly
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
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"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with ./craft install, then compare its behavior with ./craft project-config/rebuild and the listed post-failure state. Trace which install subtasks are skipped on a second run; done means rerunning install executes each required subtask and restores the security key, project config, default admin, and default pages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- backend, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100