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

500 error when opening a table - Undefined offset - getTableHeadersForColumns #17428

Closed
KTM25 opened this issue Mar 7, 2022 · 11 comments
Closed
Assignees
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Milestone

Comments

@KTM25
Copy link

KTM25 commented Mar 7, 2022

Describe the bug

Currently seeing a 500 error when opening a table

To Reproduce

Query Being Run:

SELECT * FROM `additional_service_enrollment` WHERE 1

Schema:

server.com/spp/additional_service_enrollment/		https://phpmyadmin-production.server.com/index.php?route=/table/sql&db=spp&table=additional_service_enrollment
Your SQL query has been executed successfully.

explain  `service_enrollment`;

id	int(10) unsigned	NO	PRI	NULL	auto_increment		
enrolled_on	datetime	NO		NULL		
canceled_on	datetime	YES		NULL	

Back Trace Exception:

Notice in ./libraries/classes/Display/Results.php#1047
 Undefined offset: 2

Backtrace

Results.php#1178: PhpMyAdmin\Display\Results->getTableHeadersForColumns(
array,
array,
array,
array,
array,
boolean false,
string 'SELECT * FROM `additional_service_enrollment` ',
)
Results.php#4248: PhpMyAdmin\Display\Results->getTableHeaders(
array,
array,
string 'SELECT * FROM `additional_service_enrollment` ',
array,
array,
array,
boolean false,
)
Sql.php#1371: PhpMyAdmin\Display\Results->getTable(
,
array,
array,
boolean false,
)
Sql.php#1624: PhpMyAdmin\Sql->getHtmlForSqlQueryResultsTable(
,
string './themes/pmahomme/img/',
array,
boolean true,
string '1894',
integer 25,
NULL,
,
array,
)
Sql.php#1860: PhpMyAdmin\Sql->getQueryResponseForResultsReturned(
,
array,
string 'spp',
string 'additional_service_enrollment',
NULL,
,
string './themes/pmahomme/img/',
string '1894',
integer 25,
NULL,
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
Sql.php#1721: PhpMyAdmin\Sql->executeQueryAndGetQueryResponse(
array,
boolean true,
string 'spp',
string 'additional_service_enrollment',
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
SqlController.php#219: PhpMyAdmin\Sql->executeQueryAndSendQueryResponse(
array,
boolean true,
string 'spp',
string 'additional_service_enrollment',
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
Routing.php#191: PhpMyAdmin\Controllers\SqlController->index(array)
index.php#18: PhpMyAdmin\Routing::callControllerForRoute(
string '/sql',
,
,
)
Notice in ./libraries/classes/Display/Results.php#1051
 Undefined index: 

Backtrace

Results.php#1178: PhpMyAdmin\Display\Results->getTableHeadersForColumns(
array,
array,
array,
array,
array,
boolean false,
string 'SELECT * FROM `additional_service_enrollment` ',
)
Results.php#4248: PhpMyAdmin\Display\Results->getTableHeaders(
array,
array,
string 'SELECT * FROM `additional_service_enrollment` ',
array,
array,
array,
boolean false,
)
Sql.php#1371: PhpMyAdmin\Display\Results->getTable(
,
array,
array,
boolean false,
)
Sql.php#1624: PhpMyAdmin\Sql->getHtmlForSqlQueryResultsTable(
,
string './themes/pmahomme/img/',
array,
boolean true,
string '1894',
integer 25,
NULL,
,
array,
)
Sql.php#1860: PhpMyAdmin\Sql->getQueryResponseForResultsReturned(
,
array,
string 'spp',
string 'additional_service_enrollment',
NULL,
,
string './themes/pmahomme/img/',
string '1894',
integer 25,
NULL,
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
Sql.php#1721: PhpMyAdmin\Sql->executeQueryAndGetQueryResponse(
array,
boolean true,
string 'spp',
string 'additional_service_enrollment',
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
SqlController.php#219: PhpMyAdmin\Sql->executeQueryAndSendQueryResponse(
array,
boolean true,
string 'spp',
string 'additional_service_enrollment',
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
Routing.php#191: PhpMyAdmin\Controllers\SqlController->index(array)
index.php#18: PhpMyAdmin\Routing::callControllerForRoute(
string '/sql',
,
,
)
Notice in ./libraries/classes/Display/Results.php#1051
 Trying to get property 'name' of non-object

