CodeIgniter Forums
ErrorException #1 reported - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: ErrorException #1 reported (/showthread.php?tid=86536)



ErrorException #1 reported - b126 - 01-31-2023

Dear All,
I have a problem with CI4 that I didn't have in CI3.
Occasionally, the details of some of my errors are not properly propagated/escalated to CI, and only a generic ErrorException is displayed.

ErrorException #1
Allowed memory size of 134217728 bytes exhausted (tried to allocate 65015808 bytes)
APPPATH\Views\errors\html\error_exception.php at line 96
{PHP internal code}  —  CodeIgniter\Debug\Exceptions->shutdownHandler ()

This is obviously totally useless for debugging.

How can I get more details about these errors?

PS: I guess this is only the case with "compilation" errors.
for example: just remove an import at the top of your code to reproduce this error


RE: ErrorException #1 reported - kenjis - 01-31-2023

Quote:Allowed memory size of 134217728 bytes exhausted (tried to allocate 65015808 bytes)
APPPATH\Views\errors\html\error_exception.php at line 96

It seems difficult to improve the error message, because it is memory shortage.

1. increase PHP memory
2. comment out the PHP code in error_exception.php around line 96
3. set CI_ENVIRONMENT to production and check the log file


RE: ErrorException #1 reported - b126 - 02-01-2023

(01-31-2023, 07:06 PM)kenjis Wrote:
Quote:Allowed memory size of 134217728 bytes exhausted (tried to allocate 65015808 bytes)
APPPATH\Views\errors\html\error_exception.php at line 96

It seems difficult to improve the error message, because it is memory shortage.

1. increase PHP memory
2. comment out the PHP code in error_exception.php around line 96
3. set CI_ENVIRONMENT to production and check the log file

1. Increasing the memory from 128MB to 1GB didn't helped
2. Commenting line 96 in the view did the job and I got the proper error displayed (see below)
3. And the log is also properly fed

Thank you.
But, don't you think it's a bit sad that this "error_exception" view prevents this message from coming up when it could be very useful in development?
Can this be improved in next version?

For info, the error was : 
Doctrine\Common\Annotations\AnnotationException
[Semantical Error] The annotation "@ORM\Table" in class Test was never imported. Did you maybe forget to add a "use" statement for this annotation?


RE: ErrorException #1 reported - kenjis - 02-01-2023

I found the log file has the error entry before the memory exhausted.
So seeing the log file is recommended.


RE: ErrorException #1 reported - kenjis - 02-01-2023

(02-01-2023, 03:03 PM)b126 Wrote: But, don't you think it's a bit sad that this "error_exception" view prevents this message from coming up when it could be very useful in development?
Can this be improved in next version?

I sent a PR.
https://github.com/codeigniter4/CodeIgniter4/pull/7212


RE: ErrorException #1 reported - b126 - 02-02-2023

(02-01-2023, 09:33 PM)kenjis Wrote: I sent a PR.
https://github.com/codeigniter4/CodeIgniter4/pull/7212

This is great! Thank you.