Need global error catcher that can send reports to us

Bug #579375 reported by Kieran Fleming
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenSatNav
Fix Released
High
Guillaume Rosaire

Bug Description

Revision history for this message
Kieran Fleming (kieran-fleming) wrote :

Application should from the earliest stages allow proper bug-reporting. If (when) the new application crashes, it should be handled gracefully. Instead of ''Force Quit'', the user should be asked whether they would like to send an automatic bug-report to the developer/s. This will check to see whether a current version of opensatnav is being used, and if so, will gather any information regarding build and logs, and prompt the user to enter any supporting information. This will then be submitted, to aid development.

Revision history for this message
chris_debian (cjhandrew) wrote :

When the user submits a bug report, is it possible for it to be formatted in such a way that a new bug will automatically be created here in the _Issues_ area, or do we need to think of an alternative?

Chris.

Revision history for this message
Guillaume Rosaire (zerog) wrote :

chris_debian wrote:
> When the user submits a bug report, is it possible for it to be formatted in such a way that a new bug will automatically be created here in the _Issues_ area, or do we need to think of an alternative?
>
> Chris.

I tried Vespucci this afternoon (Android Osm editor). When exceptions arise, it is attached to an email that the user can expand to add what he thinks should be.
I like that way of sending bug report. It's easy enough for anyone.

And indeed, that would be nice if that could create directly an issue that we could accept or dismiss if needed.

For example, it would send the issue to a special email adress (<email address hidden>) and create the corresponding issue here.

On the redmine website, it seems to be possible (•Issue creation via email). Enrique, could you have a look at this ?

For this, we need an email server on opensatnav.org. That doesn't currently seem to work :

> Delivery to the following recipient failed permanently:
>
> <email address hidden>
>
> Technical details of permanent failure:
> Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other > email provider for further information about the cause of this error. The error that the other server returned was: > > 553 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) (state 14).

Revision history for this message
Guillaume Rosaire (zerog) wrote :

Started coding on this issue.

Revision history for this message
chris_debian (cjhandrew) wrote :

Cool, I really think this will be a major feature that will aid future development! Any plans on how it may work?

Chris.

Revision history for this message
Guillaume Rosaire (zerog) wrote :

chris_debian wrote:
> Any plans on how it may work?

I had a look at android-remote-stacktrace but it needs a web service to be used, and I don't find it satisfying.

I'm currently trying to implement what I said in my previous comment :
# When an Unexcepted error happens that whould force closing of application by the OS, (UncaughtException), that calls a method that build a mail message (containing the exception stacktrace, and pertinent data like application version, Android version, etc...).
# The user is asked if he would like to send us this generated bug report and if so, it opens one of its e-mail apps (a list presents him the list of mail applications like gmail, or every app on his phone that is able to send mails, so he can choose which email address he will send his bug report from)
# Once here, he can amend this report by telling what he was doing, or anything he seems appropriate for a bug report.
# After that, he can send his email.

This bug report by email will be sent to a special address on opensatnav.org (i.e. <email address hidden>) that could be used to auto create bug reports on this website through Redmine)

We should be able to filter these bug reports, the sender email address must not be seen on the website, but we could if needed contact him by email if we need more info.

+For OSN developers+ :
> This way of sending unexcepted error generated bug reports is done through a handler registered as follows :
><pre>
 Thread.setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler handler)
</pre>
> But this can be reused for trapped unexpected Exception anywhere in the code by calling in a catch block : <pre>try {
  //...
} catch (AnyException e) {
  e.printStackTrace();
  handler.sendBugReport(e);
}</pre>
>
> At the moment, it works for Exceptions when I call the above method, but when an UncaughtException happens, my handler tries to start another Activity (Intent to send email) but SatNavActivity.startActivity(intent) doesn't seem to work. I think that the VM stops the activity before it calls my Handler and I'm unable to start a new task. I need to find a way of doing so if I want it to be useful.

Revision history for this message
chris_debian (cjhandrew) wrote :

Thanks for the explanation. This sounds great.

Chris.

Revision history for this message
Guillaume Rosaire (zerog) wrote :