Backtrace

Results.php#1178: PhpMyAdmin\Display\Results->getTableHeadersForColumns(
array,
array,
array,
array,
array,
boolean false,
string 'SELECT * FROM `additional_service_enrollment` ',
)
Results.php#4248: PhpMyAdmin\Display\Results->getTableHeaders(
array,
array,
string 'SELECT * FROM `additional_service_enrollment` ',
array,
array,
array,
boolean false,
)
Sql.php#1371: PhpMyAdmin\Display\Results->getTable(
,
array,
array,
boolean false,
)
Sql.php#1624: PhpMyAdmin\Sql->getHtmlForSqlQueryResultsTable(
,
string './themes/pmahomme/img/',
array,
boolean true,
string '1894',
integer 25,
NULL,
,
array,
)
Sql.php#1860: PhpMyAdmin\Sql->getQueryResponseForResultsReturned(
,
array,
string 'spp',
string 'additional_service_enrollment',
NULL,
,
string './themes/pmahomme/img/',
string '1894',
integer 25,
NULL,
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
Sql.php#1721: PhpMyAdmin\Sql->executeQueryAndGetQueryResponse(
array,
boolean true,
string 'spp',
string 'additional_service_enrollment',
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
SqlController.php#219: PhpMyAdmin\Sql->executeQueryAndSendQueryResponse(
array,
boolean true,
string 'spp',
string 'additional_service_enrollment',
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
Routing.php#191: PhpMyAdmin\Controllers\SqlController->index(array)
index.php#18: PhpMyAdmin\Routing::callControllerForRoute(
string '/sql',
,
,
)
Notice in ./libraries/classes/Display/Results.php#1056
 Undefined index: 

Backtrace

Results.php#1178: PhpMyAdmin\Display\Results->getTableHeadersForColumns(
array,
array,
array,
array,
array,
boolean false,
string 'SELECT * FROM `additional_service_enrollment` ',
)
Results.php#4248: PhpMyAdmin\Display\Results->getTableHeaders(
array,
array,
string 'SELECT * FROM `additional_service_enrollment` ',
array,
array,
array,
boolean false,
)
Sql.php#1371: PhpMyAdmin\Display\Results->getTable(
,
array,
array,
boolean false,
)
Sql.php#1624: PhpMyAdmin\Sql->getHtmlForSqlQueryResultsTable(
,
string './themes/pmahomme/img/',
array,
boolean true,
string '1894',
integer 25,
NULL,
,
array,
)
Sql.php#1860: PhpMyAdmin\Sql->getQueryResponseForResultsReturned(
,
array,
string 'spp',
string 'additional_service_enrollment',
NULL,
,
string './themes/pmahomme/img/',
string '1894',
integer 25,
NULL,
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
Sql.php#1721: PhpMyAdmin\Sql->executeQueryAndGetQueryResponse(
array,
boolean true,
string 'spp',
string 'additional_service_enrollment',
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
SqlController.php#219: PhpMyAdmin\Sql->executeQueryAndSendQueryResponse(
array,
boolean true,
string 'spp',
string 'additional_service_enrollment',
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
Routing.php#191: PhpMyAdmin\Controllers\SqlController->index(array)
index.php#18: PhpMyAdmin\Routing::callControllerForRoute(
string '/sql',
,
,
)
Notice in ./libraries/classes/Display/Results.php#1062
 Undefined index: 

Backtrace

