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 when browsing a table #15719

Closed
VARGA-Peter opened this issue Dec 29, 2019 · 16 comments
Closed

Error 500 when browsing a table #15719

VARGA-Peter opened this issue Dec 29, 2019 · 16 comments
Assignees
Labels
Bug A problem or regression with an existing feature
Projects
Milestone

Comments

@VARGA-Peter
Copy link

Describe the bug

Clicking on Browse on some tables generates a "Error code: 500" message. I couldn't figured out which type of tables triggers the error message.

Expected behavior

Browsing the table content.
Testing it with PMA 4.9.3 with exactly the same configuration works for these tables! So I assume it has something to do with PMA 5.0.0

Server configuration

  • Operating system: SLES 12 SP5
  • Web server: Apache Server version: Apache/2.4.23 (Linux/SUSE), Server built: 2019-08-22 13:36:51
  • Database version: MySQL 8.0.18
  • PHP version: 7.3.13
  • phpMyAdmin version: 5.0.0

Client configuration

  • Browser: All
  • Operating system: Windows 10 Pro

Additional context

Log dump:

PHP Fatal error: Uncaught TypeError: mb_substr() expects parameter 3 to be int, string given in /application/phpmyadmin/libraries/classes/Display/Results.php:4452\nStack trace:\n#0
/application/phpmyadmin/libraries/classes/Display/Results.php(4452): mb_substr('1', 0, '255')\n#1 /application/phpmyadmin/libraries/classes/Display/Results.php(4196): PhpMyAdmin\Display\Results->_getSortedColumnMessage(Object(mysqli_result), 'app_codesid')\n#2 /application/phpmyadmin/libraries/classes/Sql.php(1666): PhpMyAdmin\Display\Results->getTable(Object(mysqli_result), Array, Array, false)\n#3 /application/phpmyadmin/libraries/classes/Sql.php(2002): PhpMyAdmin\Sql->getHtmlForSqlQueryResultsTable(Object(PhpMyAdmin\Display\Results), './themes/metro/...', NULL, Array, true, 22, 22, NULL, Object(mysqli_result), Array)\n#4 /application/phpmyadmin/libraries/classes/Sql.php(2271): PhpMyAdmin\Sql->getQueryResponseForResultsReturned(Object(mysqli_result), Array, 'MyISAM_it', 'app_codes_items', NULL, NULL, Object(PhpMyAdmin\Display\Results), './themes/metr in /application/phpmyadmin/libraries/classes/Display/Results.php on line 4452

@williamdes
Copy link
Member

@CBDFactum-com is LimitChars defined as = '1'; or = 1; (1 is an example value) in your config file ?

@williamdes
Copy link
Member

williamdes added a commit to williamdes/phpmyadmintest that referenced this issue Dec 29, 2019
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes williamdes self-assigned this Dec 29, 2019
@williamdes williamdes added this to the 5.0.1 milestone Dec 29, 2019
@williamdes williamdes added the Bug A problem or regression with an existing feature label Dec 29, 2019
@williamdes williamdes added this to Needs triage in issues via automation Dec 29, 2019
@williamdes williamdes moved this from Needs triage to Closed in issues Dec 29, 2019
@VARGA-Peter
Copy link
Author

VARGA-Peter commented Dec 29, 2019

I am very confused as you are asking me this question. I wrote it happens with some tables so this cannot be the reason. By the way, I don't have it defined in config.inc.php at all. The content of this file:

BTW: Setting it explicitly to 1 [without the quotes, e.q. as an integer] doesn't change anything.

/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * phpMyAdmin sample configuration, you can use it as base for
 * manual configuration. For easier setup you can use setup/
 *
 * All directives are explained in documentation in the doc/ folder
 * or at <http://docs.phpmyadmin.net/>.
 *
 * @package PhpMyAdmin
 */

/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = '*****'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '***';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Servers'][$i]['user'] = '****';
$cfg['Servers'][$i]['password'] = '*****';

