Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server status monitor not works #15897

Closed
alisacorporation opened this issue Feb 3, 2020 · 13 comments
Closed

Server status monitor not works #15897

alisacorporation opened this issue Feb 3, 2020 · 13 comments
Assignees
Labels
Bug A problem or regression with an existing feature waiting on upstream Issues blocked by a third-party
Projects

Comments

@alisacorporation
Copy link

Describe the bug

Javascript error
Error in processing request
Error code: 500
Error text: Internal Server Error (rejected)
It seems that the connection to server has been lost. Please check your network connectivity and server status.

XHR Request:
500,GET,localhost,server_status_monitor.php?ajax_request=true&ajax_page_request=true&_nocache=1580692333607633734&token=3a3e2b38342d347125455f47505e7266,xhr

Console.log
ReferenceError: variableNames is not defined, monitor.js:954:9

To Reproduce

Steps to reproduce the behavior:

  1. Go to Status
  2. Go to Monitor
  3. Go to step 4
  4. See error

Expected behavior

You kidding me? I want to see graphs..

Screenshots

Sure

image

Server configuration

  • Operating system:
  • Web server: nginx/1.16.1
  • Database version: 10.4.11-MariaDB - Arch Linux
  • PHP version: PHP 7.4.2
  • phpMyAdmin version: 5.0.1

Client configuration

  • Browser: Firefox, Chromium, Brave..
  • Operating system: Arch Linux

Additional context

Be aware from Corona Virus!

@williamdes
Copy link
Member

Hi @iBrabus can you post the php error logs?

@williamdes williamdes added the Bug A problem or regression with an existing feature label Feb 3, 2020
@williamdes williamdes added this to Needs triage in Questions via automation Feb 3, 2020
@williamdes williamdes moved this from Needs triage to Needs a second check to be a bug in Questions Feb 3, 2020
@alisacorporation
Copy link
Author

alisacorporation commented Feb 4, 2020

Sure, sorry!

