[ZBX-10911] Zabbix frontend locales flapping Created: 2016 Jun 16  Updated: 2024 Apr 10  Resolved: 2019 May 01

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Documentation (D)
Affects Version/s: 3.0.3
Fix Version/s: 4.4 (plan)

Type: Documentation task Priority: Trivial
Reporter: Igor Ivanov Assignee: Martins Valkovskis
Resolution: Fixed Votes: 3
Labels: gettext, locale
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Gentoo linux, Apache web server.


Attachments: PNG File zabbix_frontend_flapping.png    
Issue Links:
Duplicate
is duplicated by ZBX-15288 Weird localisation behavior Closed
is duplicated by ZBX-11982 Locale is alternating between Portugu... Closed
is duplicated by ZBX-17945 the language changed when refreshing ... Closed
Sub-task
depends on ZBX-16297 bcdiv(): Division by zero in Graph wi... Reopened
Team: Team D
Sprint: Sprint 50 (Mar 2019), Sprint 51 (Apr 2019)
Story Points: 0

 Description   

We have many users, most of them use Russian locale for frontend. Some - English. And we see that some parts of the page on English, other on Russian.

If we have one user online we have no problems. But if we have two users online with different locales problem occurs.

We had it on 2.2, 2.4.7 and 3.0.3



 Comments   
Comment by richlv [ 2016 Jun 16 ]

might be related to php gettext caching.
this also happens after the apache webserver is restarted, right ?

Comment by Oleksii Zagorskyi [ 2016 Jun 17 ]

At http://zabbix.org/wiki/Translating_Zabbix is an instruction where very last step is "restart your web server"
I may recall similar behavior (not partial translation, but randomly changed locales current-previous) if web server was started before current .mo file was created.
That's why there is such a step.

Try to restart your web server.

Comment by Igor Ivanov [ 2016 Jun 17 ]

It doesn't help.

Comment by Oleksii Zagorskyi [ 2016 Jun 17 ]

Interesting. I have no idea how to troubleshoot it.
Maybe some specific modules for Apache/PHP are used, like for caching etc, and they cause such a behavior ...

Comment by Igor Ivanov [ 2016 Jun 17 ]

https://www.zabbix.com/forum/showthread.php?t=41840
That guy had same problem

Comment by richlv [ 2016 Jun 17 ]

zalex had a good point - are you using any other caching, like apc ?

Comment by Glebs Ivanovskis (Inactive) [ 2016 Jun 17 ]

I was reading gettext documentation when working on locale-related server issues and I've also seen bits of locale-related frontend code. I can't claim that I am 100% confident, but here is my understanding of the problem.

Gettext uses environment variables to determine which language is desired. Environment variables can be set per process.

Usual workflow to generate a page:

  • set appropriate locale for the user (web server sets environment variables for its process)
  • call gettext multiple times (web server channels the call to gettext library)

Imagine web server process generating pages for two users with different language settings:

  • (is for user A)
    • (is for user B)
  • set locale to A
  • gettext calls return strings in language A
    • set locale to B
  • gettext calls return strings in language B
    • gettext calls return strings in language B

As a result for user A upper part of the page is in his language, but bottom part is in the language of user B. I imagine that situation is getting worse when there are more users per web server process and problem appears more frequently on the pages which take longer time to generate.

Dear zalex_ua, have you tried to reproduce?

Now we need PHP developers to come and share their thoughts.

Comment by Igor Ivanov [ 2016 Jun 17 ]

richlv, nope.

Interesting. I've changed all users 'lang: to 'ru_RU' in DB, restarted apache, but still have problem.

Comment by Oleksii Zagorskyi [ 2017 Aug 02 ]

Cross linking - ZBX-11982

Comment by Eugene Kravtsov [ 2017 Nov 08 ]

Got the same problem after upgrade to 3.4.4

Comment by Eugene Kravtsov [ 2017 Nov 09 ]

Actually ZBX-13005

Comment by Andrey [ 2018 Dec 09 ]

Have this problem since 2.0...

Comment by Glebs Ivanovskis [ 2018 Dec 09 ]

Dear _Andrey, could you provide more information about your setup?

Comment by Andrey [ 2018 Dec 09 ]

Thanks for reply I had submitted a bug report (ZBX-15288) but already closed it as duplicate since found this one. All basic info about versions, environment and also some screenshots that demonstrate the problem you can find there.
Also there is a zabbix forum thread, where i discussed this problem when first time faced with it (in 2013, when i just upgraded from v1.8 to 2.0, where gettext usage were first implemented) Unfortunately whole thread on Russian but maybe it will be helpful...
If there anything else that i can provide (info/tests/access) - feel free to ask.

Comment by Andrey [ 2018 Dec 09 ]

I have an excellent news because, as i think, i have found the solution of the problem! The problem that is gettext itself, on which is zabbix translation is related, is not support safe multithreading, so disabling multithreading in php and apache (USE="-threads" APACHE2_MPMS="prefork" - for gentoo users) solve this problem. Another workaround, for saving multithreading abilities, is to integrate some framework such Zend_Translate into zabbix frontend but unfortunately i cannot complete such difficult task at the moment... so multithreading, unfortunately, is a necessary sacrifice.

Comment by Glebs Ivanovskis [ 2018 Dec 09 ]

Great news, _Andrey!

My guess was close, but you killed the issue. Now it's time to share the solution in that forum thread and community portal.

Dear martins-v, do you think it's worth adding this information to official documentation?

Comment by Martins Valkovskis [ 2019 Apr 18 ]

Added to the known issue listing for the currently supported versions: 2.2, 3.0, 4.0, 4.2.

Comment by Glebs Ivanovskis [ 2019 Apr 18 ]

Are you sure "flipping" is a good alternative for "flapping"?

Comment by Martins Valkovskis [ 2019 Apr 18 ]

In this case "flipping" is just a form of the verb "flip" that seemed like a common word to use for something changing places randomly. "Flapping" implies a subject - something or somebody that does the "flapping" which in this case is, at least originally, very obscure.

But I'm sure that a case could be made for "flapping" as the better way.

Generated at Wed Apr 24 04:38:54 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.