Just a note :
After a few hours yesterday evening working on this feature, I'm not sure I can use my code for Uncaught Error (works for exception though). I did my best but didn't manage to have a popup or any interactive interface showing to the user when the app is crashing.
I'm starting to look at the Android source code to understand how the default error catcher works (the one who shows a popup saying that the app needs to be closed) but it's half java, half native code not easily understandable.

If I don't manage to have it working, I'll try with android-remote-stacktrace which don't display any user interface or try to do the same sort of thing with the errors and stacktraces.
My Exception handler may be reused for a friendlier to the user bug reporter if needed.

Revision history for this message
Kieran Fleming (kieran-fleming) wrote :

I'll give it a try and let you know.

Revision history for this message
chris_debian (cjhandrew) wrote :

Good team work, guys, let us know how you get-on, Kizza.

Cheers,

Chris.

Revision history for this message
Guillaume Rosaire (zerog) wrote :

I'll commit my handler as it is. It can take an Exception and do the processing of asking the user to generate and send a bug report. It may be used in try/catch blocks as it is right now.

As I said, I can't manage to have it working with really unexpected errors (UncaughtException) but it can already be used for the rest.

In the android-remote-stacktrace, when UncaughtErrors happen, they're written to traces log files in the device and sent in the background to the receiving webserver. There's no interactive interface displayed to the user, which is my current problem. I could maybe do the same, i.e. write the stacktrace to a file and the next time the app is launched, ask the user if he wants a bug report sent. That could do the trick.

Revision history for this message
chris_debian (cjhandrew) wrote :

Assigned to ZeroG as it looks like he's working on this at the moment.

Chris.

Revision history for this message
Guillaume Rosaire (zerog) wrote :

I do have a working solution for the global error catcher.

2 use cases :
# Completely unexpected error that would cause closing of OSN;
> The stack trace of the exception is saved to the device on the SD Card, the next time the user starts OSN, a popup is shown asking him if he wants to send a bug report. (the stacktrace file is then deleted)
# An exception in a try/catch block that wouldn't close the app.
> It's left to the developer that can choose to show almost the same popup to send a bug report if need be.

If the user chooses to send a bug report, the report is generated and an email application on the device is opened to let the user send it. He can add what he wants in the mail.
We need to define the email address that will receive such bug reports.

The report content is as follows :
<pre>
Subject: OpenSatNav 0.8 Error Report (Android: 1.5 - model: HTC Magic)

Dear All,

I encountered the following issue while using OpenSatNav, could you please have a look at it?

java.lang.ArrayIndexOutOfBoundsException
 at com.synchlet.sketch.beta.listadapter.RoomListAdapter.getItem(RoomListAdapter.java:65)
 at com.synchlet.sketch.beta.listadapter.RoomListAdapter.getView(RoomListAdapter.java:109)
 at android.widget.AbsListView.obtainView(AbsListView.java:1251)
 at android.widget.ListView.makeAndAddView(ListView.java:1623)
 at android.widget.ListView.fillDown(ListView.java:607)
 at android.widget.ListView.fillGap(ListView.java:578)
    (...)
</pre>

Revision history for this message
chris_debian (cjhandrew) wrote :

I like the sound of this. Kieran, what do you think? Email address: <email address hidden>, perhaps?

Chris.

Revision history for this message
chris_debian (cjhandrew) wrote :

chris_debian wrote:
> I like the sound of this. Kieran, what do you think? Email address: <email address hidden>, perhaps?
>
> Chris.

Enrique,

COuld you create the email address <email address hidden>, so that we can try to get a working solution?

Cheers,

Chris.

Revision history for this message
Guillaume Rosaire (zerog) wrote :

Code commited, still missing the <email address hidden> email address.

Revision history for this message
chris_debian (cjhandrew) wrote :

Enrique,

Can you help with this?

Chris.

Revision history for this message
Piluso (piluso) wrote :

Yeah, I'm on it. (got internet back)
I'm creating bug-report@.
Cheers,
Enrique

Revision history for this message
chris_debian (cjhandrew) wrote :

piluso wrote:
> Yeah, I'm on it. (got internet back)
> I'm creating bug-report@.
> Cheers,
> Enrique

Thanks, Enrique.

Chris.

Revision history for this message
Piluso (piluso) wrote :