[error] 827#827: *93
PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function iconv() in twig/twig/src/Extension/CoreExtension.php:1000
Stack trace:
#0 twig/twig/src/Extension/EscaperExtension.php(286): twig_convert_encoding()
#1 [internal function]: {closure}()
#2 twig/twig/src/Extension/EscaperExtension.php(294): preg_replace_callback()
#3 /tmp/twig/0a/0ae41a9c6f40ee60d8555434a765385bb0ac73c2db08fd3438124e967d4b9df2.php(492): twig_escape_filter()
#4 twig/twig/src/Template.php(184): __TwigTemplate_19fd47d09392f44e33c7fb4168ff8d53a56098d6291c10ca5481a519454cd4b1->block_content()
#5 /tmp/twig/76/7641b0ed488339ae265a5a5753b416ecba0bc8ecd77d545e0bb91607ecf475f8.php(124): Twig\Template->displayBlock()
#6 twig/twig/src/Template.php(407): __TwigTemplate_561fca2ffe36997bb6e2a6fe3344909c8d88b493056876dcc7f4731e6f589586->doDispl
GET /pma/server_status_monitor.php?ajax_request=true&ajax_page_request=true&_nocache=1580574675554970391&token=redacted HTTP/1.1
[error] 827#827: *93
PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function iconv() in twig/twig/src/Extension/CoreExtension.php:1000
Stack trace:
#0 twig/twig/src/Extension/EscaperExtension.php(286): twig_convert_encoding()
#1 [internal function]: {closure}()
#2 twig/twig/src/Extension/EscaperExtension.php(294): preg_replace_callback()
#3 /tmp/twig/0a/0ae41a9c6f40ee60d8555434a765385bb0ac73c2db08fd3438124e967d4b9df2.php(492): twig_escape_filter()
#4 twig/twig/src/Template.php(184): __TwigTemplate_19fd47d09392f44e33c7fb4168ff8d53a56098d6291c10ca5481a519454cd4b1->block_content()
#5 /tmp/twig/76/7641b0ed488339ae265a5a5753b416ecba0bc8ecd77d545e0bb91607ecf475f8.php(124): Twig\Template->displayBlock()
#6 twig/twig/src/Template.php(407): __TwigTemplate_561fca2ffe36997bb6e2a6fe3344909c8d88b493056876dcc7f4731e6f589586->doDispl
GET /pma/server_status_monitor.php?ajax_request=true&ajax_page_request=true&_nocache=1580574686127873649&token=redacted HTTP/1.1
[error] 827#827: *93
PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function iconv() in twig/twig/src/Extension/CoreExtension.php:1000
Stack trace:
#0 twig/twig/src/Extension/EscaperExtension.php(286): twig_convert_encoding()
#1 [internal function]: {closure}()
#2 twig/twig/src/Extension/EscaperExtension.php(294): preg_replace_callback()
#3 /tmp/twig/0a/0ae41a9c6f40ee60d8555434a765385bb0ac73c2db08fd3438124e967d4b9df2.php(492): twig_escape_filter()
#4 twig/twig/src/Template.php(184): __TwigTemplate_19fd47d09392f44e33c7fb4168ff8d53a56098d6291c10ca5481a519454cd4b1->block_content()
#5 /tmp/twig/76/7641b0ed488339ae265a5a5753b416ecba0bc8ecd77d545e0bb91607ecf475f8.php(124): Twig\Template->displayBlock()
#6 twig/twig/src/Template.php(407): __TwigTemplate_561fca2ffe36997bb6e2a6fe3344909c8d88b493056876dcc7f4731e6f589586->doDispl
GET /pma/server_status_monitor.php HTTP/1.1
[error] 827#827: *101
PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function iconv() in twig/twig/src/Extension/CoreExtension.php:1000
Stack trace:
#0 twig/twig/src/Extension/EscaperExtension.php(286): twig_convert_encoding()
#1 [internal function]: {closure}()
#2 twig/twig/src/Extension/EscaperExtension.php(294): preg_replace_callback()
#3 /tmp/twig/0a/0ae41a9c6f40ee60d8555434a765385bb0ac73c2db08fd3438124e967d4b9df2.php(492): twig_escape_filter()
#4 twig/twig/src/Template.php(184): __TwigTemplate_19fd47d09392f44e33c7fb4168ff8d53a56098d6291c10ca5481a519454cd4b1->block_content()
#5 /tmp/twig/76/7641b0ed488339ae265a5a5753b416ecba0bc8ecd77d545e0bb91607ecf475f8.php(124): Twig\Template->displayBlock()
#6 twig/twig/src/Template.php(407): __TwigTemplate_561fca2ffe36997bb6e2a6fe3344909c8d88b493056876dcc7f4731e6f589586->doDispl
GET /pma/server_status_monitor.php?ajax_request=true&ajax_page_request=true&_nocache=1580574734648469755&token=redacted HTTP/1.1
[error] 827#827: *184
PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function iconv() in twig/twig/src/Extension/CoreExtension.php:1000
Stack trace:
#0 twig/twig/src/Extension/EscaperExtension.php(286): twig_convert_encoding()
#1 [internal function]: {closure}()
#2 twig/twig/src/Extension/EscaperExtension.php(294): preg_replace_callback()
#3 /tmp/twig/0a/0ae41a9c6f40ee60d8555434a765385bb0ac73c2db08fd3438124e967d4b9df2.php(492): twig_escape_filter()
#4 twig/twig/src/Template.php(184): __TwigTemplate_19fd47d09392f44e33c7fb4168ff8d53a56098d6291c10ca5481a519454cd4b1->block_content()
#5 /tmp/twig/76/7641b0ed488339ae265a5a5753b416ecba0bc8ecd77d545e0bb91607ecf475f8.php(124): Twig\Template->displayBlock()
#6 twig/twig/src/Template.php(407): __TwigTemplate_561fca2ffe36997bb6e2a6fe3344909c8d88b493056876dcc7f4731e6f589586->doDispl
GET /pma/server_status_monitor.php?ajax_request=true&ajax_page_request=true&_nocache=1580588495116898646&token=413d3f29383450437e3d775a4551706b HTTP/1.1

@alisacorporation
Copy link
Author

Okay, enabling iconv extension in php.ini file helps! Now it works, but you can make some warning message for users, if they are missing some extensions!

Thank you!

@williamdes williamdes reopened this Feb 4, 2020
Questions automation moved this from Needs a second check to be a bug to Needs triage Feb 4, 2020
@williamdes
Copy link
Member

Thank you, we will improve this so users can have a warning displayed

@bismitaguha
Copy link
Contributor

I am working on this issue

@williamdes williamdes added the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label Feb 6, 2020
@williamdes
Copy link
Member

@fabpot can you give your thoughts on this issue ?

Trace: #15897 (comment)

https://github.com/twigphp/Twig/blob/76352a037db381fd688f0d3b81faf48fe74fdbd4/src/Extension/CoreExtension.php#L1032

I am not sure if I should open an issue upstream
For now I will maybe use some internal code that can use another extension if needed

@williamdes
Copy link
Member

@bismitaguha I think you could open a new PR with this patch

diff --git a/libraries/classes/Core.php b/libraries/classes/Core.php
index 5a7ee91e23b..527d22f7e61 100644
--- a/libraries/classes/Core.php
+++ b/libraries/classes/Core.php
@@ -1022,6 +1022,13 @@ class Core
         if (! function_exists('hash_hmac')) {
             self::warnMissingExtension('hash', true);
         }