Results.php#1178: PhpMyAdmin\Display\Results->getTableHeadersForColumns(
array,
array,
array,
array,
array,
boolean false,
string 'SELECT * FROM `additional_service_enrollment` ',
)
Results.php#4248: PhpMyAdmin\Display\Results->getTableHeaders(
array,
array,
string 'SELECT * FROM `additional_service_enrollment` ',
array,
array,
array,
boolean false,
)
Sql.php#1371: PhpMyAdmin\Display\Results->getTable(
,
array,
array,
boolean false,
)
Sql.php#1624: PhpMyAdmin\Sql->getHtmlForSqlQueryResultsTable(
,
string './themes/pmahomme/img/',
array,
boolean true,
string '1894',
integer 25,
NULL,
,
array,
)
Sql.php#1860: PhpMyAdmin\Sql->getQueryResponseForResultsReturned(
,
array,
string 'spp',
string 'additional_service_enrollment',
NULL,
,
string './themes/pmahomme/img/',
string '1894',
integer 25,
NULL,
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
Sql.php#1721: PhpMyAdmin\Sql->executeQueryAndGetQueryResponse(
array,
boolean true,
string 'spp',
string 'additional_service_enrollment',
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
SqlController.php#219: PhpMyAdmin\Sql->executeQueryAndSendQueryResponse(
array,
boolean true,
string 'spp',
string 'additional_service_enrollment',
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
Routing.php#191: PhpMyAdmin\Controllers\SqlController->index(array)
index.php#18: PhpMyAdmin\Routing::callControllerForRoute(
string '/sql',
,
,
)
Notice in ./libraries/classes/Display/Results.php#1635
 Trying to get property 'name' of non-object

Backtrace

Results.php#1071: PhpMyAdmin\Display\Results->getOrderLinkAndSortedHeaderHtml(
NULL,
array,
array,
NULL,
string 'SELECT * FROM `additional_service_enrollment` ',
integer 25,
string '',
array,
array,
NULL,
)
Results.php#1178: PhpMyAdmin\Display\Results->getTableHeadersForColumns(
array,
array,
array,
array,
array,
boolean false,
string 'SELECT * FROM `additional_service_enrollment` ',
)
Results.php#4248: PhpMyAdmin\Display\Results->getTableHeaders(
array,
array,
string 'SELECT * FROM `additional_service_enrollment` ',
array,
array,
array,
boolean false,
)
Sql.php#1371: PhpMyAdmin\Display\Results->getTable(
,
array,
array,
boolean false,
)
Sql.php#1624: PhpMyAdmin\Sql->getHtmlForSqlQueryResultsTable(
,
string './themes/pmahomme/img/',
array,
boolean true,
string '1894',
integer 25,
NULL,
,
array,
)
Sql.php#1860: PhpMyAdmin\Sql->getQueryResponseForResultsReturned(
,
array,
string 'spp',
string 'additional_service_enrollment',
NULL,
,
string './themes/pmahomme/img/',
string '1894',
integer 25,
NULL,
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
Sql.php#1721: PhpMyAdmin\Sql->executeQueryAndGetQueryResponse(
array,
boolean true,
string 'spp',
string 'additional_service_enrollment',
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
SqlController.php#219: PhpMyAdmin\Sql->executeQueryAndSendQueryResponse(
array,
boolean true,
string 'spp',
string 'additional_service_enrollment',
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
string 'SELECT * FROM `additional_service_enrollment`',
NULL,
)
Routing.php#191: PhpMyAdmin\Controllers\SqlController->index(array)
index.php#18: PhpMyAdmin\Routing::callControllerForRoute(
string '/sql',
,
,
)

Logs

[Mon Feb 21 07:38:30.999706 2022] [php7:error] [pid 18907] [client 10.0.1.28:65123] PHP Fatal error:  Uncaught TypeError: Argument 2 passed to PhpMyAdmin\\Display\\Results::getSortOrderHiddenInputs() must be of the type string, null given, called in /path/to/dir/phpmyadmin/libraries/classes/Display/Results.php on line 1691 and defined in /path/to/dir/phpmyadmin/libraries/classes/Display/Results.php:2028\nStack trace:\n#0 /path/to/dir/phpmyadmin/libraries/classes/Display/Results.php(1691): PhpMyAdmin\\Display\\Results->getSortOrderHiddenInputs(Array, NULL)\n#1 /path/to/dir/phpmyadmin/libraries/classes/Display/Results.php(1071): PhpMyAdmin\\Display\\Results->getOrderLinkAndSortedHeaderHtml(NULL, Array, Array, NULL, 'SELECT * FROM `...', 25, '', Array, Array, NULL)\n#2 /path/to/dir/phpmyadmin/libraries/classes/Display/Results.php(1178): PhpMyAdmin\\Display\\Results->getTableHeadersForColumns(Array, Array, Array, Array, Array, false, 'SELECT * FROM `...')\n#3/path/to/dir/phpmyadmin/libraries/classes/Display/Results.php(4244): PhpMyAdmin\\Display\\Results->getTableHeaders(Array, Array, 'SELECT * FROM `...', Array, Array,  in /path/to/dir/phpmyadmin/libraries/classes/Display/Results.php on line 2028

