Signal-iOS icon indicating copy to clipboard operation
Signal-iOS copied to clipboard

Stuck on "optimizing database" after update

Open alisonLFP opened this issue 7 years ago • 28 comments

  • [X] I have searched open and closed issues for duplicates
  • [X] I am submitting a bug report for existing functionality that does not work as intended
  • [X] This isn't a feature request or a discussion topic

Bug description

After updating overnight, my Signal app on iOS is stuck on the "optimizing database screen" and won't load conversations. This is a different problem than #4201 because the app isn't crashing, it just hangs.

Steps to reproduce

  • Open Signal App
  • Optimizing database screen appears and doesn't go away
  • Reopening does the same thing

Actual result: App is stuck on "optimizing database" screen

Expected result: App should open and display conversations

Device info

Device: iPhone 6

iOS version: 12.4.3

Signal version: I don't know, because I can't open the app settings to check. But Signal was updating before the bug happened, so I assume it's 3.0.2.1 like everyone else's iOS update?

Link to debug log

I can't link this because I can't open the app properly.

alisonLFP avatar Dec 03 '19 15:12 alisonLFP

@alisonLFP Signal iOS 3 involves a major database migration. It may take a long time if you have a long message history, especially on older devices like your iPhone 6. Please leave the app open for quite a while (at least 10-20 minutes) and see if that resolves this issue. Let us know if it doesn't.

charlesmchen-signal avatar Dec 03 '19 16:12 charlesmchen-signal

It's working now. The database migration took about five hours.

alisonLFP avatar Dec 03 '19 16:12 alisonLFP

Would you still be willing to submit a debug log so we can learn something about why the migration took so long?

On Dec 3, 2019, at 09:19, Alison Macrina [email protected] wrote:

 It's working now. The database migration took about five hours.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

michaelkirk-signal avatar Dec 03 '19 16:12 michaelkirk-signal

As another data point, my phone has been stuck on "Optimizing Database" for 45+ minutes so far.

I have probably sent less than 10 messages using Signal ever, so it does seem like there is an issue (I should have almost no data to migrate).

Some additional info in case it helps diagnose the issue: I have had the app installed for a long time, with iOS auto-update on. I probably haven't opened the app for quite a few releases.

If/when the migration finishes I will try to submit a debug log.

Device: iPhone 7 iOS version: 13.1.3 Signal version: 3.0.6

jaredlt avatar Dec 12 '19 10:12 jaredlt

One thing to keep in mind, you'll need to keep the app open for the migration to proceed.

If you background the app, the OS will not let it run for long.

michaelkirk-signal avatar Dec 13 '19 17:12 michaelkirk-signal

Thanks, I did wonder about that. I definitely had the app open in the foreground for at least an hour and it didn't finish. I haven't managed to get it to finish yet as keep forgetting to leave it on overnight. Once I do I'll submit the log.

jaredlt avatar Dec 15 '19 00:12 jaredlt

Update to this issue: I left the migration running overnight and no luck. It ran for at least 7 hours.

After my phone alarm went off, I switched back to Signal quickly and it showed 'Optimizing Database' immediately which I took to mean iOS did not kill the migration and that it was still running (compared to the first time I opened Signal where it showed the splash screen and only after a few seconds starting showing the 'Optimizing Database'). I mention this to say that if my assumption is correct it means I ran it for over 20 hours and it did not complete (I did use my phone a few times during the day but each time switched back to Signal quickly and saw the 'Optimizing Database' immediately).

At this point I have closed the app.

My next course of action would probably be to uninstall and reinstall the app. I barely have any messages so I am not particularly concerned about the loss, however, there may be other users in my situation who do not want to lose their data so before I do I am open to any suggestions that may help you diagnose the issue.

jaredlt avatar Dec 17 '19 02:12 jaredlt

Sorry that this is hanging for you. Before uninstalling, would you be willing to install a diagnostic build?

If so, please email [email protected] and I'll follow up.

On Mon, Dec 16, 2019 at 6:57 PM jaredlt [email protected] wrote:

Update to this issue: I left the migration running overnight and no luck. It ran for at least 7 hours.

After my phone alarm went off, I switched back to Signal quickly and it showed 'Optimizing Database' immediately which I took to mean iOS did not kill the migration and that it was still running (compared to the first time I opened Signal where it showed the splash screen and only after a few seconds starting showing the 'Optimizing Database'). I mention this to say that if my assumption is correct it means I ran it for over 20 hours and it did not complete (I did use my phone a few times during the day but each time switched back to Signal quickly and saw the 'Optimizing Database' immediately).

