Awaiting feedback Option phrases not compiling correctly

Liam W

in memoriam 1998-2020
Affected version
DP 10
When installing an add-on for the first time, the option phrases don't seem to compile properly.

When I uninstall it, and install it again (via the CLI, though not sure if that is relevant), the option phrases are then rendered correctly.

This has happened twice now, with 2 different add-ons.

Liam
 
When installing an add-on for the first time, the option phrases don't seem to compile properly.

When I uninstall it, and install it again (via the CLI, though not sure if that is relevant), the option phrases are then rendered correctly.

This has happened twice now, with 2 different add-ons.

Liam

Oddly enough someone helping to test our add-ons (@Matt C. I believe) had this same issue on one of the add-ons. When I ended up looking into it the option phrases were actually missing from the xml file in _data, ended up having to export the add-on again to fix it, but I haven't encountered it since though.
 
Is there any pattern to the phrases that don't work? Are they all titles? All descriptions? Phrases used within option templates? Phrases referenced in format options?
 
All the option titles, explanations, as well as option group titles and explanations.

Basically, all phrases with an option-based phrase group.

Liam
 
Is there any pattern to the phrases that don't work? Are they all titles? All descriptions? Phrases used within option templates? Phrases referenced in format options?

IIRC when it happened for me it was all option related phrases. Titles and descriptions.

Though it sounds like it may be a different issue since reinstalling fixed it for him (assuming he didn't reinstall from dev output). I can try to find the zip with the broken phrases if that helps you at all? It should still be on our beta slack we setup since that's how we've been sending everything out.
 
Seems ok to me:

1502326649321.webp

It seemed to freak out slightly during install with an Undefined index: vanityNames_mode error twice but the add-on data import continued.

A note on that, actually, the Options object in XF2 is slightly different in that it deliberately doesn't have any protection against undefined indexes for missing or not yet imported options or array keys within options. So any code (especially code that can run before install - though there should be some improvement here in the future) should check if an option key exists first before use.

That said, I'm not certain this caused the problem, but it's possible. It's worth checking that out.

The only other thing I can think of is if there's any sort of permission or ownership issue on your internal_data/code_cache directory, though that error would usually get logged, at the least.
 
Oddly enough someone helping to test our add-ons (@Matt C. I believe) had this same issue on one of the add-ons. When I ended up looking into it the option phrases were actually missing from the xml file in _data, ended up having to export the add-on again to fix it, but I haven't encountered it since though.

Yes, I did come across this issue.
 
If you trigger the issue and then wait a couple minutes, does it resolve itself? If so, it's probably your opcache.revalidate_freq setting. Out of the box, this is 2, though I've seen some servers set it to 60, which is a nightmare for debugging. But in this case, even 2 could lead to this.

I have made some changes to try to invalidate any opcode caching done when we write to code cache files. So if it is the above, I suspect this will fix it.
 
@Mike can you also ensure any opcode caching is invalidated when the add-on install process starts? This should help the add-on install process too.
 
It seemed to freak out slightly during install with an Undefined index: vanityNames_mode error twice but the add-on data import continued.

That would probably have been the router and predispatch listeners.

Maybe it would be a good idea to disable all add-on stuff until it's fully imported?

However, the other 2 add-ons this happened with didn't result in any errors being logged...

I do have opcache on the remove server enabled though.

Liam
 
That'll be it then, as Mike stated.

If it's something you can reproduce fairly consistently, you could try adding:
PHP:
@ini_set('opcache.revalidate_freq', 0);
to config.php.

I'm not suggesting that's the solution, it's mostly just to test that it is opcache related, and then if it is, then that should be sorted in the next release (we invalidate any file written to the code-cache directory on write).
 
Top Bottom