$cfg['Servers'][$i]['pmadb'] = 'pma';
$cfg['Servers'][$i]['controluser'] = '*****';
$cfg['Servers'][$i]['controlpass'] = '*****';

$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
// 4.5.2
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';

$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';

$cfg['LoginCookieValidity'] = 604800;
$cfg['ShowDbStructureLastCheck'] = true;
$cfg['TempDir'] = '/tmp';

$cfg['Lang'] = 'en';
$cfg['MaxExactCount'] = 0;

@VARGA-Peter
Copy link
Author

VARGA-Peter commented Dec 29, 2019

I suspect something else. It has been already a problem in the past updates:
A stored value in the PMA tables which hasn't been considered in the 5.0.0 update...

@VARGA-Peter
Copy link
Author

VARGA-Peter commented Dec 29, 2019

Yep, I was right! I emptied all PMA tables and now it works.
Can you re-open it as it is not what your first guess was?

@williamdes williamdes reopened this Dec 29, 2019
issues automation moved this from Closed to Needs triage Dec 29, 2019
@williamdes
Copy link
Member

williamdes commented Dec 29, 2019

@CBDFactum-com I will have another look at the issue, maybe you reported 2 issues in total :)

@williamdes
Copy link
Member

Issue 1: mb_substr('1', 0, '255') was clearly an issue and is solved by de652cd

Testing it with PMA 4.9.3 with exactly the same configuration works for these tables! So I assume it has something to do with PMA 5.0.0

declare(strict_types=1); was added in phpMyAdmin 5.0.0 and that created issue n°1

Issue 2: I would need more information, can you recover the data ?

issues automation moved this from Needs triage to Closed Dec 29, 2019
@VARGA-Peter
Copy link
Author

I can but it is a bit complicated - but of course, when it helps you to fix a bug I am your man!
So, tell me what you need. I can provide you the whole phpmyadmin database. As I saw it, there are only few rows. Is there some critical data or is it OK I post it here?

@williamdes
Copy link
Member

williamdes commented Dec 29, 2019

@CBDFactum-com If you can recover the data and send it by email to williamdes@wdes.fr that could help me ;)

But, if you restore the data the issue should be back and you could post the stack trace here (that would be easier for you) ?

Is there some critical data or is it OK I post it here?

there coud be 2FA secrets and more, maye GitHub is not the right place to send the phpMyAdmin database

@VARGA-Peter
Copy link
Author

VARGA-Peter commented Dec 29, 2019

I sent you the database dump with further information. The Error 500 message appeared immediately so it must be really some setting in the database.

@VARGA-Peter
Copy link
Author

VARGA-Peter commented Apr 17, 2020

I had it again. After I emptied all tables in the phpmyadmin database I could browse the tables. Even browsing the pma__table_uiprefs didn't work. Should I send you again the dump of the phpmyadmin database?

@williamdes
Copy link
Member

@CBDFactum-com are you up to date ?
Could you post the stacktrace in a new issue if you are up to date ?

@VARGA-Peter
Copy link
Author

@williamdes What do you mean with ".. a new issue if you are up to date"?
Should I open a new issue with the same subject and same stacktrace [as it is exactly the same] and with what should I be up to date?

@williamdes
Copy link
Member

@williamdes What do you mean with ".. a new issue if you are up to date"?
Should I open a new issue with the same subject and same stacktrace [as it is exactly the same] and with what should I be up to date?

What I mean is: are you using phpMyAdmin 5.0.2?

If you are using 5.0.2 then my patch did not work.. 🤔

@VARGA-Peter
Copy link
Author

@williamdes I am very sorry my friend. My mistake.

Yes, in 5.0.2 it's fixed. Thank you very much!

@williamdes
Copy link
Member

@williamdes I am very sorry my friend. My mistake.

Yes, in 5.0.2 it's fixed. Thank you very much!

No worries, I am happy to know that it is fixed

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 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

2 participants