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

When an API request fails during archiving (core:archive), output the backtrace in the error message #8616

Closed
mattab opened this issue Aug 21, 2015 · 8 comments · Fixed by #13923
Assignees
Labels
c: Usability For issues that let users achieve a defined goal more effectively or efficiently. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@mattab
Copy link
Member

mattab commented Aug 21, 2015

When an API request fails during archiving (core:archive), we currently display the plugin name that caused an error in the message. This helps finding out which plugin caused the failure.

In general, maybe we could make the error output even more verbose. Instead of just displaying the plugin name, could we also the full backtrace?

(afaik it used to work in this way few months ago, and was helpful in troubleshooting archiving issues.)

@tsteur
Copy link
Member

tsteur commented Aug 21, 2015

This should be only if triggered via core:archive command? I reckon not when we archive via API request etc as it would be returned in the API maybe etc. Maybe it would be better to just log such messages and backtrace to a file instead.

There's eg this monolog handler:

From https://github.com/Seldaek/monolog/blob/master/doc/02-handlers-formatters-processors.md :

FingersCrossedHandler: A very interesting wrapper. It takes a logger as parameter and will accumulate log records of all levels until a record exceeds the defined severity level. At which point it delivers all records, including those of lower severity, to the handler it wraps. This means that until an error actually happens you will not see anything in your logs, but when it happens you will have the full information, including debug and info records. This provides you with all the information you need, but only when you need it.

@mattab
Copy link
Member Author

mattab commented Aug 21, 2015

This should be only if triggered via core:archive command? I reckon not when we archive via API request etc as it would be returned in the API maybe etc.

yes, using SettingsServer::isArchivePhpTriggered() should be safe

Maybe it would be better to just log such messages and backtrace to a file instead.

Not sure about instead... would there be an advantage to logging to file? it would be an extra step for users to troubleshoot as they'd need to open the file. Already core:archive output should be sent to admins by email whenever there is an error, so it's nicer not to have an additional step to troubleshoot.

There's eg this monolog handler: FingersCrossedHandler:

this sounds very interesting to log additional debug data, whenever an error has occured! 👍 Could we put this in new issue?

(logging backtrace in core:archive error message still useful IMO even when we have FingersCrossedHandler additionally logging detailed info to file)

@tsteur
Copy link
Member

tsteur commented Aug 21, 2015

Not sure about instead... would there be an advantage to logging to file? it would be an extra step for users to troubleshoot as they'd need to open the file. Already core:archive output should be sent to admins by email whenever there is an error, so it's nicer not to have an additional step to troubleshoot.

Maybe not instead but at least on top. Even a backtrace is often not very helpful to debug those kinda issues...

If it's too hard to access the log files then it shouldn't be too hard to have a "log viewer" in the UI

@mattab
Copy link
Member Author

mattab commented Aug 21, 2015

 Maybe not instead but at least on top. 

+1

Even a backtrace is often not very helpful to debug those kinda issues...

true, but without backtrace (and before you added the plugin name), it was even impossible ;-)

If it's too hard to access the log files then it shouldn't be too hard to have a "log viewer" in the UI

Seems very valuable to add this into LTS #7239 - how much work will it be do you think?

@tsteur
Copy link
Member

tsteur commented Aug 21, 2015

depends on the scope ;) and which library/tool we can use for it... hard to estimate

@mattab
Copy link
Member Author

mattab commented Aug 21, 2015

I'll temptatively move #7239 to 2.15.1 so we can at least think of the scope together - maybe we can KISS and then it'd be for sure high value to have in our LTS version :-)

@mattab
Copy link
Member Author

mattab commented Sep 20, 2015

@tsteur Do you know if the new LogViewer plugin solve this issue, ie. when core:archive fails, could one get the backtrace of the failure directly after installing the LogViewer plugin? are the backtraces logged by default? I guess we need to work on #8695 as well?

@mattab mattab added this to the 2.15.1 milestone Sep 20, 2015
@mattab mattab added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Usability For issues that let users achieve a defined goal more effectively or efficiently. labels Sep 20, 2015
@tsteur
Copy link
Member

tsteur commented Sep 21, 2015

No work was done on this so I doubt a backtrace would be logged.

And one can see something in LogViewer only if log to files or databases is enabled

@mattab mattab modified the milestones: 2.16.0, 2.15.1 Sep 21, 2015
@mattab mattab removed this from the 2.15.1 milestone Oct 20, 2015
@mattab mattab added this to the Mid term milestone Nov 26, 2015
@mattab mattab modified the milestones: Long term, Mid term Dec 5, 2016
@diosmosis diosmosis self-assigned this Dec 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Usability For issues that let users achieve a defined goal more effectively or efficiently. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
3 participants