Fatal Error: Authentication.php

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
aduff
Posts: 23
Joined: 2020-10-24 15:01

Fatal Error: Authentication.php

Post by aduff » 2022-03-03 16:06

Hi.

Since upgrading to version 22.12, any new APP that I run gives me a blank screen for at least 5 minutes and then displays the error below:

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 4096 bytes) in /var/www/html/glucose/resources/lib/Authentication.php on line 358

It seems the Authentication.php is new since using the old releases, anyone else had this issue?

I run this on a Raspberry Pi which I have done for over a year.

I recompiled some old code using the axp file and they still work by any new code doesn't.

Kind regards
Alan Duff.

aduff
Posts: 23
Joined: 2020-10-24 15:01

Re: Fatal Error: Authentication.php

Post by aduff » 2022-03-03 21:36

Update:
I have located the issue to be with memory allocation through PHP.

I have increased the memory_limit in the php.ini file but again the error still persists, no ,matter what numbers I try it just keeps failing.

Last message:
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /var/www/html/glucose/settings-manager.php on line 73

The Raspberry Pi has 1GB of memory and swap file size of 1GB with disk free space of 4GB... I have had no issues running PHP scripts generated by AppGini before the upgrade so wonder if something has changed in the generating of coding which now requires more memory.

I have tried the same using XAMPP which runs on my main WIndows 10 computer and it runs OK.

I'm mythed as to what is causing these PHP memory errors.

Kind regards
Alan Duff

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Fatal Error: Authentication.php

Post by jsetzer » 2022-03-03 22:16

PHP 7.4?
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

aduff
Posts: 23
Joined: 2020-10-24 15:01

Re: Fatal Error: Authentication.php

Post by aduff » 2022-03-04 14:09

Hi.

The version I have is
7.3.31-1~deb10u1

Would this be the issue?

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Fatal Error: Authentication.php

Post by jsetzer » 2022-03-04 15:39

No, I think every version > PHP7 should be fine.

I have upgraded to 22.12 two days ago, regenerated a couple of apps but I don't have any problems. But I have not tested on RasPI.

Sorry I don't have any other idea right now.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

aduff
Posts: 23
Joined: 2020-10-24 15:01

Re: Fatal Error: Authentication.php

Post by aduff » 2022-03-04 17:35

Hi Jsetzer.

Thank you for replying.

I will continue to search for an answer and post here once hopefully solved.
:)

Kind regards
Alan Duff

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: Fatal Error: Authentication.php

Post by peebee » 2022-03-07 06:20

You could maybe try disabling memory_limit on the scripts that your are having issues with? See if it makes a difference?

https://www.php.net/manual/en/ini.core. ... mory-limit

ini_set('memory_limit', -1);

aduff
Posts: 23
Joined: 2020-10-24 15:01

Re: Fatal Error: Authentication.php

Post by aduff » 2022-03-07 23:27

Hello peebee.

I changed the memory_limit to -1 but then execution time 120 seconds was exceeded.

I then changed the max_execution_time to 300 seconds and then the old message appeared:

PHP Fatal error: Out of memory (allocated 1910505472) (tried to allocate 262144 bytes) in /var/www/html/glucose/settings-manager.php on line 187

My old code works fine it's new code generated by the latest version gives this error which sounds like allocation of memory has changed or something is causing it to request more.

I tried the same code on XAMPP (Windows) and the new code works fine.

The Raspberry Pi has 1GB memory so maybe this is the issue now but wasn't before the latest release.

I'm baffled and still trying other things to see what the cause is as I prefer to use the Raspberry Pi as I have always done with no issue until now.

Kind regards
Alan Duff

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Fatal Error: Authentication.php

Post by pbottcher » 2022-03-08 07:44

Hi there,

just to make sure. Do you have an custom code that is executed, or are you using a plain App?

If you have custom code, try to generate a simple App and load it to you Rasp to see if that gives the same result.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

aduff
Posts: 23
Joined: 2020-10-24 15:01

Re: Fatal Error: Authentication.php

Post by aduff » 2022-03-08 10:14

Hi pbottcher.

I have no custom code I'm just using a simple plain App with 1 table and 3 fields.


Kind regards
Alan Duff

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Fatal Error: Authentication.php

Post by pbottcher » 2022-03-08 12:24

Hi,

did you check with a new "empty" App if it has the same effect?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

aduff
Posts: 23
Joined: 2020-10-24 15:01

Re: Fatal Error: Authentication.php

Post by aduff » 2022-03-08 15:50

Hi.

Yes, I have created two new apps but with the same result.

I'm not a coder so wouldn't know where to check what's going on, is there a feature where it shows the flow the code follows to track where the memory is being requested?

Kind regards
Alan Duff

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Fatal Error: Authentication.php

Post by pbottcher » 2022-03-08 20:07

Hi,

can you checl your DB table membership_groups to see if there is any stange entry.
Also can you check your confg.php for the anonymousGroupand check if that is in the membership_groups
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

aduff
Posts: 23
Joined: 2020-10-24 15:01

Re: Fatal Error: Authentication.php

Post by aduff » 2022-03-08 21:18

Hi.

Having pointed me in the right direction the issue has now been resolved but not sure why it occurred, thank you!

Here's what I found.
  • membership_groups - *missing from DB* - created the table from a known working DB
    membership_users - *missing from DB* - created the table from a known working DB
    membership_grouppermissions - *empty* populated from a known working DB
Once these were present in the DB the page loaded!!

I'm wondering at what point the above are created/populated as it appears this part was never executed.

The only thing I can think of is when the config.php is created it fails on creation (for me), maybe permissions error, at the fail point the details are displayed to copy and paste after creating the file manually. There is no continue button at this fail point so maybe the creation of the membership tables above are then not created?

Screenshot of the page where it fails to create the config.php file attached.




Kind regards
Alan Duff
Attachments
Screenshot 2022-03-08 211609.jpg
Failed to create config.php
Screenshot 2022-03-08 211609.jpg (53.22 KiB) Viewed 2550 times

aduff
Posts: 23
Joined: 2020-10-24 15:01

Re: Fatal Error: Authentication.php

Post by aduff » 2022-03-09 11:59

I have now resolved the issue with the Raspberry Pi so that the config.php does not fail to create.

used command:
sudo chown -R www-data:www-data /var/www


Kind regards
Alan Duff

Post Reply