1

Just tried to run the auto-update to v3.0.0 and it failed catastrophically with the message:

Error: file_put_contents(/var/www/html/craftcms/composer.lock): failed to open stream: Permission denied

Now my control panel page has a "Finish Up" button that doesn't seem to do anything (the styling on the page is completely broken).

It also looks like Craft didn't take a backup, as my most recent backup is from RC4, back in January.

I'm not sure how to recover from this, if it's even possible, as the docs don't seem to have any useful information.

Any help would be appreciated.

UPDATE

Following Brad's instructions below (thanks Brad!), I found that my composer.json file had the version set to 3.0.0-RC5 (I guess the RC4 backup is the most recent after all--I thought I was on a later version).

I tried running composer update but now I'm getting the following error:

Problem 1 - Installation request for craftcms/cms 3.0.0-RC5 -> satisfiable by craftcms/cms[3.0.0-RC5]. - Conclusion: remove roave/security-advisories dev-master - craftcms/cms 3.0.0-RC5 requires yiisoft/yii2 ~2.0.13.0 -> satisfiable by yiisoft/yii2[2.0.13, 2.0.13.1, 2.0.13.2, 2.0.13.3]. - yiisoft/yii2 2.0.13 conflicts with roave/security-advisories[dev-master]. - yiisoft/yii2 2.0.13.1 conflicts with roave/security-advisories[dev-master]. - yiisoft/yii2 2.0.13.2 conflicts with roave/security-advisories[dev-master]. - yiisoft/yii2 2.0.13.3 conflicts with roave/security-advisories[dev-master]. - Installation request for roave/security-advisories dev-master -> satisfiable by roave/security-advisories[dev-master].

I also tried setting my version to RC4 in composer.json but got the same result.

Should I just remove roave/security-advisories from composer.json and try again?

Please excuse my ignorance--I have approximately zero experience with Composer.

1

1 Answer 1

0

Error: file_put_contents(/var/www/html/craftcms/composer.lock): failed to open stream: Permission denied

Whatever user:group PHP is running as on your server doesn't have the permissions to write to /car/www/html/craftcms

It also looks like Craft didn't take a backup, as my most recent backup is from RC4, back in January.

Craft will only do a backup during updating if mysqldump or pg_dump is available to PHP (by default), or if your custom backupCommand config setting executes successfully.

If Craft can't make a backup during updating, it will halt the update process and prompt you asking what you'd like to do with one of the options being to continue without making a backup.

I'm not sure how to recover from this,

To restore the Craft files to the previous version, you can open your project's composer.json file, find the craftcms/cms line, set the version to the pre-update attempt version, then run composer update from the command line.

If there were no database migrations that ran during the update attempt, that should be all you need to do.

If there were database migrations that ran, you'll probably get an message when you try to access the Control Panel saying that you can't backtrack to that version of Craft because now the database is out of sync with the files.

The only practical way around that is to restore from a pre-update attempt database backup.

1
  • Thanks Brad, I figured there had to be a way to roll back but couldn't find anything in the docs. I still don't have it working (see update in my original post), but at least some progress! Commented Apr 13, 2018 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.