Support

Home Forums Event Espresso Premium EE causes a fatal error updating from to 5.0.7 to 5.0.9.p

EE causes a fatal error updating from to 5.0.7 to 5.0.9.p

Posted: August 17, 2023 at 9:02 am

Viewing 13 reply threads


chcc

August 17, 2023 at 9:02 am

Update 5.0.8p crashed my whole site causing several hours of downtime and now 5.0.9p causes a fatal error. Really?

The error I’m getting now is:

An error of type E_COMPILE_ERROR was caused in line 25 of the file /home/charmouthorg/YW7XT21G/htdocs/chcc/wp-content/plugins/event-espresso-core-reg/core/db_models/relations/EE_Belongs_To_Any_Relation.php. Error message: Declaration of EE_Belongs_To_Any_Relation::get_join_statement(string $model_relation_chain): string must be compatible with EE_Belongs_To_Relation::get_join_statement($model_relation_chain)

Please tell me how I can fix this.


Tony

  • Support Staff

August 17, 2023 at 9:13 am

Hi there,

That error is telling you that something is overriding a method within core but isn’t compatible and needs to be updated.

Do you have the full stack trace? The above doesn’t have enough data to narrow down what the cause is.


chcc

August 17, 2023 at 9:35 am

Thanks Tony,

Where would I find the full stack trace?


Tony

  • Support Staff

August 17, 2023 at 10:30 am

Normally it would be shown with the above error but you may need to enable WP_DEBUG:

https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug


chcc

August 17, 2023 at 11:00 am

Thanks Tony,

Needless to say, the full stack trace wasn’t included otherwise I would have shared it. I’ll enable debug tomorrow and get back to you.

Just for the record, I’ve never experienced so many errors and complications with any other WP plugin as I have with Event Espresso, and I’ve been using WordPress for over fifteen years.


Tony

  • Support Staff

August 17, 2023 at 2:06 pm

Just to note, I’ve just checked the latest zip file to confirm the function signature (which is what is throwing the fatal above) and I can’t see anywhere within the latest update that declares get_join_statment() differently.

This is searching the entire EE core plugin codebase:

https://monosnap.com/file/BWA7Wh3ZxloBHsSNiebjaKt6DP2A6U

The file is declared 7 times across its classes, and the signature for all of those match:

function get_join_statement(string $model_relation_chain): string

The error you are getting states that EE_Belongs_To_Relation::get_join_statement($model_relation_chain) is missing the string declaration within EE_Belongs_To_Relation, but that’s the second function returned in my search and it matches.

How did you update Event Espresso on the site? Using FTP or via the plugins menu?

Looks like either the update hasn’t replaced all the files or something else on that site is also overriding a get_join_statement() method somewhere but I need the full stacktrace to be able to narrow this down further.


chcc

August 18, 2023 at 3:02 am

Thanks Tony,

I usually update in batches via the updates page but this time I did it from the plugins page. The ‘fatal error’ email that I got from WordPress only had the error message I’ve quoted, no stack trace.


chcc

August 18, 2023 at 3:05 am

To be clear, we are not getting any error messages on the site at all and everything appears to be working fine and we are still getting bookings via EE.


Tony

  • Support Staff

August 18, 2023 at 7:44 am

Oh so you got a single email showing the fatal?

Are you running any caching? PHP8 using opcache?

If you are not getting any fatals on the site now this was likely from a cached object. That compile error would normally be thrown instantly if the code in question was still running, so if it EE is working (those relationships run all over the place) then that would be my best guess as to what happened above currently.


chcc

August 18, 2023 at 7:55 am

We are not running any caching and we are using PHP 7.4.33.


Tony

  • Support Staff

August 18, 2023 at 8:31 am

Then I’m at a loss as to where that fatal is from without the stack trace.

Do you have access to the PHP error logs within your host’s control panel? It may show the full stack trace in that but depends on what your host has set to log.


chcc

August 18, 2023 at 10:45 am

Thanks Tony,

I looked in the error log above the root but there was nothing useful in it so I have raised a support ticket with the hosts in the hope that they can access the PHP error log and that it has recorded a full stack trace.

I’ll get back to you as soon as I hear back from them.


chcc

August 18, 2023 at 12:57 pm

My hosts don’t hold a master log of PHP errors, so as this ‘fatal’ error only occurred during an update they advise that I manually update/overwrite with the latest plugin files via FTP. However, as I understand it from one of your previous answers, the fatal error was in the database update, not in the files.

Given that I have no visible errors and that the plugin appears to be functioning fine, is there anything to be gained by overwriting the files manually?

Thanks in advance.


Tony

  • Support Staff

August 18, 2023 at 1:11 pm

My hosts don’t hold a master log of PHP errors, so as this ‘fatal’ error only occurred during an update they advise that I manually update/overwrite with the latest plugin files via FTP.

This would be literally the last thing I would advise.

Overwriting plugins via FTP it messy, too many people try to copy/replace (which actually sounds like what is being recommended with ‘overwrite’ here) and it causes more errors.

Just to clarify for anyone reading, when updating via FTP you need to delete the original plugin directory and then extract the new one in its place, that’s what WP core does.

So to give an example you would actually delete /wp-content/plugins/event-espresso-core-reg/

Then extract the event-espresso-core-reg directory out of our .zip file into /wp-content/plugins/. My advice is to never overwrite an existing plugin with a new update but delete and replace it. Files move, files change names, overwriting and replacing on the fly will at some point cause you issues.

However, as I understand it from one of your previous answers, the fatal error was in the database update, not in the files.

No it’s a compile error, so most likely was from a file at some point but where I have no idea.

There isn’t an EE database update between 5.0.8 and 5.0.9 (we call them migrations), those will only happen with major or minor version bumps, 4.X.X -> 5.X.X or 5.0.X -> 5.1.X, never a ‘patch’ like 5.0.8 -> 5.0.9.

Given that I have no visible errors and that the plugin appears to be functioning fine, is there anything to be gained by overwriting the files manually?

Not in my opinion, no.

I’d like to tell you what caused it, but there just isn’t enough info to do so unfortunately, we’ve not had any other reported of that error and as its a compile error it would be widespread if it was from the update itself.

Viewing 13 reply threads

The support post ‘EE causes a fatal error updating from to 5.0.7 to 5.0.9.p’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso