wp-graphql / wp-graphql-acf

WPGraphQL for Advanced Custom Fields
https://wpgraphql.com/acf
626 stars 123 forks source link

Fatal Error #131

Closed design-on-tap closed 11 months ago

design-on-tap commented 4 years ago

@jasonbahl We started getting this error recently -

NOTICE: PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/wp-content/plugins/wp-graphql-acf-develop/src/class-config.php on line 915

Have you seen this before? Looks to be something with repeater fields but not entirely sure.

jasonbahl commented 4 years ago

@design-on-tap can you share your ACF fields exported as JSON?

Are you using Clone fields by chance?

design-on-tap commented 4 years ago

JSON file is fairly large so you can view here. Yes, we are using Clone fields. But, everything was working fine for 3-4 weeks until last night. I'm asking our dev team if anyone added new fields.

jasonbahl commented 4 years ago

Ok, ya I think there's a bug with how Clone fields are handled. I'm trying to pin it down.

design-on-tap commented 4 years ago

Awesome! Let me know if there is any way that I can help.

design-on-tap commented 4 years ago

So I deleted our WP theme and re-uploaded. It appears to be working now. We use automatic deployment of our repo to staging and JSON sync for ACF. Some fields were edited last night and I wonder if that screwed something up.

jasonbahl commented 4 years ago

@design-on-tap interesting 🤔

I still think there is still likely a clone field issue at play. I've had this memory issue reported only 3 times (including your report) and clone fields were used in all cases.

design-on-tap commented 4 years ago

@jasonbahl Any update on this? Issue cropped up again for us.

adriandmitroca commented 4 years ago

Just started facing the same issue. I'm not using Clone field at all, things broke after adding 3 new layouts in Flexible Content field.

adriandmitroca commented 4 years ago

Extra insight: I have noticed that it sometimes crash in class-config.php file (like mentioned in the first comment), but sometimes also here:

Fatal error: Allowed memory size of 805306368 bytes exhausted (tried to allocate 16384 bytes) in /wp-content/plugins/wp-graphql/src/Registry/TypeRegistry.php on line 697

adriandmitroca commented 4 years ago

Not sure if this is actually related, but after quick investigation I found out that memory issue kicks in when there's a layout inside Flexible Content that doesn't have any fields in it.

Probably because of some infinite loop or something.

Hopefully that helps.

lqze commented 4 years ago

I am experiencing this issue with multiple Clone fields

acburdine commented 4 years ago

I raised a PR in #168 - I'm not sure the case I fixed is the only case of out of memory issues, but it was the main one I was running into.

jasonbahl commented 11 months ago

closed by: https://github.com/wp-graphql/wp-graphql-acf/pull/168


👋🏻 We've re-built this plugin over here: https://github.com/wp-graphql/wpgraphql-acf

The new version of the plugin is a complete re-architecture and maps field groups to the schema in a better way leading to far fewer GraphQL Object Types being produced and added to the Schema.

This leads to less PHP memory consumption AND allows field groups to be better re-used as fragments in different queries.

This repo will be archived in the near future in favor of the new plugin which will be available on WordPress.org soon!