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

Error 500 in Table Structure Screen , Japanese Lang #15830

Closed
yagiribenma opened this issue Jan 21, 2020 · 11 comments
Closed

Error 500 in Table Structure Screen , Japanese Lang #15830

yagiribenma opened this issue Jan 21, 2020 · 11 comments
Assignees
Labels
Bug A problem or regression with an existing feature
Projects
Milestone

Comments

@yagiribenma
Copy link

[Symptom]
Table Structure page gives 500 error in Ver 5.0.1, Japanese Language Mode.

[Steps to reproduce the behavior]

  1. Choose Language to 'Japanese', and login to phpmyadmin 5.0.1
  2. Choose any database table , and Click on 'Structure'
  3. It does not go to database structure page. Instead, Error code 500 pops up. The message says that network connection is lost.

The error does not reproduce when language is different (tested in English and Simp. Chinese), or phpmyadmin ver is prior to 4.9.x.

[Server Configuration]
Web server: IIS 10.0 on Windows10 Pro 1909
DB: MariaDB 10.4.11
PHP: 7.4.1 VC15 x64 Non Thread Safe
phpMyAdmin version: 5.0.1
step1
step2
step3

@williamdes
Copy link
Member

@yagiribenma I could not reproduce this issue, can you send your config.inc.php file and the php error log ?

@williamdes williamdes added the question Used when we need feedback from the submitter or when the issue is a question about PMA label Jan 21, 2020
@yagiribenma
Copy link
Author

yagiribenma commented Jan 21, 2020

Here it is
config.inc.php.txt

[21-Jan-2020 21:33:19 UTC] PHP Fatal error:  Uncaught TypeError: mb_detect_encoding() expects parameter 1 to be string, bool given in C:\WIMP\phpMyAdmin\libraries\classes\Util.php:1620
Stack trace:
#0 C:\WIMP\phpMyAdmin\libraries\classes\Util.php(1620): mb_detect_encoding()
#1 C:\WIMP\phpMyAdmin\tmp\twig\7c\7cc5963ef7210ba521d90272725a92480e3970e54b73feb6dec5b10df479edb5.php(403): PhpMyAdmin\Util::localisedDate()
#2 C:\WIMP\phpMyAdmin\vendor\twig\twig\src\Template.php(407): __TwigTemplate_cd5fac3c05ba0f147ecca818fff2309efbb2e33124aca5d0608bb097a3fee7b4->doDisplay()
#3 C:\WIMP\phpMyAdmin\vendor\twig\twig\src\Template.php(380): Twig\Template->displayWithErrorHandling()
#4 C:\WIMP\phpMyAdmin\vendor\twig\twig\src\Template.php(392): Twig\Template->display()
#5 C:\WIMP\phpMyAdmin\vendor\twig\twig\src\TemplateWrapper.php(45): Twig\Template->render()
#6 C:\WIMP\phpMyAdmin\libraries\classes\Template.php(140): Twig\TemplateWrapper->render()
#7 C:\WIMP\phpMyAdmin\libraries\classes\Controllers\Table\StructureController.php(1536): PhpMyAdmin\Template->render()
#8 C: in C:\WIMP\phpMyAdmin\libraries\classes\Util.php on line 1620

@williamdes
Copy link
Member

williamdes commented Jan 21, 2020

"[...]As the output is dependent upon the underlying C library, some conversion specifiers are not supported. On Windows, supplying unknown conversion specifiers will result in 5 E_WARNING messages and return FALSE. [...]"

https://www.php.net/manual/en/function.strftime.php

@yagiribenma can you add $cfg['ShowPhpInfo'] = true; and send the date section ?
(you will find a link on the homepage to show phpinfo)
Example:
image

@yagiribenma
Copy link
Author

Screenshots of date and mbstring are as follows:

datesection
mbstringsection

@williamdes williamdes added this to Needs triage in Questions Jan 23, 2020
@williamdes williamdes moved this from Needs triage to High priority in Questions Jan 23, 2020
@dala00
Copy link

dala00 commented Feb 2, 2020

Just for information, may be a same issue.
f37dd84b36bcbac2749ed7d9d5d7127f5e371d0148fdd

details.
https://crieit.net/posts/phpMyAdmin5-0-1-Fatal-Error

@williamdes
Copy link
Member

Thank you @dala00 for the link.
It explains the bug and the fix

