Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

App closing immediately on start #1053

Closed
3 tasks done
FriederikeHanssen opened this issue Aug 21, 2020 · 45 comments
Closed
3 tasks done

App closing immediately on start #1053

FriederikeHanssen opened this issue Aug 21, 2020 · 45 comments
Assignees
Labels
bug Something isn't working mirrored-to-jira This item is also tracked internally in JIRA

Comments

@FriederikeHanssen
Copy link

FriederikeHanssen commented Aug 21, 2020

Avoid duplicates

  • Bug is not mentioned in the FAQ
  • Bug is specific for Android only, for general issues / questions that apply to iOS and Android please raise them in the documentation repository
  • Bug is not already reported in another issue

Describe the bug

Since a couple of days the app closes immediately after opening it.

Expected behaviour

App opening.

Steps to reproduce the issue

Open the app.

Technical details

  • Mobile device: Huawei P8 Lite
  • Android version: 6.0

Possible Fix

Additional context

Until now, it has worked as expected.
Restarted the phone multiple times and checked that the App is part of the protected background apps.
App version: 1.2.1


Internal Tracking ID: EXPOSUREAPP-2249, EXPOSUREAPP-1851

@FriederikeHanssen FriederikeHanssen added the bug Something isn't working label Aug 21, 2020
@sapcoder123 sapcoder123 added the mirrored-to-jira This item is also tracked internally in JIRA label Aug 21, 2020
@MikeMcC399
Copy link
Contributor

This may be related to Error Reason: 2001; App does not work anymore #968

The mobile device Huawei P8 Android 6.0 is specifically mentioned in #968 (comment)

@MikeMcC399
Copy link
Contributor

@helmutweick also described a similar issue in #642 (comment) for Huawei H60-40 Android 6.0.

@vaubaehn
Copy link
Contributor

vaubaehn commented Aug 21, 2020

@helmutweick also described a similar issue in #642 (comment) for Huawei H60-40 Android 6.0.

Yes, and I think @helmutweick 's amazing logcat stacktraces are pointing to one Huawei specific issue that might be associated with this problem:
Huawei Analytics!
Unfortunately, many Android apps seem to struggle with NullPointerExceptions in com.huawei.lcagent.client.LogCollectManager.GetUserType()
(see here -> https://samebug.io/crashes/1121921 )
And in our case, it was triggered by CWA...

@FriederikeHanssen , there is a very little chance for the moment to work around this. Unfortunately, I don't have any Huawei device, so I can give just some general hints:
Are you able to find anything like this somewhere in your phone's settings:
"Aktivitätsprotokolle"
or "Daten zur Benutzererfahrung"
or "Datenerhebung durch Huawei"
or "Huawei erlauben, Daten zu technischen Details und Interaktionen zu senden"
or "Daten zur Qualität, Leistung und Gerätefehlersuche an Huawei senden" ?
It might be somewhere in your phone's settings, for example
"Über mein Telefon" or
"Datenschutz und Sicherheit"
or any other Huawei-specific setting or menu.

I guess, when you started your phone for the very first time, you were asked to opt-in (or to opt-out) that Huawei is allowed to collect data to 'enhance the experience with your phone'.
If you find it, could you try to opt-out and see, if it helps?

There is only a good chance, that it might mitigate that crash, when the whole service of collecting data (com.huawei.lcagent.client.LogCollectManager) is stopped. If the service is running anyway (which would then be bad behavior, in my opinion), and the opt-out just prevents sending the data to Huawei, then it will change nothing here.

Steps for trying to mitigate our crash here:

Any feedback how you succeeded is highly welcome! Good luck!

EDIT: I forgot, that re-starting your phone might be necessary -> see above

@FriederikeHanssen
Copy link
Author

FriederikeHanssen commented Aug 21, 2020

Thank you for the quick feedback!

The only thing close to any of the mentioned Huawei data collection option I found is:
Einstellungen > Einstellungen > Apps mit Nutzungsdatenzugriff > Huawei Mobile Services

which I turned off and restarted the phone. This didn't solve anything

Deleting the cache & storage did solve it. However, it looks like all the contacts from the last 14 days are gone now. I only see contacts with a time stamp from a few minutes ago. Additionally, it now says 'Unbekanntes Risiko' even though I have been using the app since it came out.

Additionally, this may or may not be related (and I completely forgot about it till now), the app re-setup itself without me doing anything a few days ago.

Either way, my immediate issue is solved. But it would be a shame if all the contacts are really lost for good now. Can you confirm whether deleting the cache & storage does this?

@vaubaehn
Copy link
Contributor

@FriederikeHanssen

The only thing close to any of the mentioned Huawei data collection option I found is:
Einstellungen > Einstellungen > Apps mit Nutzungsdatenzugriff > Huawei Mobile Services

I think, you exactly spotted it! Great!

which I turned off and restarted the phone. This didn't solve anything

I should have mentioned in my comment before, to take the steps in exactly that order...
My working assumption: actually a chain reaction shows up here. It looks like, from time to time, the Huawei Mobile Services might be triggered by CWA (without any active interaction) and crash. Unfortunately, in that moment, CWA will be closed. I assume, in that moment the encrypted database of CWA still to be open and not being closed properly, which then becomes corrupted. Upon next start, the database cannot be read anymore (because corrupted), and the error 9002: file is not a database appears. I suppose, subsequent crashes later may still be related to the corrupt database.
So - by turning off Huawei Mobile Services (HMS), you may be able to prevent the first crash, what may prevent all subsequent crashes.
Because your database was already corrupted, just turning off HMS doesn't change anything for CWA on the next run.
Deleting data and cache also deleted the corrupted database, which is then newly initialized during the onboarding (another 'first' run) of CWA.

Deleting the cache & storage did solve it. However, it looks like all the contacts from the last 14 days are gone now. I only see contacts with a time stamp from a few minutes ago. Additionally, it now says 'Unbekanntes Risiko' even though I have been using the app since it came out.

Where exactly do you see the contacts? Inside the app? Or via Android > settings > apps > google > Covid-19-Benachrichtigungen?

Additionally, this may or may not be related (and I completely forgot about it till now), the app re-setup itself without me doing anything a few days ago.

Could you try to explain, what it means, 'the app re-setup' by itself?

Either way, my immediate issue is solved. But it would be a shame if all the contacts are really lost for good now. Can you confirm whether deleting the cache & storage does this?

Yes indeed, it would be a shame. Until now, I think, it was common sense here in the user community, that deleting data and cache of CWA doesn't harm the collected contacts, because they are stored in different places of the device (please correct me anyone, if I'm wrong). Only uninstalling all (or the only) official contact tracing apps (like CWA) should trigger the collected contacts to be erased from the device,
I am now a little bit uncertain, if there might have been a change in the behaviour, introduced by the new version of the Exposure Notification Framework 1.6, that also deleteing data/cache of the contact tracing app triggers the ENF to reset all data?
For the moment, I can't give a certain answer here, but if you describe, where you found the contacts with the timestamp, we'd have some more certanity...

