cms icon indicating copy to clipboard operation
cms copied to clipboard

[3.x]: ./craft install handles errors poorly

Open OldStarchy opened this issue 3 years ago • 2 comments

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

  1. there's no security key
  2. the project config has not been synced from the yaml
  3. there is no default admin
  4. 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

  1. Clone a project
  2. run ./craft install. This almost always fails in my experience but i'm hoping if I start manually running ./craft project-config/rebuild every time I change something in the settings it will fix it.
  3. fix the project config
  4. run ./craft install again

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"

OldStarchy avatar Jun 14 '22 02:06 OldStarchy

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.

brandonkelly avatar Jun 14 '22 11:06 brandonkelly

I will try to organize some time to reproduce this and get the log

OldStarchy avatar Jul 05 '22 01:07 OldStarchy