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

The menu does not display properly after logging in. Console error "Uncaught SyntaxError: Unexpected token u in JSON at position 0" appears. #17465

Closed
A-Wat opened this issue Mar 31, 2022 · 10 comments
Assignees
Labels
Bug A problem or regression with an existing feature
Milestone

Comments

@A-Wat
Copy link

A-Wat commented Mar 31, 2022

Describe the bug

I downloaded the source files for phpMyAdmin version 5.1.3 from the official site.
Using that source file, I installed phpMyAdmin on my server.

I can log in correctly, but the menu does not display correctly on the page after logging in.

like this...

image

However, the moment the page is displayed, the list of databases is displayed for a moment and then disappears immediately.

I found the following issue and tried it but the condition did not improve.
#17426

To Reproduce

Steps to reproduce the behavior:

  1. Go to http://localhost/phpMyAdmin/
  2. Log in to phpMyAdmin
  3. Display the phpMyAdmin top page
  4. See error

Expected behavior

Displays a list of databases in the connected database server.
image

Screenshots

Console error
image

DevTools LocalStorage
image

DevTools Network
image
The description "index.php?route=/error-report" indicates that an error has occurred.

Server configuration

  • Operating system:MiracleLinux8.3
  • Web server:Nginx1.20.1
  • Database version:5.5.57-log - MySQL Community Server (GPL)
  • PHP version:php8.0.12
  • phpMyAdmin version:5.1.3

Client configuration

  • Browser:GoogleChrome 87.0.4280.88、GoogleChrome 56.0.2924.87
  • Operating system:Windows10

Additional context

#17426
I have tried re-uploading new source files with this issue as a reference, but no improvement.

We tried all possible measures, but to no avail.
I would like to know if you have any similar problems or information that might be relevant.

@williamdes
Copy link
Member

Hi
Could you try to see what the URL outputs instead of json contents?
It may be a server misconfiguration

@ghost
Copy link

ghost commented Apr 1, 2022

This appears to be identical to the problems I have, which I asked about on Stack Overflow yesterday. https://stackoverflow.com/questions/71697154/phpmyadmin-databases-appear-fleetingly-then-disappear

@matthieumarrast
Copy link

matthieumarrast commented Apr 11, 2022

Same error for me.

  • Version : 5.1.3deb1+focal2
  • PHP 8.1.4
  • Ubuntu 20.04

@williamdes williamdes added the Bug A problem or regression with an existing feature label Apr 11, 2022
@williamdes williamdes added this to the 5.1.4 milestone Apr 11, 2022
@A-Wat
Copy link
Author

A-Wat commented Apr 12, 2022

Thank you.
I have been trying to find out what I can hint at myself.

I tried these.

  1. Installed and checked phpMyAdmin 4.9.10.
  2. Installed and checked phpMyAdmin 5.2.0-rc1.

As a result, the following PHP error was returned.

  1. Installed and checked phpMyAdmin 4.9.10.

thrown in /usr/share/nginx/dev/phpMyAdmin/libraries/classes/UserPreferences.php on line 177" while reading response header from upstream, client: client-ip, server: server-host, request: "POST /phpMyAdmin/error_report.php HTTP/1.1", upstream: "fastcgi://unix:/var/opt/remi/php80/run/php-fpm/www.sock:", host: "server-ip"
2022/04/04 13:38:09 [error] 18096#18096: *545377 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: PhpMyAdmin\UserPreferences::apply(): Argument #1 ($config_data) must be of type array, null given, called in /usr/share/nginx/dev/phpMyAdmin/libraries/classes/Config.php on line 939 and defined in /usr/share/nginx/dev/phpMyAdmin/libraries/classes/UserPreferences.php:177
Stack trace:
#0 /usr/share/nginx/dev/phpMyAdmin/libraries/classes/Config.php(939): PhpMyAdmin\UserPreferences->apply()
#1 /usr/share/nginx/dev/phpMyAdmin/libraries/common.inc.php(459): PhpMyAdmin\Config->loadUserPreferences()
#2 /usr/share/nginx/dev/phpMyAdmin/db_structure.php(14): require_once('...')
#3 {main}
thrown in /usr/share/nginx/dev/phpMyAdmin/libraries/classes/UserPreferences.php on line 177" while reading response header from upstream, client: client-ip, server: server-host, request: "GET /phpMyAdmin/db_structure.php?server=1&db=convert_utf8&ajax_request=true&ajax_page_request=true&_nocache=1649047088978295963&token=4a4c6e3e455c464a395b3c5a776a5752 HTTP/1.1", upstream: "fastcgi://unix:/var/opt/remi/php80/run/php-fpm/www.sock:", host: "server-ip"

  1. Installed and checked phpMyAdmin 5.2.0-rc1.

2022/04/04 10:40:57 [error] 24035#24035: *482829 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: PhpMyAdmin\UserPreferences::apply(): Argument #1 ($config_data) must be of type array, null given, called in /usr/share/nginx/dev/phpMyAdmin/libraries/classes/Config.php on line 450 and defined in /usr/share/nginx/dev/phpMyAdmin/libraries/classes/UserPreferences.php:187
Stack trace:
#0 /usr/share/nginx/dev/phpMyAdmin/libraries/classes/Config.php(450): PhpMyAdmin\UserPreferences->apply()
#1 /usr/share/nginx/dev/phpMyAdmin/libraries/classes/Common.php(286): PhpMyAdmin\Config->loadUserPreferences()
#2 /usr/share/nginx/dev/phpMyAdmin/index.php(40): PhpMyAdmin\Common::run()
#3 {main}
thrown in /usr/share/nginx/dev/phpMyAdmin/libraries/classes/UserPreferences.php on line 187" while reading response header from upstream, client: client-ip, server: server-host, request: "GET /cck/phpMyAdmin/index.php?route=/&route=%2F HTTP/1.0", upstream: "fastcgi://unix:/var/opt/remi/php80/run/php-fpm/www.sock:", host: "server-ip"

IP addresses and other information are hidden for business reasons.

I identified the relevant source file from this error statement.
I thought that the value of SESSION was incorrect and $config_data was null.

Maybe there is a mistake in my server settings.

However, I don't have any idea of a setting that might be affected, so if you know of any, I would like to get some ideas.

@williamdes
Copy link
Member

Hi @A-Wat
Reading the code I would need to have the data from:

SELECT `config_data` FROM `pma__userconfig` 

Can you send the query answer here ?
See:

'config_data' => $row ? json_decode($row['config_data'], true) : [],

@A-Wat
Copy link
Author

A-Wat commented Apr 18, 2022

Hello, @williamdes

I have tried running the query.
SELECT `config_data` FROM `pma__userconfig`

The following values were returned as a result.

array(1) { ["config_data"]=> string(13) "{"lang":"ja"}" }

Can you see what is happening?

@JoelLisenby
Copy link

JoelLisenby commented Apr 22, 2022

I am seeing this occur as well after upgrading from Ubuntu 18.04 to 20.04 and also upgrading PHP from 7 to 8.1

jquery-migrate.js?v=5.1.3deb1%2Bfocal2:69 JQMIGRATE: Migrate is installed with logging active, version 3.3.2
jquery-migrate.js?v=5.1.3deb1%2Bfocal2:100 JQMIGRATE: jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos
migrateWarn @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:100
get @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:113
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
jquery-migrate.js?v=5.1.3deb1%2Bfocal2:102 console.trace
migrateWarn @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:102
get @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:113
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
jquery-migrate.js?v=5.1.3deb1%2Bfocal2:100 JQMIGRATE: jQuery.expr.filters is deprecated; use jQuery.expr.pseudos
migrateWarn @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:100
get @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:113
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:2
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:2
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
jquery-migrate.js?v=5.1.3deb1%2Bfocal2:102 console.trace
migrateWarn @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:102
get @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:113
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:2
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:2
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
jquery-migrate.js?v=5.1.3deb1%2Bfocal2:100 JQMIGRATE: jQuery.isArray is deprecated; use Array.isArray
migrateWarn @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:100
obj.<computed> @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:125
$.widget @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:3
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
jquery-migrate.js?v=5.1.3deb1%2Bfocal2:102 console.trace
migrateWarn @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:102
obj.<computed> @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:125
$.widget @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:3
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
jquery-migrate.js?v=5.1.3deb1%2Bfocal2:100 JQMIGRATE: jQuery.isFunction() is deprecated
migrateWarn @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:100
obj.<computed> @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:125
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
each @ jquery.min.js?v=5.1.3deb1%2Bfocal2:1
$.widget @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:3
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
jquery-migrate.js?v=5.1.3deb1%2Bfocal2:102 console.trace
migrateWarn @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:102
obj.<computed> @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:125
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
each @ jquery.min.js?v=5.1.3deb1%2Bfocal2:1
$.widget @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:3
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
(anonymous) @ jquery-ui.min.js?v=5.1.3deb1%2Bfocal2:1
VM132:1 Uncaught SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.success (functions.js?v=5.1.3deb1%2Bfocal2:5430:30)
    at fire (jquery.min.js?v=5.1.3deb1%2Bfocal2:2:12157)
    at Object.fireWith [as resolveWith] (jquery.min.js?v=5.1.3deb1%2Bfocal2:2:13328)
    at done (jquery.min.js?v=5.1.3deb1%2Bfocal2:4:27808)
    at XMLHttpRequest.<anonymous> (jquery.min.js?v=5.1.3deb1%2Bfocal2:4:31149)