@FriederikeHanssen
Copy link
Author

With re-setup I mean that the app behaved exactly the way it did when I first installed it. Similar to today actually. So asking me whether I want to turn on Risikoermittlung and so on. I guess, if the collected contacts have not been deleted it is not an issue.
I found the contact list inside Settings > Google > Covid-19-Benachrichtigungen > Überprüfen auf mögliche Kontakte.

@vaubaehn
Copy link
Contributor

With re-setup I mean that the app behaved exactly the way it did when I first installed it. Similar to today actually. So asking me whether I want to turn on Risikoermittlung and so on.

I understand. So, what you then saw some days ago, might indeed be a reset of CWA's data, because they might have become corrupted by a crash before. (The fallback routine seems to be in cwa-app-android/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/storage/AppDatabase.kt)
Additionally, there seems to be a flaw, that prevents CWA from accessing the database again. But it is obviously already in the focus of SAP -> #1037.

I guess, if the collected contacts have not been deleted it is not an issue.
I found the contact list inside Settings > Google > Covid-19-Benachrichtigungen > Überprüfen auf mögliche Kontakte.

If you found the contact list there, and it was empty, except the freshly fetched data for the last 14 days all with the same time stamp, then it's indeed a big concern, as it indicates, that the Exposure Summary might have been erased by the ENF. For me this is a new behaviour (or I must have missed something). This could (but not must) indicate, that the collected contacts (RPIs) also might have been erased.
In any case, that should be clarified... Does anyone want to address this in a question in this repo?

But in the end, there are just few options at the moment, to make CWA work again after a corrupted database:

  • uninstalling/reinstalling CWA -> this will erase the collected contacts for sure.
  • deleting CWA's data and cache only -> as we see now, there may be the possibility, that collected contacts (RPIs) are deleted as well by the current version of the ENF. It needs to be clarified by SAP/Google.
  • waiting for an update of CWA. But you can't use CWA for the time until the next update is available. Additionally, I guess just updating doesn't repair the database. So, it would need to be re-initialized. If this triggers ENF to also delete ENF's data, then there is no chance to keep the collected RPIs...

@vaubaehn
Copy link
Contributor

Hi @FriederikeHanssen and everyone,
as a follow-up on #1053 (comment) , @thomasaugsten is now on the question about deletion of collected contacts, here -> #642 (comment)

@vaubaehn
Copy link
Contributor

vaubaehn commented Aug 31, 2020

