XF 2.1 500 server error only on XF pages

optrex

Well-known member
Hey,
Just come back to XF and installed a new server and installation on Ubuntu 18.04 and mysql 8. Then looked at push notifications, added HTTPS, checked push worked and went to bed. Checked phone and tried push notifications on there all good.

Got up in the morning, and my XF pages are giving 500 internal server error.

PHP pages are being served as are txt, html and images.

Reboot has made no difference, apache service status ok, mysql service status ok, file ownership and permissions ok, so I'm now stuck. Any ideas?
 
Have you looked at your web server logs to see if there are any details in them?

I'm guessing it's running into a fatal PHP error and that's causing PHP to terminate.

You can try setting debug mode in src/config.php if it's making it that far:
Code:
$config['debug'] = true;
That may expose an error message, though it depends when the issue is happening.

Otherwise, you may need to enable display_errors in your php.ini to see if that outputs anything. (Alternatively, you may need to set PHP's error_log to a file to ensure that fatal errors are logged there to try to get to the bottom of this.)
 
Thank you, thats at least given me the following error

HTML:
Fatal error: Uncaught XF\Db\Exception: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/domain/html/src/XF/Db/Mysqli/Adapter.php:160 Stack trace: #0 /var/www/domain/html/src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array) #1 /var/www/domain/html/src/XF/Db/AbstractAdapter.php(60): XF\Db\Mysqli\Adapter->getConnection() #2 /var/www/domain/html/src/XF/Db/Mysqli/Adapter.php(113): XF\Db\AbstractAdapter->connect() #3 /var/www/domain/html/src/XF/Db/AbstractAdapter.php(467): XF\Db\Mysqli\Adapter->escapeString('options') #4 /var/www/domain/html/src/XF/Db/AbstractAdapter.php(445): XF\Db\AbstractAdapter->quote('options') #5 /var/www/domain/html/src/XF/DataRegistry.php(138): XF\Db\AbstractAdapter->quote(Array) #6 /var/www/domain/html/src/XF/DataRegistry.php(83): XF\DataRegistry->readFromDb(Array, Array) #7 /var/www/domain/html/src/XF/DataRegistry.php(226): XF\DataRegistry->get(Array) in /var/www/domain/html/src/XF/Db/Mysqli/Adapter.php on line 160
 
That actually suggests a problem with DNS name resolution.

What host have you used for the DB config in src/config.php?

If you have used localhost it may be worth switching that to 127.0.0.1 (i.e. the loopback IP address).

If you have used some sort of FQDN (e.g. mysql.someserver.tld) then, again, switching that to use the correct IP address instead may solve the issue.
 
HI @Chris D I've tried both 'localhost' and '127.0.0.1' in the config.php and nothing changes.
It seems odd also that I left it working and came back to it and it wasn't - there is no intended caching active that I know of.
 
I would think that 127.0.0.1 really should sort it. I don't know your PHP config though -- there may be opcache caching that is preventing the changes from being applied.

However, this is a lower level server/DNS issue that you likely want to sort. Approaches may vary depending on the exact cause, but you may need to manually specify DNS servers. See some discussion here: https://ubuntuforums.org/showthread.php?t=2391351
 
I managed to try another url and it gave me a slightly different error relating to
The server requested authentication method unknown to the client
alter user 'username'@'localhost' identified with mysql_native_password by 'password'; fixed it and got my site back up and working.

With this being a new msql 8 database and install, I've still no idea how the new format of password changed, but there you go.
Many thanks for pointing me in the direction of the logging to get a result.
 
Top Bottom