Ok, the automatic creation of bugreports is ignored if it comes from a user
that is not known. So i'll also create a bug-report user. I've given some thought
about the mail server, and i'll setup a google accounts service, it's seasier to
manage, and more people will have the power to manage it, reducing points of failure.

Is it ok with you guys ?

Cheers,
Enrique

Revision history for this message
chris_debian (cjhandrew) wrote :

piluso wrote:
> Ok, the automatic creation of bugreports is ignored if it comes from a user
> that is not known. So i'll also create a bug-report user. I've given some thought
> about the mail server, and i'll setup a google accounts service, it's seasier to
> manage, and more people will have the power to manage it, reducing points of failure.
>
> Is it ok with you guys ?
>
> Cheers,
> Enrique

I can't think of any issues with the gmail account. Can anyone think of another solution?

Chris.

Revision history for this message
Guillaume Rosaire (zerog) wrote :

Regarding the ignoring of unknown email address, I knew that could be an issue, but I thought that that could be configured to work in Redmine. Anyway, me must have an intermediate script or anything that could mask the originating address before posting it to the issue tracker.

Is that what you think when creating a gmail address ? A script would receive mails sent to <email address hidden>, and repost them with this gmail address, effectively masking originating users ? Or would the bug reports address be this <email address hidden> ? Anyway, I could help you scripting the intermediate script.

Revision history for this message
Piluso (piluso) wrote :

So if no one has anything agains the idea, i'll setup the google mail and do the dns changes accordingly.
Cheers,
Enrique

Revision history for this message
evolvedlight (steve-evolvedlight) wrote :

Sweet. Any chance you can set up the bug-report as an alias on google mail, create me an account and get the bug-report stuff forwarded there too? It would be easier for me (when finding bugs when actually out in the field and using it) if they got sent to me instead of faffing around with log collector, and mean that its easier for all devs to see the bug reports (and have them forwarded on to a different email)

Np if you dont want to do that though.

Thx
Steve

Revision history for this message
Guillaume Rosaire (zerog) wrote :

Enrique, could you please keep us informed of what is done or needs to be ?

Is <email address hidden> (on gmail servers) working ? Can we have any access to it ?

Revision history for this message
chris_debian (cjhandrew) wrote :

ZeroG wrote:
> Enrique, could you please keep us informed of what is done or needs to be ?
>
> Is <email address hidden> (on gmail servers) working ? Can we have any access to it ?

Guys, I haven't heard from Enrique for a while; hopefully he is well. Does anyone know a way that we can move this issue forward, in his absence? We may need to look for someone that can help Enrique.

Chris.

Revision history for this message
Piluso (piluso) wrote :

Done.
I've sent zeroG, the info about the account.
I'll be doing the hook, shortly after the google app is confirmed.

I'm quite out of the net right now, because i'm launching the project at work and i don't have much time (2 hour sleep days) do i'll be disconnected 'till friday, and i'll give git a try.

Cheers.
E.

Revision history for this message
chris_debian (cjhandrew) wrote :

piluso wrote:
> Done.
> I've sent zeroG, the info about the account.
> I'll be doing the hook, shortly after the google app is confirmed.
>
> I'm quite out of the net right now, because i'm launching the project at work and i don't have much time (2 hour sleep days) do i'll be disconnected 'till friday, and i'll give git a try.
>
> Cheers.
> E.

Many thanks, Enrique. Hope your work goes ok and that you manage to get some sleep.

Chris.

Revision history for this message
Guillaume Rosaire (zerog) wrote :

Seems to work nicely, if it needs enhancement, we'll create another issue.

Revision history for this message
chris_debian (cjhandrew) wrote :

Good work, everybody. This is an essential part of a good app, I believe.

Chris.

Revision history for this message
evolvedlight (steve-evolvedlight) wrote :

Am I in the bug-report group? Any chance of getting a login onto the google mail? Thanks

Revision history for this message
Guillaume Rosaire (zerog) wrote :

evolvedlight wrote:
> Am I in the bug-report group? Any chance of getting a login onto the google mail? Thanks

You are now, instructions by mail

Revision history for this message
evolvedlight (steve-evolvedlight) wrote :

Cool. Just made it send an email to bug-report by pressing buttons quickly while changing orientation repeatedly.
Seems to work fine, thanks ZeroG :-)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.