success @ functions.js?v=5.1.3deb1%2Bfocal2:5430
fire @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
fireWith @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
done @ jquery.min.js?v=5.1.3deb1%2Bfocal2:4
(anonymous) @ jquery.min.js?v=5.1.3deb1%2Bfocal2:4
load (async)
send @ jquery.min.js?v=5.1.3deb1%2Bfocal2:4
ajax @ jquery.min.js?v=5.1.3deb1%2Bfocal2:4
jQuery.ajax @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:305
Functions.configGet @ functions.js?v=5.1.3deb1%2Bfocal2:5410
treeInit @ navigation.js?v=5.1.3deb1%2Bfocal2:1368
Navigation.ResizeHandler @ navigation.js?v=5.1.3deb1%2Bfocal2:1371
(anonymous) @ navigation.js?v=5.1.3deb1%2Bfocal2:289
mightThrow @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
process @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
setTimeout (async)
(anonymous) @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
fire @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
fireWith @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
fire @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
fire @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
fireWith @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
ready @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
completed @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
VM133:1 Uncaught SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.success (functions.js?v=5.1.3deb1%2Bfocal2:5430:30)
    at fire (jquery.min.js?v=5.1.3deb1%2Bfocal2:2:12157)
    at Object.fireWith [as resolveWith] (jquery.min.js?v=5.1.3deb1%2Bfocal2:2:13328)
    at done (jquery.min.js?v=5.1.3deb1%2Bfocal2:4:27808)
    at XMLHttpRequest.<anonymous> (jquery.min.js?v=5.1.3deb1%2Bfocal2:4:31149)
success @ functions.js?v=5.1.3deb1%2Bfocal2:5430
fire @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
fireWith @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
done @ jquery.min.js?v=5.1.3deb1%2Bfocal2:4
(anonymous) @ jquery.min.js?v=5.1.3deb1%2Bfocal2:4
load (async)
send @ jquery.min.js?v=5.1.3deb1%2Bfocal2:4
ajax @ jquery.min.js?v=5.1.3deb1%2Bfocal2:4
jQuery.ajax @ jquery-migrate.js?v=5.1.3deb1%2Bfocal2:305
Functions.configGet @ functions.js?v=5.1.3deb1%2Bfocal2:5410
initialize @ console.js?v=5.1.3deb1%2Bfocal2:77
(anonymous) @ console.js?v=5.1.3deb1%2Bfocal2:1576
mightThrow @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
process @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
setTimeout (async)
(anonymous) @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
fire @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
fireWith @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
fire @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
fire @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
fireWith @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
ready @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2
completed @ jquery.min.js?v=5.1.3deb1%2Bfocal2:2

MauricioFauth added a commit to MauricioFauth/phpmyadmin that referenced this issue Apr 24, 2022
Related to phpmyadmin#17465.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
@HazNet
Copy link

HazNet commented May 10, 2022

sudo sed -i -e 's/newInstanceArgs($arguments)/newInstanceArgs(array_values($arguments))/g' /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php && cat /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php | grep "newInstanceArgs"

run this in terminal if you get "become following error: Fatal error: Uncaught Error: Unknown named parameter $$response in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php:1140 Stack trace: #0"

@williamdes
Copy link
Member

sudo sed -i -e 's/newInstanceArgs($arguments)/newInstanceArgs(array_values($arguments))/g' /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php && cat /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php | grep "newInstanceArgs"

run this in terminal if you get "become following error: Fatal error: Uncaught Error: Unknown named parameter $$response in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php:1140 Stack trace: #0"

This is #16301 and #16968

@ibennetch ibennetch modified the milestones: 5.1.4, 5.2.1 May 11, 2022
@A-Wat
Copy link
Author

A-Wat commented Jul 5, 2022

Thank you very much.
I can confirm that the problem I was facing can be resolved by installing version 5.2.0!

@A-Wat A-Wat closed this as completed Jul 5, 2022
@williamdes williamdes self-assigned this Jul 5, 2022
@williamdes williamdes modified the milestones: 5.2.1, 5.2.0 Jul 5, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 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
Projects
None yet
Development

No branches or pull requests

6 participants