@williamdes williamdes added Bug A problem or regression with an existing feature and removed question Used when we need feedback from the submitter or when the issue is a question about PMA labels Feb 3, 2020
@williamdes williamdes added this to Needs triage in issues via automation Feb 3, 2020
@williamdes williamdes removed this from Needs a second check to be a bug in Questions Feb 3, 2020
@williamdes williamdes moved this from Needs triage to High priority in issues Feb 3, 2020
@williamdes williamdes added this to the 5.0.2 milestone Feb 3, 2020
williamdes added a commit that referenced this issue Feb 12, 2020
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Feb 12, 2020
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Feb 12, 2020
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes
Copy link
Member

@dala00 @yagiribenma I need help 🙏
I am unable to reproduce the issue on my W10 VM.
Could you make a fix or help me reproduce this issue so I can make a proper fix ?
Or maybe help me find the right fix

I added tests as you can see above and they are all in success

If someone can help or open a PR I would be so happy

@namosuke
Copy link

@williamdes I'm a writer of the error report(https://crieit.net/posts/phpMyAdmin5-0-1-Fatal-Error).
I tried your test with using setlocale() in UtilTest.php on line 2073, instead of _setlocale() and then this error reproduced.

This is the result:

PS C:\Users\user\Desktop\Web\github\test_pma> vendor\bin\phpunit test\classes\UtilTest.php
PHPUnit 8.5.2 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.4.1
Configuration: C:\Users\user\Desktop\Web\github\test_pma\phpunit.xml.dist
Error:         No code coverage driver is available

...............................................................  63 / 207 ( 30%)
............................................................... 126 / 207 ( 60%)
................FF.E........................................... 189 / 207 ( 91%)
..................                                              207 / 207 (100%)

Time: 1.43 seconds, Memory: 12.00 MB

There was 1 error:

1) PhpMyAdmin\Tests\UtilTest::testLocalisedDate with data set #8 (1227455558, '%Y 年 2 月 %d 日 %H:%M', '2008 年 2 月 24 日 00:52', 'Asia/Tokyo', 'ja')
TypeError: mb_detect_encoding() expects parameter 1 to be string, bool given

C:\Users\user\Desktop\Web\github\test_pma\libraries\classes\Util.php:1620
C:\Users\user\Desktop\Web\github\test_pma\test\classes\UtilTest.php:2079

--

There were 2 failures:

1) PhpMyAdmin\Tests\UtilTest::testLocalisedDate with data set #5 (1227455558, '%Y-%m-%d %H:%M:%S %a', '2008-11-24 00:52:38 月', 'Asia/Tokyo', 'ja')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2008-11-24 00:52:38 月'
+'2008-11-24 00:52:38 Mon'

C:\Users\user\Desktop\Web\github\test_pma\test\classes\UtilTest.php:2079

2) PhpMyAdmin\Tests\UtilTest::testLocalisedDate with data set #6 (1227455558, '%a %A %b %B', '月 月 11 月 11 月', 'Asia/Tokyo', 'ja')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'月 月 11 月 11 月'
+'Mon Mon Nov Nov'

C:\Users\user\Desktop\Web\github\test_pma\test\classes\UtilTest.php:2079

ERRORS!
Tests: 207, Assertions: 1387, Errors: 1, Failures: 2.

And I don't know whether it helps you, my friend made a web page that can try same convert issue that relate to charset 2 years ago. https://splamp.info/shed/bake.php
You may can find which word is incorrect such as '月月' is correct and '月 月' is incorrect.

@williamdes
Copy link
Member

Thank you @namosuke!
I will try this tomorrow and make a fix
So I will need to have the locale compiled on my workstation to use setlocale

You may can find which word is incorrect such as '月月' is correct and '月 月' is incorrect

I will change it, I have no idea what it means but will have a look

@williamdes
Copy link
Member

williamdes commented Feb 22, 2020

I could not reproduce this issue on any setup but my GitHub actions CI could
https://github.com/williamdes/phpmyadmintest/runs/461980610#step:6:483
https://travis-ci.org/williamdes/phpmyadmintest/jobs/653808330#L349
I added setlocale and it works.
Working on a fix

@williamdes williamdes self-assigned this Feb 22, 2020
williamdes added a commit that referenced this issue Feb 22, 2020
@williamdes
Copy link
Member

You may can find which word is incorrect such as '月月' is correct and '月 月' is incorrect

I checked and it is considered "okay" for the test case but I understand it does not make sense outside of the test case

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2021
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
Projects
issues
  
Closed
Development

No branches or pull requests

4 participants