+
+        /**
+         * iconv is required for Twig.
+         */
+        if (! function_exists('iconv')) {
+            self::warnMissingExtension('iconv');
+        }
     }
 
     /**

But to block the user use self::warnMissingExtension('iconv', true);

To test locally use if (! function_exists('icotyponv')) {

@williamdes williamdes removed the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label Feb 9, 2020
@williamdes williamdes added this to Needs triage in issues via automation Feb 9, 2020
@williamdes williamdes removed this from Needs triage in Questions Feb 9, 2020
@williamdes williamdes moved this from Needs triage to n/a priority in issues Feb 9, 2020
@williamdes
Copy link
Member

williamdes commented Feb 9, 2020

@iBrabus I can not fix this issue on our end because it is called in the twig codebase, so maybe #15897 (comment) is the only way to "fix" this issue

Also be sure to use e7eac68 as base

@alisacorporation
Copy link
Author

It is giving another error... sad story..

2020/02/10 01:16:24 [error] 819#819: *163 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function getCookie() on null in /usr/share/webapps/phpMyAdmin/libraries/classes/Url.php:219
Stack trace:
#0 /usr/share/webapps/phpMyAdmin/libraries/classes/Url.php(171): PhpMyAdmin\Url::getCommonRaw()
#1 /usr/share/webapps/phpMyAdmin/libraries/classes/Core.php(762): PhpMyAdmin\Url::getCommon()
#2 /usr/share/webapps/phpMyAdmin/libraries/classes/Core.php(338): PhpMyAdmin\Core::linkURL()
#3 /usr/share/webapps/phpMyAdmin/libraries/classes/Core.php(364): PhpMyAdmin\Core::getPHPDocLink()
#4 /usr/share/webapps/phpMyAdmin/libraries/classes/Core.php(1026): PhpMyAdmin\Core::warnMissingExtension()
#5 /usr/share/webapps/phpMyAdmin/libraries/common.inc.php(110): PhpMyAdmin\Core::checkExtensions()
#6 /usr/share/webapps/phpMyAdmin/index.php(23): require_once('/usr/share/weba...')
#7 {main}
  thrown in /usr/share/webapps/phpMyAdmin/libraries/classes/Url.php on line 219" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /pma/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "xeon"

But it's okay, if it's working with just enabled 'iconv', than I dont interfere within its business logic :D

@williamdes
Copy link
Member

It is giving another error... sad story..

2020/02/10 01:16:24 [error] 819#819: *163 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function getCookie() on null in /usr/share/webapps/phpMyAdmin/libraries/classes/Url.php:219
Stack trace:
#0 /usr/share/webapps/phpMyAdmin/libraries/classes/Url.php(171): PhpMyAdmin\Url::getCommonRaw()
#1 /usr/share/webapps/phpMyAdmin/libraries/classes/Core.php(762): PhpMyAdmin\Url::getCommon()
#2 /usr/share/webapps/phpMyAdmin/libraries/classes/Core.php(338): PhpMyAdmin\Core::linkURL()
#3 /usr/share/webapps/phpMyAdmin/libraries/classes/Core.php(364): PhpMyAdmin\Core::getPHPDocLink()
#4 /usr/share/webapps/phpMyAdmin/libraries/classes/Core.php(1026): PhpMyAdmin\Core::warnMissingExtension()
#5 /usr/share/webapps/phpMyAdmin/libraries/common.inc.php(110): PhpMyAdmin\Core::checkExtensions()
#6 /usr/share/webapps/phpMyAdmin/index.php(23): require_once('/usr/share/weba...')
#7 {main}
  thrown in /usr/share/webapps/phpMyAdmin/libraries/classes/Url.php on line 219" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /pma/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "xeon"

But it's okay, if it's working with just enabled 'iconv', than I dont interfere within its business logic :D

Be sure I already fixed it in 84cd7fb also ed48153 and 612e501

And the changelog e7eac68

Can you apply the patches and let me know if it is okay?
Also how do you disable iconv it seems built in nowdays :)

@fabpot
Copy link

fabpot commented Feb 11, 2020

@williamdes The iconv PHP extension is compiled into PHP by default. You can of course explicitly disable the extension but that's the first time we hit this problem (maybe because we are using iconv only when the charset is not UTF-8). Anyway, to avoid the problem, I've added a check and a proper exception if iconv is not available. To fix the issue, one can install the PHP extension or the polyfill. We do not require the Symfony polyfill by default as it's quite big, so we want to avoid downloading larges files as it's rarely needed.

For reference, PR here: twigphp/Twig#3262. New versions of Twig will be release after merge.

@williamdes williamdes added the waiting on upstream Issues blocked by a third-party label Feb 11, 2020
@williamdes
Copy link
Member

Thank you @fabpot !
Next release will have the updated twig version

@williamdes williamdes moved this from n/a priority to Waiting on upstream in issues Oct 22, 2020
@williamdes
Copy link
Member

v3.3.0 v3.2.1 v3.1.1 v3.1.0 v3.0.5 v3.0.4 v3.0.3 v2.14.4 v2.14.3 v2.14.2 v2.14.1 v2.14.0 v2.13.1 v2.13.0 v2.12.5 Twig versions now have the fix. The 5.1 version of phpMyAdmin has the fix.

issues automation moved this from Waiting on upstream to Closed Mar 14, 2021
@williamdes williamdes self-assigned this Mar 14, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature waiting on upstream Issues blocked by a third-party
Projects
issues
  
Closed
Development

Successfully merging a pull request may close this issue.

4 participants