0

I'm pretty stuck trying to update Craft (from 3.1.10 to 3.1.24). It used to work previously, but this time I tried a few times using the updator in CP, it always stops at this point:

Status: Internal Server Error

Response: {"nextAction":"server-check","status":"Checking server requirements…","data":"a89d07690b497785aed12b2fd3415823ba51f3da46c8185fd04fbecce67535e7{\"install\":{\"craft\":\"3.1.24\"},\"current\":{\"craftcms/cms\":\"3.1.10\"},\"requirements\":{\"craftcms/cms\":\"3.1.24\"},\"reverted\":false,\"returnUrl\":\"utilities/updates\",\"postPrecheckState\":{\"nextAction\":\"composer-install\",\"status\":\"Updating Composer dependencies (this may take a minute)…\"}}"}

web.log doesn't give me much information, but phperrors.log says:

PHP Fatal error:  Uncaught Error: Call to undefined method yii\helpers\StringHelper::mb_ucwords() in C:\wamp\www\mysite\vendor\yiisoft\yii2\helpers\BaseInflector.php:378
Stack trace:
#0 C:\wamp\www\mysite\vendor\yiisoft\yii2\base\Model.php(691): yii\helpers\BaseInflector::camel2words('photoId', true)
#1 C:\wamp\www\mysite\vendor\yiisoft\yii2\base\Model.php(525): yii\base\Model->generateAttributeLabel('photoId')
#2 C:\wamp\www\mysite\vendor\craftcms\cms\src\base\Element.php(948): yii\base\Model->getAttributeLabel('photoId')
#3 C:\wamp\www\mysite\vendor\yiisoft\yii2-debug\src\panels\UserPanel.php(271): craft\base\Element->getAttributeLabel('photoId')
#4 C:\wamp\www\mysite\vendor\craftcms\cms\src\debug\UserPanel.php(25): yii\debug\panels\UserPanel->save()
#5 C:\wamp\www\mysite\vendor\yiisoft\yii2-debug\src\LogTarget.php(60): craft\debug\UserPanel->save()
#6 C:\wamp\www\mysite\vendor\yiisoft\yii2-debug\src\LogTarget.php(130): yii\debug\LogTarget->export()
#7 C:\wamp\www\mysite\vendor\yiisoft\yii2\log\Dispatcher.php(189): yii\debug in C:\wamp\www\mysite\vendor\yiisoft\yii2\helpers\BaseInflector.php on line 378

If I go to /admin now it does work and ask me to finish up the db changes. It does sound like file changes are complete, but there was something wrong doing server checks? Or is it possible that some file changes might still be missing?


It does look like the Yii file is not up to date or something from the error log, so I assume my composer is messed up somehow. I tried reverting the changes manually and then do composer update. It finished without error, but this time /admin is broken, giving twig compile error. So I guess that doesn't work.


Okay, revert things back again...and then I tried nuke the /vendor folder completely and then replace it by the /vendor folder of the latest Craft download, but keep composer.json and composer.lock, then run craft update/install-composer. I don't quite remember what happened here, I think it worked, but the Craft version still shows 3.1.10 in CP. After that, I updated composer.json to change the required Craft version number to 3.1.24 and then run composer update. This time it seems to work, but so far I found one place of the site where I use pagination gives errors:

craft\db\Paginator.php: Cannot use yii\db\Query as Query because the name is already in use. At Line 13 - use yii\db\Query;.

Now I'm not sure if it's because the Craft files are still corrupted, or it's a bug of the new version.


Also, I tried reverting everything back, and then use craft command line to update by running craft update, but interestingly, it tells me: You're all up-to-date!


So, is there anything else I can try, or was I very close to finish at some point?


Posting my composer.json file here:

{
  "minimum-stability": "dev",
  "prefer-stable": true,
  "require": {
    "craftcms/cms": "3.1.10",
    "vlucas/phpdotenv": "^2.4.0",
    "nystudio107/craft-seomatic": "3.1.42",
    "spicyweb/craft-neo": "2.2.3",
    "craftcms/contact-form": "^2.2",
    "verbb/field-manager": "2.0.5",
    "sebastianlenz/linkfield": "1.0.17",
    "aelvan/inlin": "^2.1",
    "anubarak/craft-relabel": "1.2.2",
    "craftcms/redactor": "2.3.1",
    "verbb/super-table": "2.1.7",
    "mikestecker/craft-videoembedder": "1.1.1",
    "superbig/craft-entry-instructions": "1.0.4",
    "trendyminds/visor": "2.0.5",
    "lewisjenkins/craft-dynamic-fields": "3.0.6",
    "barrelstrength/sprout-forms": "3.0.0-beta.44",
    "barrelstrength/sprout-fields": "3.2.3",
    "barrelstrength/sprout-forms-google-recaptcha": "1.0.3",
    "barrelstrength/sprout-reports": "1.1.2",
    "supercool/tablemaker": "^2.0",
    "doublesecretagency/craft-cpcss": "2.1.0",
    "aelvan/imager": "v2.1.8.1",
    "verbb/image-resizer": "2.0.4"
  },
  "autoload": {
    "psr-4": {
      "modules\\": "modules/"
    }
  },
  "config": {
    "optimize-autoloader": true,
    "platform": {
      "php": "7.0"
    }
  },
  "scripts": {
    "post-root-package-install": [
      "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ]
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.