I’ve spent the past week and a half debugging a Drupal 7 site that returns an AJAX error instead of letting me log into the admin account. I’m going to walk through my previous debugging attempts in hopes that someone catches something. If anyone has any ideas about where to go next, how to debug this, or how to better format/display any additional relevant information I would be most appreciative.
Error when clicking log-in:
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /system/ajax StatusText: OK ResponseText:
Checking Drupal watchdog logs via sql:
user | Session opened for %name. | a:1:{s:5:"%name";s:1:"admin_name_goes_here";} myurl.org/system/ajax | myurl.org/user/login php | %type: !message in %function (line %line of %file). | a:6:{s:5:"%type";s:6:"Notice";s:8:"!message";s:30:"Undefined index: form_build_id";s:9:"%function";s:15:"ajax_get_form()";s:5:"%file";s:42:"/var/www/html/WtW/drupal/includes/ajax.inc";s:5:"%line";i:325;s:14:"severity_level";i:5;} myurl.org/system/ajax |. myurl.org/user/login Ajax | **INVALID form POST data**. a:0:{}
Walking through attempted login with web development tools:
1. DOMException: Failed to execute 'querySelectorAll' on 'Element': '[id='user-login'] input:file' is not a valid descriptor. 2. SyntaxError: Unexpected end of JSON input 3. An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /system/ajax StatusText: OK ResponseText: 4. DOMException: Failed to execute 'querySelectorAll' on 'Element': '[id='user-login'] .form-item.has-error:not(.form-type-password.has-feedback)' is not a valid selector.
httpd access log:
"POST /system/ajax HTTP/1.1" 302 - "http://myurl.org/user/login" " "GET /system/ajax HTTP/1.1" 200 - "http://myurl.org/user/login" "
httpd error log:
empty
Background:
Client: Drupal 7.54 Webserver: Apache/2.4.6 OS: Red Hat Enterprise Linux Server release 7.4 (Maipo) Database: 5.5.56-MariaDB MariaDB Server PHP Version: PHP 5.4.16 (cli) Clean URLS: Enabled Theme: Garland (was custom bootstrap) Log-in: LDAP (currently broken) Browsers: Chrome, Safari, Firefox
Trivia:
-
the problem was first detected after I messed up some settings on the LDAP server. I’m hesitant to blame this since as I understand it the LDAP app will still let you log-in as user 1/admin normally.
-
entering incorrect information will correctly display the “unrecognized username or password” error message. The error only fires if I successfully enter the admin name and password.