At this point I have closed the app.

My next course of action would probably be to uninstall and reinstall the app. I barely have any messages so I am not particularly concerned about the loss, however, there may be other users in my situation who do not want to lose their data so before I do I am open to any suggestions that may help you diagnose the issue.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/signalapp/Signal-iOS/issues/4322?email_source=notifications&email_token=AI2CFQHYC245L6CYND2MESTQZA5YRA5CNFSM4JU2CCKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHA63XQ#issuecomment-566357470, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI2CFQFT3XVQFCIZNV2YHKLQZA5YRANCNFSM4JU2CCKA .

michaelkirk-signal avatar Dec 17 '19 04:12 michaelkirk-signal

Hi, I am having the same issue. Just updated signal on my IPhone 6 and it’s been stuck for about 20 minutes on the “optimizing database” screen. Was there ever a fix for this? If so, would love to have it. I do not want to lose my messages (although i don’t have many, it’s only 179 mb right now). Please let me know if anyone has a solution for this. I will try leaving it open overnight as well.

annarose1947 avatar Apr 06 '20 02:04 annarose1947

@annarose1947 in my case we were unable to fix it. I installed the diagnostic build and Michael determined that my app was stuck in some sort of "semi-installed" state. But we couldn’t find the root cause and I had to reinstall.

Maybe another data point will help them find the issue.

jaredlt avatar Apr 06 '20 08:04 jaredlt

I have the same problem, have had it for months. I can't remember how long ago I first saw this issue. Like other commenters above I rarely use Signal but have had it installed for years. I have never waited long enough for the database migration to actually finish, and reading the above I now no longer want to try.

I ended up deleting and reinstalling from scratch.

andrewgdotcom avatar Apr 16 '20 15:04 andrewgdotcom

I also just experienced the behavior. This happened after my iOS instance had auto-deleted Signal after a long lack of use, and I activated it for re-install via the "swipe-down" home screen search interface in iOS. I ended up deleting the app and reinstalling, and that brought me through the enrollment process again, and now Signal works just fine.

frostycellnex avatar Jun 23 '20 15:06 frostycellnex

This happened to me this morning, I have never seen this "error" before after using Signal for iOS for years now. The message "Optimizing Database" flashing on and off, with "This could take several minutes" under that. I lost my patience after a few minutes so I deleted the app and reinstalled it. If the database is being optimized, it sure would be nice to have a status bar on the screen so you can see the progress and have some idea how long it's going to take! My instinct is the app just crashed and no optimizing was really happening. Reading the reports above confirms that suspicion.

akaase avatar Nov 18 '21 16:11 akaase

Very bad experience. Recovery was going for over and hour and didn’t finish on iPhone 13 pro. Reinstalled and lost all the chat histories of course. Also will need to relink other devices. I had a feeling that each time the Signal went to the background (when I was using other apps) it was interrupting the process and starting again when switching back to Signal.

MysticalGrape avatar Dec 03 '21 03:12 MysticalGrape

Yeah it's pretty naive software development to have a blow-off message like "This may take several minutes" and not show a exact status that stresses your users out for hours, hoping and praying the app didn't crash. If the database is fucked, just put a BSOD on the screen and tell the user to reinstall the app.

akaase avatar Dec 03 '21 12:12 akaase

Omg! Why doesn’t the transfer of an account work from ipad to iphone!? I had the same issue, thought I could simply delete te app and reinstall. Only to discover that a fresh install required me to “transfer” my history from my ipad to iphone but it’s not letting me do that!

Just posting this here to warn ppl not to delete the app unless you wanna risk losing all history.

Nateu avatar Dec 07 '21 11:12 Nateu

After reinstall on iPhone I had to re-link my other devices (computers and tablet), but that didn't wipe history on those linked devices. Only iPhone lost the history, but that's fine with me as I still got full history on multiple other devices. However, would be awesome to be able to cancel this database optimisation or even opt out. Still I am very thankful for Signal project and I understand that developers have limited time, so they need to keep an eye on priorities.

MysticalGrape avatar Dec 07 '21 11:12 MysticalGrape

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

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

stale[bot] avatar Feb 05 '22 12:02 stale[bot]

Same issue here Signal 5.27.1. IOS 15.0.

tgdn avatar Feb 08 '22 17:02 tgdn

Same issue for ios 15.3.1, signal 5.30.0

miaekim avatar Mar 07 '22 21:03 miaekim