Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

2FA returns internal server error

Questions related to using nuBuilder Forte.
Post Reply
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

2FA returns internal server error

Unread post 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
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: 2FA returns internal server error

Unread post 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.
nac
Posts: 115
Joined: Tue Dec 12, 2017 11:28 pm
Location: Aberdeen, UK
Has thanked: 9 times
Been thanked: 12 times

Re: 2FA returns internal server error

Unread post 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
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: 2FA returns internal server error

Unread post 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
Last edited by johan on Fri May 05, 2023 3:59 pm, edited 1 time in total.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: 2FA returns internal server error

Unread post 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?
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: 2FA returns internal server error

Unread post 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
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: 2FA returns internal server error

Unread post by kev1n »

The problem seems to occur within your 2FA Procedure.
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: 2FA returns internal server error

Unread post by johan »

Kev1n
Problem solved. There was indeed an error in the procedure I've created.
Thanks for your help.
Johan
Post Reply