Fatal Error when deploying into production

Hello

My site went down completely when I tried deploying from Staging to Production.

I contacted WP Engine to restore it to the original point. They said they are seeing the following:

PHP Fatal error: Cannot redeclare class Cornerstone_Shortcode_Generator in /nas/content/live/tatyanakozh/wp-content/plugins/cornerstone/includes/classes/classic/builder/class-shortcode-generator.php on line 2585
You can see the error as well in the error logs section of the install
6:03 pm
Its trying to redeclare that class in that file.

Please help: I don’t understand what it means and how it can be fixed?

This is the staging environment:

This is Production:

Please be quite specific as I am not a techie.

Thank you!

Hi there,

I have just browsed through the production site and it seems to be identical to the staging site now.

Were you able to get this sorted?

Hello

I have a staging site that is awaiting to be deployed into production.

I have attempted the deployment twice and it failed completely.

I am not sure what it was, but wp-engine told me that they could see the following:

PHP Fatal error: Cannot redeclare class Cornerstone_Shortcode_Generator in /nas/content/live/tatyanakozh/wp-content/plugins/cornerstone/includes/classes/classic/builder/class-shortcode-generator.php on line 2585
You can see the error as well in the error logs section of the install
6:03 pm
Its trying to redeclare that class in that file.

As of now I have not deployed it into production as it won’t work - what is the issue?

How can it be resolved?

Kind Regards,
Tatyana

Hi @tatyana.kozh,

Reinstall your setup with the latest updates.

Updating guide: https://theme.co/apex/forum/t/setup-updating-your-themes-and-plugins/62

If you are using pro, make sure to delete Cornerstone plugin directory which can be located here.

/public_html/wp-content/plugins/ cornerstone /

Let us know how it goes.

Thanks.

Hello

I am sorry, but I am really struggling here… please help me a bit further!

As per your suggestion:
I have updated Cornerstone. I tried deploying the site from Staging to Production again, I still got white screen and the website just was not there. So I reverted to the old version.

What I don’t understand is how come it does work perfectly fine in Staging and fails when I deploy into Production?!

Staging: https://tatyanakozh.staging.wpengine.com
Production: https://theartefact.com

Something silly is that I don’t understand if I am using Pro version or what it is… and if I delete Cornerstone, what do I need to install in its place?!

Once again, this seems to be the issue:
PHP Fatal error: Cannot redeclare class Cornerstone_Shortcode_Generator in /nas/content/live/tatyanakozh/wp-content/plugins/cornerstone/includes/classes/classic/builder/class-shortcode-generator.php on line 2585

But having read dozens of blogs on the Apex and following your suggestions, I still don’t understand what I need to do to make it successful in Production…I don’t understand why it works very well in Staging…How can I implement it in Production without getting the white screen?

PLEASE HELP!!!

I will provide my login credentials. Could you please kindly write a detailed solution to the issue? Or perhaps implement it directly… I am completely lost… ;((((

In the meantime one of the users was suggesting to delete all the files in Production and reupload them anew from Staging…I have done that - still nothing is working

oh goodness mee…

I resolved the issue…

I first updated all plugins in Live…

Then pushed from Staging into Live and now it is working…

god know why it had to be done that way…

When you last updated Cornerstone, did you use automatic updates or update manually? If you did an FTP update and replaced files instead of fully deleting the old version, you could have ended up with duplicate files which would cause that error. It’s likely that whatever you did to redeploy involved deleting that folder and using fresh files.

Or, if you deleted Cornerstone at any point and visited the X Overview page in the dashboard Cornerstone would have been reinstalled automatically which would have corrected the issue.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.