Page 1 of 1

2FA returns internal server error

Posted: Thu May 04, 2023 12:15 pm
by johan
Hi
When I activate 2FA in my new database, user gets an internal server error(500) after login.
I use V.4.5-2023.04.10.00

What am I missing?
Johan

Re: 2FA returns internal server error

Posted: Thu May 04, 2023 12:52 pm
by kev1n
Hi Johan,

Check your server logs: If you're getting a 500 Internal Server Error, it's likely that there is an issue on the server side. Check your server logs to see if there are any error messages that might give you a clue as to what's going wrong.

Check your PHP version: Make sure that your PHP version is compatible with the version of nuBuilder you are using. The recommended version of PHP for nuBuilder is 7.0.33 or higher.

Also make sure that the 2FA Procedure doesn't contain any errors.

Re: 2FA returns internal server error

Posted: Thu May 04, 2023 8:34 pm
by nac
Johan,

Can you tell us more about your installation? This PHP code will provide some basic information about the software versions.

Code: Select all

$versioninfo = 
    '<h2>Versions</h2><br>'.
    'PHP version: ' . phpversion() .'<br>'.
    'MySQL version: '.db_fetch_row(nuRunQuery("SELECT @@VERSION;"))[0].'<br>'.
    'nuBuilder DB version: '.db_fetch_row(nuRunQuery("SELECT inf_details FROM zzzzsys_info WHERE inf_code = 'nuDBVersion'"))[0].'<br>'.
    'nuBuilder Files version: '.db_fetch_row(nuRunQuery("SELECT inf_details FROM zzzzsys_info WHERE inf_code = 'nuFilesVersion'"))[0];
$js = "nuMessage('$versioninfo');";
nuJavaScriptCallback($js);
You can run it as a 'hidden' procedure.

I am using 2FA and have never had errors of the type you describe.

Neil

Re: 2FA returns internal server error

Posted: Fri May 05, 2023 3:53 pm
by johan
Kev1n

Here is the info about my installation

Code: Select all

PHP version: 7.4.33
MySQL version: 5.7.99-10.4.10-MariaDB
nuBuilder DB version: V.4.5-2023.04.10.00
nuBuilder Files version: V.4.5-2023.04.08.00
I already use 2FA in other databases without a problem.

Johan

Re: 2FA returns internal server error

Posted: Fri May 05, 2023 3:56 pm
by kev1n
kev1n wrote: Thu May 04, 2023 12:52 pm
Check your server logs: If you're getting a 500 Internal Server Error, it's likely that there is an issue on the server side. Check your server logs to see if there are any error messages that might give you a clue as to what's going wrong.
Did you do that?

Re: 2FA returns internal server error

Posted: Fri May 05, 2023 7:31 pm
by johan
Kev1n
I get this in log

Code: Select all

[Fri May 05 19:23:54.972889 2023] [php7:error] [pid 2219] [client 192.168.3.254:38816] PHP Fatal error:  Can't use function return value in write context in /var/www/html/personeel/core/nucommon.php(1406) : eval()'d code(8) : eval()'d code on line 31, referer: https://xxxxxx

Johan

Re: 2FA returns internal server error

Posted: Fri May 05, 2023 8:43 pm
by kev1n
The problem seems to occur within your 2FA Procedure.

Re: 2FA returns internal server error

Posted: Sat May 06, 2023 6:54 am
by johan
Kev1n
Problem solved. There was indeed an error in the procedure I've created.
Thanks for your help.
Johan