Welcome Guest, Not a member yet? Register   Sign In
ErrorException #1 reported
#1

(This post was last modified: 01-31-2023, 09:34 AM by b126.)

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
Reply
#2

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
Reply
#3

(This post was last modified: 02-01-2023, 03:03 PM by b126.)

(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?
Reply
#4

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

(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
Reply
#6

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

This is great! Thank you.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB