#4214 (ok 4.1.7) Fatal JavaScript error

4.1.6
fixed
JS (6)
1
2014-02-23
2014-01-03
Sol
No

Searching for databases have been getting me random disconects on phpmyadmin since 4.1.1 . Auth is done through cookie, the server is not local, although phpmyadmin is installed on my local machine. This server has a lot of databases (6 pages on the default config).

Everytime I search for a database on the list after it finishes searching and show me the results, it will show me the DIV saying "Your session has expired. Please log in again". Clicking on the Log In link just reload the page. If I browse to the database this does not happen. This didn't happen on 4.0.10.

Discussion

  • Sol
    Sol
    2014-01-03

    It also happens in other cases. For example, when trying to edit a query, which pops-up another window for the query editor. In this case if I just go ahead and click "GO" on the editor, I get on the main page the following error:

    "phpMyAdmin - Error

    Incorrect format parameter
    Notice in ./import.php#135
    Undefined variable: format

    Backtrace"

     
  • Marc Delisle
    Marc Delisle
    2014-01-03

    "searching for databases": are you talking about the "filter databases by name..." feature?

    Any error in your web server's log file?

     
  • Sol
    Sol
    2014-01-03

    (goddamit stupid formatting help link made me lose my post, let me rewrite)

    Yes, I'm talking about the "Filter databases by name..." feature. More precisely, this happens just after I click the "XX other results found" (or as soon as I mouse over the database list if all of the results happen to be on the same page). Opening the Firebug console I can see the following behavior happening after that action:

    1. There is a POST to navigation.php which finishes correctly and returns the string with the div with the results and message. (also success=true)

    2. The following stuff happens after I click the "XX other results found" link:

    2.1. A call is made to: http://phpmyadmin/js/get_scripts.js.php?server=2&token=[##TOKEN##]&scripts[]=jquery/jquery-1.8.3.min.js&scripts[]=ajax.js&scripts[]=keyhandler.js&scripts[]=jquery/jquery-ui-1.9.2.custom.min.js&scripts[]=jquery/jquery.sprintf.js&scripts[]=jquery/jquery.cookie.js&scripts[]=jquery/jquery.mousewheel.js&scripts[]=jquery/jquery.event.drag-2.2.js&scripts[]=jquery/jquery-ui-timepicker-addon.js&scripts[]=jquery/jquery.ba-hashchange-1.3.js&scripts[]=jquery/jquery.debounce-1.0.5.js&scripts[]=jquery/jquery.menuResizer-1.0.js&scripts[]=cross_framing_protection.js&scripts[]=rte.js&scripts[]=tracekit/tracekit.js&scripts[]=error_report.js&scripts[]=doclinks.js&scripts[]=functions.js&scripts[]=navigation.js&scripts[]=indexes.js&scripts[]=common.js&scripts[]=codemirror/lib/codemirror.js&scripts[]=codemirror/mode/sql/sql.js&scripts[]=codemirror/addon/runmode/runmode.js

    This call also apparently finishes correctly, retuning a 19103 lines file.

    2.2. Together with that call there is another GET, this time to http://phpmyadmin/error_report.php?ajax_request=true&token=[##TOKEN##]&get_settings=true&_nocache=13887839230842135 . This one returns a JSON with success = false and the error = [error div]

    2.3. After the two calls finish (takes 3ms since it is on the localhost) there is an error on the Firebug Console:

    TypeError: $nav_tree_content.position(...) is undefined
    lines = stacktrace.split('\n'),

    And then 2.1, 2.2 and 2.3 just loop infinitely until I click on the Log In link

     
  • Sol
    Sol
    2014-01-03

    Also, there is nothing on the webserver logs. If it might be important, server is:

    Apache/2.4.6 (Ubuntu)
    MySQL Server version: 5.5.34-0ubuntu0.13.10.1 (Ubuntu)
    auth_method (on config.ini) is cookie

    phpmyadmin is configured as a vhost and the url is simply http://phpmyadmin

     
  • Sol
    Sol
    2014-01-15

    Just updated to 4.1.4 and it is still happening

     
  • Sol
    Sol
    2014-01-27

    Another quick update, after updating to 4.1.6 the bug has changed. Now I don't get disconnected anymore, but when I click on the "xx other results found message" I get a "A Fatal JavaScript error has occurred." message. When expanding the error is:

    Notice in ./libraries/navigation/Nodes/Node_Database_Container.class.php#33
    Undefined index: is_create_db_priv

    Backtrace

    ./libraries/navigation/NodeFactory.class.php#93: Node_Database_Container->construct(
    string 'root',
    integer 1,
    boolean false,
    )
    ./libraries/navigation/NavigationTree.class.php#140: PMA_NodeFactory::getInstance(
    string 'Node_Database_Container',
    string 'root',
    )
    ./libraries/navigation/Navigation.class.php#47: PMA_NavigationTree->
    construct()
    ./navigation.php#70: PMA_Navigation->getDisplay()

    Also, the following two lines repeat on a loop on Firebug:

    http://phpmyadmin/error_report.php?ajax_request=true&token=c9f406e38708cf30174aa3de46e6029e&get_settings=true&_nocache=1390852197029406895

    With a response of

    {"report_setting":"ask","message":"","success":true}

    And

    TypeError: $nav_tree_content.position(...) is undefined
    lines = stacktrace.split('\n'),

    Which happens on this javascript function computeStackTraceFromStacktraceProp

    var testRE = / line (\d+), column (\d+) in (?:<anonymous function:="" (<span="">[^>]+)>|([^)]+))((.)) in (.):\s*$/i,
    lines = stacktrace.split('\n'),
    stack = [],
    parts;

     
  • Marc Delisle
    Marc Delisle
    2014-01-28

    • summary: Getting Random Logout Messages when searching for a database --> Fatal JavaScript error
    • Group: 4.1.1 --> 4.1.6
     
    • labels: --> JS
    • summary: Fatal JavaScript error --> (ok 4.1.7) Fatal JavaScript error
    • status: open --> fixed
    • assigned_to: Atul Pratap Singh
    • Priority: 5 --> 1
     
  • Was fixed for 4.1.7 from error reports.