Vulnerable Since

14.9.7

What we have done

We have installed the latest 5.1.3 versions as well as upgraded themes and are experiencing the same issues 

Server configuration

PHP Version	7.2.24-0ubuntu0.18.04.7
SERVER_SOFTWARE	Apache/2.4.46 (Ubuntu)
@KTM25 KTM25 changed the title Production PHPmyadmin 500 error on additional_service_enrollment table view Production PHPmyadmin 500 error when opening a table Mar 7, 2022
@williamdes williamdes added the Bug A problem or regression with an existing feature label Mar 8, 2022
@williamdes
Copy link
Member

Hi @KTM25
Thank you for the report !
Could you send the SQL structure of the two tables mentioned ?

@williamdes williamdes changed the title Production PHPmyadmin 500 error when opening a table 500 error when opening a table - Undefined offset - getTableHeadersForColumns Mar 8, 2022
@KTM25
Copy link
Author

KTM25 commented Mar 17, 2022

Hi @williamdes, sorry for responding so late. Is there a way to send the SQL structure securely?

@KTM25
Copy link
Author

KTM25 commented Mar 23, 2022

Hi @williamdes
My boss was wondering if there is a way to send this securely as they don't want the information public.

@williamdes
Copy link
Member

Hi @williamdes My boss was wondering if there is a way to send this securely as they don't want the information public.

Hi!
Sorry for the delayed reply
You can email me at williamdes@wdes.fr
And if you have a GPG key you can encrypt the data
My public key is on my website: https://williamdes.eu/public-key.asc

Thanks in advance for helping debug

@williamdes williamdes added the question Used when we need feedback from the submitter or when the issue is a question about PMA label Mar 23, 2022
@KTM25
Copy link
Author

KTM25 commented Mar 24, 2022

No worries!
Email titled as MySQL Table Structure

@williamdes
Copy link
Member

No worries!
Email titled as MySQL Table Structure

Thank you, I received it and will process it as soon as possible when I am back on my laptop

@KTM25
Copy link
Author

KTM25 commented Apr 12, 2022

Hi @williamdes,

Just curious if there is any update to this?

Thanks!

@KTM25
Copy link
Author

KTM25 commented Apr 27, 2022

Hey @williamdes

Hope all is well, just wanting to checkin.

Appreciate it!

@williamdes
Copy link
Member

Hey @williamdes

Hope all is well, just wanting to checkin.

Appreciate it!

Hey @KTM25
I am really sorry for the time this takes. Still under a lot of work to do at work.
But I did not forget you

Can you let me know if when you export to SQL the table and then create a new database and import the SQL dump you still have the error ?

@williamdes
Copy link
Member

Could be similar to #17498

MauricioFauth added a commit to MauricioFauth/phpmyadmin that referenced this issue May 6, 2022
- Fixes phpmyadmin#17428
- Fixes phpmyadmin#17498

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
MauricioFauth added a commit that referenced this issue May 6, 2022
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
@MauricioFauth MauricioFauth self-assigned this May 6, 2022
@MauricioFauth MauricioFauth added has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete and removed question Used when we need feedback from the submitter or when the issue is a question about PMA labels May 6, 2022
@MauricioFauth MauricioFauth added this to the 5.1.4 milestone May 6, 2022
@williamdes
Copy link
Member

Hi @KTM25
Could you test the patch 29170a2 and let me know if it works ?
I re-generated the 5.1 snapshot: (phpMyAdmin 5.1+snapshot)

williamdes added a commit that referenced this issue Oct 13, 2022
Pull-request: #17775
Fixes: #17428

Signed-off-by: William Desportes <williamdes@wdes.fr>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 2023
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 has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
None yet
Development

No branches or pull requests

3 participants