I have just migrated a Drupal 8 site. Everything works, except for the login. When I submit the login form, I receive "Access Denied" page from the theme. Similarly, I get some SMTP module errors when I try resetting the password.
My .htaccess files are identical between the source and the new site. I have also tried truncating the "sessions" table in the database.
When I run
drush watchdog-show command, I get the following, which I think corresponds to my trying to login and reset the password.
2053 28/Feb 16:23 user notice Session opened for admin. 2052 28/Feb 16:23 php error RuntimeException: Failed to start the session because headers have already been sent by "/var/www/html/modules/smtp/src/PHPMailer/SMTP.php" at line 800. in Symfony\Component\HttpFoundation 2051 28/Feb 16:23 mail error Error sending email (from email@example.com to firstname.lastname@example.org with reply-to email@example.com). 2050 28/Feb 16:23 smtp error Error sending e-mail from firstname.lastname@example.org to email@example.com: SMTP Error: Could not authenticate. 2049 28/Feb 16:23 smtp info Sending mail to: firstname.lastname@example.org 2048 28/Feb 16:23 user notice Login attempt failed for admin. 2047 28/Feb 16:22 user notice Session opened for admin. 2046 28/Feb 15:23 page not warning /phpmyadmin/scripts/setup.php found 2045 28/Feb 14:48 cron notice Cron run completed. 2044 28/Feb 14:48 mail error Error sending email (from email@example.com to firstname.lastname@example.org with reply-to not set).
What else can I try to fix this?
I have been able to deduce that this behavior only occurs in Chrome browser. Others like Firefox and IE work well. Similarly, the problem only occurs only in AWS EC2 instance. However, I still do not have a solution.