Support

Home Forums Event Espresso Premium PHP error in logs

PHP error in logs

Posted: March 29, 2016 at 9:20 am

Viewing 12 reply threads


wmnf

March 29, 2016 at 9:20 am

I came across some concerning errors in our php error log when debugging some new code not related to EE. There are several of these entries in the logs when saving a non-EE post in our admin area. They seem to appear when saving a Woocommerce order and I see other entries I am not sure to what they are related. I have some custom code when saving a Woocommerce (shop_order) post that always triggers these entries, but there are other same entries where that code is not executed. The lines are extremely long, this is the reading from my editor when cursor is placed on one of the entries….

line 1/13 (7%), col 1/2001402 (0%)

Here are the first many characters of the entries….

[29-Mar-2016 14:59:26 UTC] WordPress database error MySQL server has gone away for query INSERT INTO wp_options (option_name, option_value, autoload) VALUES (‘ee_core_routes’, ‘a:4:{s:10:\”ee/v4.8.29\”;a:322:{s:6:\”config\”;a:1:{i:0;a:3:{s:8:\”callback\”;a:2:{i:0;s:61:\”EventEspresso\\core\\librar…..

Can you suggest what may be triggering these entries? The MySQL db is on localhost, we are not experiencing any issues.


Lorenzo Orlando Caum

  • Support Staff

March 29, 2016 at 10:51 am

Hello,

I’m not sure what is triggering that and I can ask a developer for feedback.

Could you copy a few of the entries into a gist and then reply with that link here?

https://gist.github.com

The entire log isn’t needed but a few complete entries should be helpful.

Thanks


Lorenzo


wmnf

March 29, 2016 at 11:48 am

I had a very hard time getting only one entry into the Gist due to the content size. I had to separate into new lines and still hard to load, Gist truncated, but perhaps you can download…..

https://gist.github.com/wmnf/f0afc26b905c173a0066d50e72b1fcc7


Lorenzo Orlando Caum

  • Support Staff

March 29, 2016 at 1:33 pm

Thanks. I’m seeing some entries in there related to the rest api. Are you running the latest version of Event Espresso 4 on that site?

https://eventespresso.com/wiki/ee4-changelog/


Lorenzo


wmnf

March 30, 2016 at 7:05 am

We are running EE version 4.8.38.p


Josh

  • Support Staff

March 30, 2016 at 11:56 am

That’s normal activity for the REST API to record those options to the database. What’s not normal is it should only do it one time. Does it continue to try to write those options or has it stopped?


wmnf

April 11, 2016 at 5:24 am

It continues over and over, our logs getting huge.


Josh

  • Support Staff

April 11, 2016 at 12:15 pm

Can you try clearing the error log, then deactivate all of the plugins, then reactivate EE4, then reactivate the rest of the plugins?


wmnf

April 27, 2016 at 12:33 am

This seems to have worked to activate EE4 first after deactivating all plugins. The log entries have not happened since, however, I do notice this other error when editing an event in the admin:

[27-Apr-2016 06:30:38 UTC] WordPress database error Operand should contain 1 column(s) for query SELECT wp_posts.*, wp_p2p.* FROM wp_posts INNER JOIN wp_p2p WHERE 1=1 AND wp_posts.post_type = 'musicians' AND ((wp_posts.post_status <> 'trash' AND wp_posts.post_status <> 'auto-draft')) AND (wp_p2p.p2p_type = 'espresso_events_to_musicians' AND wp_posts.ID = wp_p2p.p2p_to AND wp_p2p.p2p_from IN (SELECT wp_posts.ID, wp_esp_event_meta.* FROM wp_posts LEFT JOIN wp_esp_event_meta ON ( wp_esp_event_meta.EVT_ID = wp_posts.ID ) WHERE 1=1 AND wp_posts.ID IN (78248) AND wp_posts.post_type = 'espresso_events' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'cancelled' OR wp_posts.post_status = 'postponed' OR wp_posts.post_status = 'sold_out' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC )) ORDER BY wp_posts.post_date DESC made by do_action('load-toplevel_page_espresso_events'), call_user_func_array, EE_Admin_Page_CPT->load_page_dependencies, EE_Admin_Page_CPT->_load_page_dependencies, EE_Admin_Page->_route_admin_request, call_user_func_array, EE_Admin_Page_CPT->_edit_cpt_item, include_once('wp-admin/edit-form-advanced.php'), do_meta_boxes, call_user_func, P2P_Box->render, P2P_Directed_Connection_Type->get_connected, P2P_Directed_Connection_Type->abstract_query, P2P_Side_Post->do_query, WP_Query->__construct, WP_Query->query, WP_Query->get_posts


wmnf

April 27, 2016 at 7:38 am

I spoke too soon, this morning I found many of the REST API related errors again. The size of the log already grown over 200MB.


Lorenzo Orlando Caum

  • Support Staff

April 27, 2016 at 10:54 am

Hello,

I’ve asked a developer for feedback on what is occurring here. Could you let us know the max_allowed_packet size that is set for MySQL?

https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_max_allowed_packet


Lorenzo


wmnf

April 27, 2016 at 10:58 am

MariaDB [(none)]> show variables like ‘max_allowed_packet’;
+——————–+———+
| Variable_name | Value |
+——————–+———+
| max_allowed_packet | 1048576 |
+——————–+———+
1 row in set (0.00 sec)


Brent Christensen

  • Support Staff

April 27, 2016 at 11:28 am

Hi wmnf,

I’m Event Espresso’s lead dev.

That last error that you posted above :

WordPress database error Operand should contain 1 column(s)

is because there is a column mismatch between the outer query and the inner query.

However, I don’t know how you can fix it because that query does NOT originate from within any EE code, but appears to have been built using the Post 2 Post plugin.

I don’t know if the query was built automatically by that plugin, or whether you or your dev had to manually construct it from within the plugin UI.

But anyways, here’s the basic problem with that query:
the subquery, which is the portion that begins at this point:

AND wp_p2p.p2p_from IN (
SELECT
  wp_posts.ID,
  wp_esp_event_meta.*
FROM wp_posts

is returning TWO columns of data:

SELECT
  wp_posts.ID,
  wp_esp_event_meta.*

but the outer query is expecting ONE column of data to search through for the value it is looking for:

AND wp_p2p.p2p_from IN ( // subquery )

So I’m guessing that you simply need to remove:

wp_esp_event_meta.*

from the subquery SELECT statement and then it should hopefully work.

If the query is built automatically, then you may need to contact the author of the Post 2 Post plugin and ask them how to modify that query.

  • This reply was modified 8 years, 4 months ago by Brent Christensen. Reason: too many tick marks for code tags
  • This reply was modified 8 years, 4 months ago by Brent Christensen. Reason: fix ticks again !
Viewing 12 reply threads

The support post ‘PHP error in logs’ 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