Hi @FriederikeHanssen , could you provide an update on how things were going for you in the last 10 days? Did any crash on app start ocuur again? (Other issues like API 39508 or no automatic background update don't count here in this context ;) )
Thanks in advance for your feedback!

@FriederikeHanssen
Copy link
Author

Hi @vaubaehn ! Everything works fine and as expected now 🎉 . No crashes, no API errors either 😄

@vaubaehn
Copy link
Contributor

vaubaehn commented Sep 1, 2020

Hi @vaubaehn ! Everything works fine and as expected now tada . No crashes, no API errors either smile

Hi @FriederikeHanssen , that's great! Thanks for your feedback! Please report back here, if any problem occurs again.
Last question for now:
How are your system settings, that allow CWA to run quite smoothly... as far as I read from you, you set up CWA as protected background app (system setting). Did you additionally activate "Prioritized Background Activity" from inside CWA's settings? Did you set up anything else or could you give other users with similar problems some recommendations?

Thank you very much for your support!

EDIT: Could you also maybe provide your EMUI version number?

@FriederikeHanssen
Copy link
Author

Hi @vaubaehn!

EMUI version number: 4.0.3

Yes, when installing the app,

  1. I added it to the protected apps:
    Einstellungen > Einstellungen > Akkumanager > Geschützte Apps

  2. Priorisierte Hintergrundaktivität is turned off. I actually was not aware of this feature until now.

  3. Other than that, I just followed your suggestions:
    Turned off: Einstellungen > Einstellungen > Apps mit Nutzungsdatenzugriff > Huawei Mobile Services

  4. And then deleting the cache & storage did solve it. However, this seems to have caused a deletion of contacts. This step should not be necessary when newly installing the app though.

@vaubaehn
Copy link
Contributor

vaubaehn commented Sep 7, 2020

Hi @FriederikeHanssen ,

thanks a lot for your well structured feedback! Personally, I find your information very useful. 👍

@svengabr : do you think, the stakeholders might consider it to be useful to extend the FAQ, especially for HUAWEI devices according to information/device setup presented here (points 1 to 3 provided in the afore comment by @FriederikeHanssen ) for increased stability? I would volunteer to create a PR for the FAQ (like I did before here -> corona-warn-app/cwa-website#308) , if it is welcomed. Details could be discussed in Slack before creating PR.

@FriederikeHanssen
Just some additional points:
As far as I currently know, there may be different root causes, which in the end of a chain may result in this app crash.
Trying to set up the device, that CWA and its background tasks/transactions are not killed by any OS specific behaviour (battery optimisation, app usage analysis (HMS), ...), can at least mitigate the likelihood of an app crash.
In this context you might want to consider to turn on "Priorisierte Hintergrundaktivität" additionally, but I can't tell, if it has a positive additional effect to decrease the probability of future crashes.
Anyway, as far as I can interpret some of the code changes, it looks like CWA will be more robust in general in future versions.
As for your point 4:

And then deleting the cache & storage did solve it. However, this seems to have caused a deletion of contacts. This step should not be necessary when newly installing the app though.

It's not quite clear yet, whether the collected contacts (RPIs of exposures) have actually been deleted, or 'only' the history of the past checks. Unfortunately, this subject has been stale for more than two weeks now, after @thomasaugsten suggested to clarify with Google. Maybe @svengabr can push that subject to the developers again, because if deleting CWA data proves to reliably bring back CWA to work, without deleting collected RPIs/own TEKs, then this method should be immediately made public to support a big crowd of users who frequently run into the problem of app crashes! @svengabr : short summary, to avoid misunderstandings: it's not about deleting CWA data from inside the app (settings > delete), but from OS level (Android > Settings > Apps > CWA > Storage > delete data/cache). We know that the Google documentation states, that only uninstalling CWA erases RPIs/TEKs, but it looks like there might have been a change to ENF in the latest versions, and/or the documentation is not correct. PS.: possible deletion of RPIs/TEKs might be related to the google API token, which is newly generated, after deletion of data and before CWA calls ProvideDiagnosisKeys.

Thanks again!

@FriederikeHanssen
Copy link
Author

FriederikeHanssen commented Sep 7, 2020

I have turned the "Priorisierte Hintergrundaktivität" now. Will report back, if it crashes or leads to unexpected behaviour. But even without it, it has been running stable for now.

Sure, happy to help 😃

@svengabr
Copy link
Member

svengabr commented Sep 7, 2020

@vaubaehn regarding your pull request you can go ahead. @mtb77 will have a look at it afterward.

Regarding the second issue, I will bring that up to the development team to answer your question.

Thank you!

@vaubaehn
Copy link
Contributor

vaubaehn commented Sep 7, 2020

@vaubaehn regarding your pull request you can go ahead. @mtb77 will have a look at it afterward.

Regarding the second issue, I will bring that up to the development team to answer your question.

Thank you!

Hi @svengabr and @mtb77 ,

Regarding the first issue (PR), thanks a lot for your consideration. I'll try to finish it within the next days. If you don't hear anything from me until Thurdsday night, feel free to ping me.

Regarding the second issue (deletion of CWA data), there was a reply by @thomasaugsten ( #642 (comment) ) , as soon as after my comment. Let's track that issue over there :)

Thanks again!

@vaubaehn
Copy link
Contributor

vaubaehn commented Sep 10, 2020

Erste Hilfe: „App schließt sich sofort nach dem Öffnen“

Die nachfolgenden Informationen wurden dank der Unterstützung vieler Nutzerinnen und Nutzer, sowie Entwickler aus verschiedenen Beiträgen im GitHub-Issue #642 zusammengestellt (z. B. #642 (comment) , #642 (comment) , #642 (comment) , #642 (comment) ). Allerdings kann ich keine Gewährleistung für Vollständigkeit und Richtigkeit geben. Anwendung auf eigene Gefahr.

Wenn die Corona-Warn-App durch einen Fehler im Betriebssystem oder durch aggressive Energiesparmaßnahmen des Telefons unerwartet beendet wird, kann es vorkommen, dass bei einem erneuten Start die Corona-Warn-App nicht mehr auf ihre verschlüsselten Datenbanken zugreifen kann. In diesem Fall schließt sie sich sofort wieder. Die Corona-Warn-App kann wieder zum Laufen gebracht werden, indem die Daten und der Cache der App über die Android-Einstellungen gelöscht werden.

Achtung: Wenn Sie die Daten der Corona-Warn-App löschen, gehen folgende Daten/Einstellungen verloren:

  • Falls Sie zuvor über einen QR-Code einen COVID-19-Test in der App registriert hatten, kann dieser nicht mehr über die App abgerufen und auch nicht mehr erfolgreich neu registriert werden. Falls Ihr Testergebnis positiv sein sollte, werden Sie aller Voraussicht nach telefonisch oder per Post benachrichtigt.
  • Einmal am Tag übergibt die Corona-Warn-App die geteilten Codes von positiv getesteten Nutzerinnen und Nutzern an die Google-Schnittstelle, um mögliche Risiko-Begegnungen in den letzten 14 Tagen zu ermitteln. Dieser Vorgang (aber keine detaillierten Ergebnisse) wird in ein Protokoll eingetragen, dass Sie auf Ihrem Telefon über Einstellungen > Google > COVID-19-Benachrichtigungen > Überprüfungen auf mögliche Begegnungen einsehen können. Dieses Protokoll wird beim Löschen der Daten der Corona-Warn-App ebenfalls gelöscht. Nach den aktuell vorliegenden Informationen Cause 9002: file is not a database: , while compiling: select count(*) from sqlite_master; #642 (comment) bleiben aber die auf ihrem Telefon gespeicherten Codes von Begegnungen mit anderen Nutzerinnen und Nutzern erhalten, so dass beim nächsten Start der App Ihr Risiko für die letzten 14 Tage erneut ermittelt werden kann.
  • Die Anzahl der Tage, wie lange die Risiko-Ermittlung auf Ihrem Telefon aktiviert war, wird ebenfalls gelöscht. Mit einem kleinen Trick kann dieser Zeitraum aber wiederhergestellt werden (siehe unten).

Zum Löschen der Daten der Corona-Warn-App gehen Sie wie folgt vor:

(die angegebenen Pfade zum Erreichen der jeweiligen Einstellungen können je nach Telefon und Android-Version leicht abweichen):

  1. Navigieren Sie auf Ihrem Telefon zu Einstellungen > Apps > Corona-Warn-App.
  2. Klicken Sie auf „Stoppen erzwingen“.
  3. Wählen Sie „Speicher“, und löschen Sie danach Cache und Daten, indem Sie auf die jeweiligen Buttons klicken.
  4. Um sicherzustellen, dass die Corona-Warn-App beim nächsten Start für die Risiko-Ermittlung die gesamten letzten 14 Tage berücksichtigt, können Sie zunächst das System-Datum Ihres Telefons zurückstellen Cause 9002: file is not a database: , while compiling: select count(*) from sqlite_master; #642 (comment) . Damit alle Codes für die Risiko-Ermittlung vom Server heruntergeladen werden, reicht es, wenn Sie das Datum auf den gestrigen Tag einstellen Cause 9002: file is not a database: , while compiling: select count(*) from sqlite_master; #642 (comment) . Wenn Sie auch möchten, dass die Corona-Warn-App anzeigt, dass Ihre Risiko-Ermittlung in den letzten 14 Tagen dauerhaft aktiv war, können Sie das System-Datum auch 14 Tage zurückstellen Cause 9002: file is not a database: , while compiling: select count(*) from sqlite_master; #642 (comment) . Um das System-Datum zurückzustellen, navigieren Sie auf Ihrem Telefon zu Einstellungen > Datum und Uhrzeit. Um das Datum einzustellen, müssen Sie ggf. Zeit automatisch ermitteln deaktivieren.
  5. Öffnen Sie nun die Corona-Warn-App. Ihnen wird erneut die Einführung gezeigt (das Onboarding). Führen Sie das Onboarding bis zum Ende durch. Wenn Ihnen der Hauptbildschirm angezeigt wird, warten Sie, bis Ihnen irgendein Risiko-Status angezeigt wird, und schließen Sie die App wieder.
  6. Stellen Sie nun das System-Datum wieder auf den aktuellen Tag ein (Android-Einstellungen > Datum und Uhrzeit). Aktivieren Sie ggf. wieder die automatische Zeitermittlung.
  7. Öffnen Sie nun die Corona-Warn-App erneut. Ihnen sollte nun Ihr richtiger Risiko-Status („niedriges Risiko“ oder „erhöhtes Risiko“) angezeigt werden.

Achtung:

Um die Zuverlässigkeit der Hintergrundaktualisierung zu optimieren, und unerwarteten Abstürzen der Corona-Warn-App beim Öffnen vorzubeugen, befolgen Sie bitte diese Anleitung in den FAQ -> hier .

Falls Sie ein Huawei oder Honor Smartphone besitzen, sollten Sie zusätzliche diese Punkte beachten -> hier

Falls Sie ein Smartphone eines anderen Herstellers besitzen, können Sie hier überprüfen, ob Sie noch zusätzliche Einstellungen zur Verbesserung der Zuverlässigkeit vornehmen können: https://dontkillmyapp.com/ (englisch) oder https://slack.com/intl/de-de/help/articles/360001562747-Bekannte-Probleme-mit-Android%E2%80%91Benachrichtigungen

@vaubaehn
Copy link
Contributor

vaubaehn commented Sep 10, 2020

Zusätzliche Einstellungen für ältere Huawei- oder Honor-Smartphones

Es ist bekannt, dass Huawei-Geräte ein besonders aggressives Verhalten zur Optimierung der Akkulaufzeit zeigen. So werden Hintergrundprozesse der Corona-Warn-App sehr schnell beendet, wenn die App nicht anhand besonderer Einstellungen von der Akku-Optimierung ausgenommen wird. Das ‚Killen‘ dieser Hintergrundprozesse kann dazu führen, dass die Corona-Warn-App entweder die Hintergrundaktualisierung zur Risiko-Ermittlung nicht durchführt, oder im schlimmsten Fall die Datenbanken der App beschädigt werden könnten. Es wird daher empfohlen, die ‚Priorisierte Hintergrundaktivität‘ zu aktivieren, wie in der FAQ angegeben.

Für ältere Geräte mit EMUI 4 (z. B. Huawei P8 lite) sollte neben dieser allgemeinen Empfehlung noch eine zusätzliche Einstellung vorgenommen werden: Stellen Sie die Corona-Warn-App wie folgt als ‚Geschützte App‘ ein:

  • Navigieren Sie auf Ihrem Telefon zu Einstellungen > Erweiterte Einstellungen > Akkumanager > Geschützte Apps
  • Stellen Sie dort den Schalter für die Corona-Warn-App auf „an“.

Um die Stabilität der Corona-Warn-App zu erhöhen, ist noch eine weitere Einstellung möglich – das Entziehen der Erlaubnis auf den Zugriff der Nutzungsdaten für die Huawei Mobile Services. Ob es tatsächlich etwas bringt, oder eher nicht, ist Gegenstand der Diskussion und noch nicht abschließend geklärt (#642 (comment) #642 (comment) #642 (comment) ). Aber einen Versuch ist es vielleicht wert:

  • Navigieren Sie auf Ihrem Telefon zu Einstellungen > Erweiterte Einstellungen > Apps mit Nutzungsdatenzugriff > Huawei Mobile Services
  • Stellen Sie den Schalter auf „aus“.
  • Starten Sie das Telefon neu.

Um die Stabilität weiter zu verbessern, sollten Sie überprüfen, ob noch mindestens 2GB freier Speicher für den internen Speicher zu Verfügung stehen. Ist nämlich der Speicher zu voll (weniger als 1 GB freier Speicher), wird das Telefon immer langsamer, wodurch timeout-Probleme auftreten können. Sie erhalten dann z. B. Meldungen wie „App XYZ reagiert nicht mehr“. Geben Sie in diesem Fall Speicher frei, z. B.:

  • Löschen Sie besonders lange Videos, z. B. in Whatsapp
  • Löschen Sie den Cache (nicht die Daten) Ihrer Apps
  • Löschen Sie Apps, die Sie nicht mehr benötigen

System-Update

Für neuere Huawei / Honor Smartphones liegt möglicherweise ein System-Update vor, dass die Corona-Warn-App auf eine Huawei-interne White-List setzt, und vom besonders aggressiven Energiesparen ausschließt. Überprüfen Sie hier, ob Sie vielleicht ein System-Update erhalten können. Link: https://www.huaweiblog.de/news/huawei-geraete-bekommen-877kb-grosses-systemparameter-update/

Ansonsten können Sie prüfen, ob Sie für Ihr Telefon noch weitere Einstellungen vornehmen können, z. B. hier https://dontkillmyapp.com/huawei (englisch), oder hier https://www.huaweiblog.de/news/benachrichtigungen-push-problem-loesung-anleitung/ .

@vaubaehn
Copy link
Contributor

vaubaehn commented Sep 10, 2020

First Aid: Reactivate Corona-Warn-App when "App closes immediately after opening"

Thanks to the support of many users and developers, the following information was compiled from various contributions in GitHub issue #642 (e.g., #642 (comment) , #642 (comment) , #642 (comment) , #642 (comment) ). However, I cannot guarantee completeness and correctness. Use at your own risk.

If the Corona-Warn-App is unexpectedly terminated due to an error in the operating system or aggressive energy-saving measures taken by the phone, it may happen that the Corona-Warn-App can no longer access its encrypted databases when it is restarted. In this case, it closes again immediately. The Corona-Warn-App can be made to work again by deleting the data and the cache of the app via the Android settings.

Attention: If you delete the data of the Corona-Warn-App, the following data / settings will be lost:

  • If you had previously registered a COVID-19 test in the app using a QR code, it can no longer be called up via the app and can no longer be successfully re-registered. If your test result is positive, you will most likely be notified by phone or postal mail.
  • Once a day, the Corona-Warn-App transfers the codes shared by users who tested positive to the Google interface in order to determine possible risk encounters in the last 14 days. This process (but no detailed results) is recorded in a log that you can view on your phone via Settings > Google > COVID-19 notifications > Checks for possible encounters. This log is also deleted when the data from the Corona-Warn-App is deleted. According to the information currently available Cause 9002: file is not a database: , while compiling: select count(*) from sqlite_master; #642 (comment) , the codes of encounters with other users stored on your phone are retained, so that your risk for the last 14 days can be determined again the next time you start the app.
  • The number of days that the risk assessment was activated on your phone is also deleted. With a little trick this period can be restored (see below).

To delete the data from the Corona-Warn-App, proceed as follows:

(the paths specified to reach the respective settings may differ slightly depending on the phone and Android version):

  1. On your phone, navigate to Settings > Apps > Corona-Warn-App.
  2. Click on “Force Stop”.
  3. Select “Storage” and then clear the cache and data by clicking the respective buttons.
  4. In order to ensure that the Corona-Warn-App takes the entire last 14 days into account the next time it is started for the risk determination, you can first change the system date of your phone Cause 9002: file is not a database: , while compiling: select count(*) from sqlite_master; #642 (comment) . So that all codes for the risk determination are downloaded from the server, it is sufficient if you set the date to yesterday's date Cause 9002: file is not a database: , while compiling: select count(*) from sqlite_master; #642 (comment) . If you also want the Corona-Warn-App to display that your risk determination has been permanently active in the last 14 days, you can set the system date back 14 days Cause 9002: file is not a database: , while compiling: select count(*) from sqlite_master; #642 (comment) . To change the system date, go to Settings > Date and Time on your phone. To set the date, you may have to deactivate Set time automatically.
  5. Now open the Corona-Warn-App. You will be shown the introduction again (the onboarding). Follow the onboarding to the end. When you see the main screen, wait for any risk status to appear and then close the app.
  6. Now set the system date back to the current day (Android Settings > Date and Time). If necessary, activate the automatic time determination again.
  7. Now open the Corona-Warn-App again. You should now see your correct risk status (“low risk” or “increased risk”).

Attention:

To optimize the reliability of the background update and to prevent unexpected crashes of the Corona-Warn-App when opening, please follow these instructions in the FAQ -> here https://www.coronawarn.app/en/faq/#no_risk_update.

If you have a Huawei or Honor smartphone, you should also note these points -> here.

If you have a phone from another manufacturer, you can check here whether you can make additional settings to improve reliability: https://dontkillmyapp.com/ or https://slack.com/intl/en-de/help/articles/360001562747 (you may adjust output to your language on button of that page).

@vaubaehn
Copy link
Contributor

vaubaehn commented Sep 10, 2020

Additional settings for older Huawei or Honor smartphones

It is a known fact that Huawei/Honor phones show a particularly aggressive behavior to optimize battery life. Background processes of the Corona-Warn-App are terminated very quickly if the app is not excluded from battery optimization based on special settings. The 'killing' of these background processes can mean that the Corona-Warn-App either does not carry out the background update for risk determination or, in the worst case, the app's databases could be damaged. It is therefore recommended to activate the 'Prioritized Background Activity' as stated in the FAQ https://www.coronawarn.app/de/faq/#no_risk_update.

For older devices with EMUI 4 (e.g. Huawei P8 lite), in addition to this general recommendation, an additional setting should be made: Set the Corona-Warn-App as 'Protected App' as follows:

  • On your phone, navigate to Settings > Advanced Settings > Battery Manager > Protected Apps
  • Set the switch for the Corona-Warn-App to "on".

In order to increase the stability of the Corona-Warn-App, another setting is possible - withdrawing the permission to access usage data for the Huawei Mobile Services. Whether it actually has a positive effect or not is the subject of discussion and has not yet been finally clarified (#642 (comment) #642 (comment) #642 (comment) ). But it might be worth a try:

  • On your phone, go to Settings > Advanced Settings > Usage Data Access > Huawei Mobile Services
  • Set the switch to "off".
  • Restart the phone.

To further improve stability, you should check whether at least 2GB of free space is still available for the internal memory. If the memory is too full (less than 1 GB free memory), the phone becomes slower and slower, which can lead to timeout problems. You will then receive messages like "App XYZ is not responding". In this case, free up some memory, e.g.

  • Delete particularly long videos, e.g. in Whatsapp
  • Clear the cache (not the data) of your apps
  • Delete apps that you no longer need

System-Update

For newer Huawei / Honor smartphones there may be a system update that puts the Corona-Warn-App on a Huawei internal white list and excludes it from particularly aggressive energy saving. Check here to see if you might be able to get a system update. Link (German): https://www.huaweiblog.de/news/huawei-geraete-bekommen-877kb-grosses-systemparameter-update/

Additionally you can check whether you can make further settings for your phone, e.g. here https://dontkillmyapp.com/huawei, or here (German) https://www.huaweiblog.de/news/benachrichtigungen-push-problem-loesung-anleitung/.

@vaubaehn
Copy link
Contributor

@mtb77 @svengabr @thomasaugsten
If you find time, you'd like to check if above instructions are appropriate.

@mtb77 : Tomorrow I will send you a draft for changes to the FAQ. If they are in line with your needs, I will create a PR respectively. FAQ changes will be short and link to above comments.
Enjoy your night!

@svengabr
Copy link
Member

Thank you very much for the effort @vaubaehn! Your texts are looking very good to me.

I would like to discuss this as a topic in our daily meeting today so maybe a developer can have a look at it before publishing it to the FAQ website.

I will keep you updated.

@vaubaehn
Copy link
Contributor

vaubaehn commented Sep 11, 2020

Hi @svengabr , thanks for your feedback. I also think, it's a good idea when dev department has a look on it.

I guess the GitHub rights management allows you to edit my comments at any time - so, please feel free to adjust anything according to your needs! At any time!

Edit: I incorporated small changes, mainly formatting, typos and small details.

@vaubaehn
Copy link
Contributor

@mtb77 (and @svengabr ) : You've Got Mail

;)

@vaubaehn
Copy link
Contributor

Hi @sandoxy ,

I'm a common user like you, but familiar with that issue, I will try to support you a little.

CWA says: no risc status known, because CWA did not run 14 days

Google-Covid shows 14 checkups from today. The other checkups, wich where there before I deleted the CWA-data, are gone. And the checkup from today does not contain any keys - key-amount=0.

What did I do wrong?

I'm not sure what went wrong here for you in particular - all steps you told us seem to be right, and for other users this procedure was succeeding.

... in the moment I'm writing here, above @daimpi already answered (and again: ... one thought 😆 )

Could you please update to the latest version 1.5 and test if the update did fix the error?

The app seemed to work after the reset of cache and data, before the update. But the contacts for the last 14 days are still lost (V1.5).

like @daimpi wrote already, contacts should not be lost, only the entries in the log are gone.

After update to 1.5. I did all the steps above againg and again all contacts are lost.

like @daimpi wrote, contacts are retained, but due to a problem in a bug fix, CWA's data could not be reset automatically during the upgrade to 1.5.

@vaubaehn
Copy link
Contributor

Hi @FriederikeHanssen ,
happy to find you here again (thanks for reporting!), but I'm sad about the circumstances 😢 .
I'm trying to gather some information, to understand the underyling root cause better and to support developers in that way.

Updated it just now. now it hangs in the start screen (Logo on background) for about 10 seconds and then dies. Up until now it at least opened and I could navigate to the main window.

Update: I deleted storage & cache and it works again for now. But any previous contacts are gone. Will update you in the next days whether it is now running or failing again

Did I understand you right:

  • On October 4, CWA crashed again for you, and you cleared storage and cache.
  • Since then, the app was working fine again, just until you updated to CWA 1.5.0.
  • After the update, opening the app first time in version 1.5.0, CWA's boot logo hangs for around 10 seconds, then app crashes.
  • Opening CWA again after results again in a crash.
  • You then cleared CWA's storage again, and now it works.

Did I understand everything correct? Having your feedback would be very helpful indeed.

And as @daimpi already wrote, only the history of checks should be cleared, but not the collected contacts. We had a verification for that in a different issue yesterday, that a risk encounter was showing up again after solely deleting storage, following the procedure above in this thread.

Thank you!

@sandoxy
Copy link

sandoxy commented Oct 20, 2020

@sandoxy @FriederikeHanssen

Your keys are not lost as long as you just deleted the CWA data and didn't un-/reinstall the app. They are still safely stored inside the Google Exposure Notification Framework (ENF).

When I go to Settings-> Google->Covid-19.
I see just two checkups, 08.10.(into that date I changed the settings while I resetted cache and data) and today. And in each checkup there ist just one entry, each with 0-key-count.

CWA shows, that it runs for 12 days.

I did not reinstall the app.

@daimpi
Copy link

daimpi commented Oct 20, 2020

@sandoxy could you provide us your device name, Android version and ENF version (ENF version can be found here).

@sandoxy
Copy link

sandoxy commented Oct 20, 2020

@sandoxy could you provide us your device name, Android version and ENF version (ENF version can be found here).

Of cource:
Huawei P8 lite
Emui 4.0.3
Android 6.0
Version 17203704005

@FriederikeHanssen
Copy link
Author

@vaubaehn ,

let's hope this helps fixing it then 😃 .

  • On Oct 4th app crashed -> I followed the above steps
  • Worked fine for a while, but eventually crashed again (can't tell you precisely when)
  • Repeated the above steps, just in case. Eventually, this also didn't help anymore.
  • Actually installed the Swiss covid app, it was written in some issue that this would preserve the contacts. Re-installed CWA, set it up as above, crashed as well
  • At some point then reported here again and was advised to update to 1.5.0, which I did. Then it got stuck in the start screen, clearing cache&storage ones again helped

Let me know, if you need more info.

@daimpi Great to hear the contacts are not lost 👍 . I assumed they would be, because when I navigate to Google > Covid Benachrichtigungen it only shows a few (10ish or fewer) and only from the date of when I reseted storage &cache.

@vaubaehn
Copy link
Contributor

Hi @FriederikeHanssen , thanks again for your support!

Please excuse my following pedantic questions... As we have 50 Shades of Crashes with CWA, I just want to be double sure, we're having only one source of crash here.

  • On Oct 4th app crashed -> I followed the above steps
  • Worked fine for a while, but eventually crashed again (can't tell you precisely when)
  • Repeated the above steps, just in case. Eventually, this also didn't help anymore.

Were all of these crashes of the same type? I'm asking, because you wrote in the third step, that clearing cache and data didn't help anymore, what would point to a different root cause.
Did you see something like "9002: timed out while waiting for 60000 ms"? Or "cause 3: API(10).. no public key found"? Or have all crashes been like your first reported one: app immediately closing on start, without any error message?

  • Actually installed the Swiss covid app, it was written in some issue that this would preserve the contacts. Re-installed CWA, set it up as above, crashed as well

Same here: app closing or some different error message?

  • At some point then reported here again and was advised to update to 1.5.0, which I did. Then it got stuck in the start screen, clearing cache&storage ones again helped

That last one actually looks like the "old" app closes immediatly on start.

Thanks again...

@svengabr
Copy link
Member

Hey everyone,

according to our developer's meeting, the issue is most likely related to #642 which should have been initially resolved for 1.5. Unfortunately, a small code fragment needed to be added which will be part in an upcoming hotfix release 1.5.1.

The related pull request is #1433

In the mean time you could try the workaround of @vaubaehn

Thank you very much for your understanding!

Best regards,
SG

Corona-Warn-App Open Source Team

@Neuwessi11
Copy link

Hi svengabr,

gibt es denn schon eine Vorstellung von dem ungefähren Termin, an dem das Hotfix kommt?

@Neuwessi11
Copy link

Hi at all,
my sister told me, that nothing has changed.
Even after updating to 1.5.1 white screen with CWA-symbol, no chance of pressing any button, followed by a shutdown of the app.
I maybe should mention that she did not try the workaround, because she hoped for the 1.5.1. But this unfortunatly did not work in her case.

Still Huawei P8 Lite
Android 6.0

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Oct 30, 2020

@Neuwessi11

If your sister's app is still crashing then the options are:

  1. Workaround by deleting the app data, which means that the history of exposure checks is lost. We are told though that the actual keys are kept, even though you can't see them. (See Cause 9002: file is not a database: , while compiling: select count(*) from sqlite_master; #642 (comment)). Experiments have shown that deleting the app data also causes the stored keys to be lost.
  2. Wait for version 1.6 which is expected to fix the issue in Cause 9002: file is not a database: , while compiling: select count(*) from sqlite_master; #642 which is another one of the hot topics.

I have no information about when 1.6 will be released, but I would expect it will be soon.

Edit: Version 1.6 was released on Nov 11, 2020. The current version is now 1.7.1 and the issue #642 has been closed as fixed.

@Neuwessi11
Copy link

Thanks again!

My sister now tried the workaraound incl. changing of time settings, and today is already the 2. day CWA working!

So thanks to all who answer and answered here!

But one point of criticism is still left: I am a complete unsuspecting layman in app-building, but it is more than hard for me to understand why a workaround is necessary for not too less people just to make CWA working. Especially when this bug is known for months. Why has it during months not been possible to fix this bug? It is the Telekom and SAP writing the app, and as far as I know these are two very big players (recieving some money for that) and not only my cousin or brother-in-law scribbling around in their leisure time.
Please do not misunderstand me: I don't want at all to revile all the people who write here in their leisure time to help those unsuspecting people like me, and I have the utmost respect to all these people, especially regarding that the workaround came from them and neither from Telekom nor SAP.
Have a nice weekend!

@heinezen
Copy link
Member

This was addressed in CWA 1.5 and 1.6. The issue should be fixed now. Please comment here if it is still re-occuring for you.


Corona-Warn-App Open Source Team

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working mirrored-to-jira This item is also tracked internally in JIRA
Projects
None yet
Development

No branches or pull requests