Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output complete stacktrace #735

Open
onli opened this issue Jun 10, 2020 · 3 comments
Open

Output complete stacktrace #735

onli opened this issue Jun 10, 2020 · 3 comments
Milestone

Comments

@onli
Copy link
Member

onli commented Jun 10, 2020

Right now, we have a setup to control how PHP reacts to errors and exceptions. It is defined in

if (!function_exists('errorToExceptionHandler')) {
I think that the stacktrace part of that is broken. Right now for example I get this message in my log:

[10-Jun-2020 15:58:10] WARNING: [pool www] child 11420 said into stderr: "Stack trace:"
[10-Jun-2020 15:58:10] WARNING: [pool www] child 11420 said into stderr: "#0 /var/www/virtual/onli2/html/s9y_dev/include/compat.inc.php(254): errorToExceptionHandler(1, 'Uncaught ErrorE...', '/var/www/virtua...', 38)"
[10-Jun-2020 15:58:10] WARNING: [pool www] child 11420 said into stderr: "#1 [internal function]: fatalErrorShutdownHandler()"
[10-Jun-2020 15:58:10] WARNING: [pool www] child 11420 said into stderr: "#2 {main}"
[10-Jun-2020 15:58:10] WARNING: [pool www] child 11420 said into stderr: "  thrown in /var/www/virtual/onli2/html/s9y_dev/include/admin/images.inc.php on line 38"

Note how the #0 args get shortened.

In the browser, I get this error:

Fatal error:  Uncaught ErrorException: Warning: Use of undefined constant NO_FILE_SELECTED - assumed 'NO_FILE_SELECTED' (this will throw an Error in a future version of PHP) in /var/www/virtual/onli2/html/s9y_dev/include/admin/images.inc.php:38
Stack trace:
#0 /var/www/virtual/onli2/html/s9y_dev/include/admin/images.inc.php(38): errorToExceptionHandler(2, 'Use of undefine...', '/var/www/virtua...', 38, Array)
#1 /var/www/virtual/onli2/html/s9y_dev/serendipity_admin.php(115): include('/var/www/virtua...')
#2 {main}
  thrown in /var/www/virtual/onli2/html/s9y_dev/include/admin/images.inc.php on line 38

Note how #0 and #1 gets shorted, while at least here the real error message is helpful enough.

Somehow related discussion was in #399 (comment) and the linked commit.

@onli onli added this to the 2.4 milestone Jun 10, 2020
@stephanbrunker
Copy link
Contributor

To the cause of the error: This is because i pulled out the fix of the empty media upload from my branch, missing the added constant. Simplest solution is to cherry-pick the lastest version of the language constants from my branch, that should cover everything.

@stephanbrunker
Copy link
Contributor

I see I did this already. Commit 65e1007 from 6th of June includes 'NO_FILE_SELECTED'

@onli
Copy link
Member Author

onli commented Jun 10, 2020

Yeah, I had to update to current master. But it's really just an example :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants