ether / etherpad-lite

Etherpad: A modern really-real-time collaborative document editor.
http://docs.etherpad.org/
Apache License 2.0
16.72k stars 2.85k forks source link

Better errorhandling and reporting for plugins #2438

Closed Akasch closed 4 years ago

Akasch commented 9 years ago

As I was searching for this bug: https://github.com/JohnMcLear/ep_pad_activity_nofication_in_title/issues/1 i had to do a lot poking in the dark because the error gets re-emitted in ace_inner line 479 (in my browser it is at 482 ) all you can see at this code point is that it comes probably from some plugin. The error log on the server states the line in witch the error happend (witch is also some lines off) but not the file, so the line number is not helpful.

I would be happy if it is possible to state the pluginname or js file causing the error. Also if one plugin fails to load often other plugins crate lots of errors because of unfinished loading and mascaraed the original error quite effective. Maybe it is possible to move the try catch around the individual calls of the hooks for eatch plugin, so it should be simpler to state witch plugin/hook failed and to run the other plugins without effect.

For an example of Log messages: Same error, different browser, not really helpful:

[2015-01-04 15:28:01.664] [WARN] client - Uncaught TypeError: Cannot read property 'find' of undefined -- { errorId: 'vN8xLGthMM71iH8xT4gA',
  msg: 'Uncaught TypeError: Cannot read property \'find\' of undefined',
  url: 'https://ep.mafiasi.de/p/g.zxlrWtApv02CWVw3$test',
  linenumber: 101,
  userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36' }

[2015-01-04 15:12:30.492] [WARN] client - TypeError: $sidedivinner is undefined -- { errorId: '076UbZyfcu0lMEsx1vhy',
  msg: 'TypeError: $sidedivinner is undefined',
  url: 'https://ep.mafiasi.de/p/g.Ox9Qh7nI95BjOom0$Aufgabenblatt_1',
  linenumber: 100,
  userAgent: 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0' }
JohnMcLear commented 9 years ago

Try with minify set to false do you still get useless bug reports?

Akasch commented 9 years ago

They look exactly the same if minify is true or false.

The reported source of the error (in the browser console). The undefined Bug is in

VM1152:101 Uncaught TypeError: Cannot read property 'find' of undefined

VM1152 is a dynamically loaded file you can inspect in the console, if you go to the top of the file the original path is there.

JohnMcLear commented 9 years ago

Tbh I develop most plugins and really don't have a problem debugging, it's a pita but it seems to work pretty well for me ;\

Akasch commented 9 years ago

My problem is most of the time that I see errors in the logfile and don't know how to replicate. In my testinviroment they don't happen, in production (with like 10 Plugins) only if some more People use some GroupPads vor example. at the moment I get

[2015-01-06 18:19:04.507] [WARN] client - Error: Permission denied to access property 'console' -- { errorId: '3fhS1vKouwk8waMHyYg5',
  msg: 'Error: Permission denied to access property \'console\'',
  url: 'https://ep.mafiasi.de/p/g.hsuI9ddy0a7exH5L$BitBotsProtokoll',
  linenumber: 3121,
  userAgent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0' }

this don't say there to look or try to replicate. The effect seems to bee that sometimes if more People types in the Pad at the same time this error appears in the log and about 10 seconds later they get disconnected

More info just would make it more easy to debug the production instance after update or if some user braks something (our user are pretty good at this)

JohnMcLear commented 9 years ago

This is an easy one to debug. The editor was in an iframe and they hit an issue with applying changesets, we already have an open issue for this...

Akasch commented 9 years ago

I think it could be more easy to see if a error is definetly caused by a Plugin (Like the Hook failed) and a simple uninstall of some Plugin maybe help resolve this, ore if i have to look deeper in the core.

My user are pretty good at finding edge cases in Plugins and often they are not simple to recreate, but most of the time i see some generic looking errors in the logfile, so often i have to try to remove Plugina to find the responsible.

JohnMcLear commented 9 years ago

If you did want to open a Pull request with better debug output I'd be happy to take a look :)

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.