Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Brave should restore session gracefully after a crash #5512

Closed
5 of 10 tasks
bsclifton opened this issue Nov 9, 2016 · 51 comments
Closed
5 of 10 tasks

Brave should restore session gracefully after a crash #5512

bsclifton opened this issue Nov 9, 2016 · 51 comments
Assignees
Labels
addressed-with-brave-core Needs confirmation, but this issue may be resolved with Brave Core. parity Features which should be supported in Brave since they're supported in other major browsers. priority/P2 Crashes. Loss of data. Severe memory leak. project-tracking

Comments

@bsclifton
Copy link
Member

bsclifton commented Nov 9, 2016

Did you search for similar issues before submitting this one?
Yes

Describe the issue you encountered:
Brave is not aware during re-launch that it had a crash during the last run. In some cases, it doesn't properly save the session file (leaving them with an empty session).

Expected behavior:

In those cases, regardless of what the "start brave with" setting has, we should show an alert letting the user know:

  • Brave crashed and it was unexpected

  • We can try to restore the sites (windows and tabs) that were open, if they'd like us to

  • Steps to reproduce:

    1. Launch Brave and open some tabs, each to a different site
    2. On Windows, open up task manager. On Linux/Mac, use ps -ef | grep brave
    3. Kill the main Brave process (end task or w/ kill command)
  • Screenshot if needed:

  • Any related issues:

@bsclifton
Copy link
Member Author

@bsclifton
Copy link
Member Author

Manual work-around I've given to folks for trying to restore their session:


First, quit Brave and make sure all instances of it are closed (if you know how, you can check task manager to make sure no Brave.exe are running)

Then push Windows key + R to bring up run prompt and then run:
%appdata%\brave

You should then see your local files. The session files have the format of "session-store-". Look for others with a similar name which are bigger in size. Backups are saved every so often, including when quitting. You should be able to rename the file you want to restore as "session-store-1"

Please let me know how this works for you. I would advise not to delete files... but if needed, rename them or put into a folder

@ktd99
Copy link

ktd99 commented Dec 12, 2016

bsclifton, I saw only 2 session files...one from today and a tmp file from Aug 30. I checked several folders...did not see other session files.

@bsclifton
Copy link
Member Author

bsclifton commented Dec 12, 2016

@ktd99 apologies- maybe I responded to your issue too quickly. Did you lose your data? (which this process helps recover) or did you only lose the open tabs for one session?

You can re-open previously closed tabs (see history menu, or press Ctrl+Shift+T)

@ktd99
Copy link

ktd99 commented Dec 13, 2016

I lost all but 5 tabs...quite a lot. And some had been open for months, so the History option is far too tedious....not even sure it would go back far enough.

@bsclifton
Copy link
Member Author

@ktd99 I updated the original post above (here in this issue) to make sure when this is fixed that we restore tabs and windows that were open before the crash happened.

It doesn't help you now, but I am glad to hear that you have all your other data though 😄

@lukemulks
Copy link
Collaborator

lukemulks commented Jan 21, 2017

Experienced a similar variation of this issue about an hour ago.

I restarted my Win 10 64bit laptop after a system crash:

-Opened Brave
-My usage stats on the home screen and all my bookmarks are gone.
-Brave payments was disabled (when reactivated, all my info was correct and as expected),
-Extensions were disabled (reactivated and those are back to normal as expected).
-The main bummer is I liked how high the stats were, and my bookmarks are gone (and I didn't back them up).
-Behavior roughly matches a fresh install, minus the oauth, payments and extensions going back to normal after being enabled.

Brave Info:

Brave: 0.12.15
Muon: 1.4.31
libchromiumcontent: 53.0.2785.143
V8: 5.3.332.47
Node.js: 6.5.0
Update Channel: dev
os.platform: win32
os.release: 10.0.14393
os.arch: x64

I checked out this issue and issue #5852, but am only seeing one session-store file:
session-store-1 and no other session-store-tmp or other session-store variations.

Luckily I'm OCD and double down on bookmarking links into Pocket (very happy for that extension right now), but let me know if there's anything else I can provide to assist.

@ghost
Copy link

ghost commented Jan 29, 2017

I second the people who have recently lost their bookmarks. I had these as recently as earlier today, but now do not have them. There were several hundred, so it's not something I would ever be able to recreate perfectly. I looked at the files, but there is only one session-store file, so the propsed manual workaround will not work.

@bsclifton bsclifton self-assigned this Feb 2, 2017
@psmalone
Copy link

psmalone commented Mar 7, 2017

In recent versions (0.13.5, OS X), I haven't been losing my bookmarks, but I have been losing my windows, when there's a Brave or OS X crash. Individual tabs are in the history, but "Reopen Last Closed Window" has no effect. For tabs that have been open for several days (e.g., gmail), it's quite tricky to fully restore.

@lukemulks
Copy link
Collaborator

FYI an additional case, matching the samw issue I observed above, was reported in Community today.

https://community.brave.com/t/lost-all-my-bookmarks-thanks-to-latest-update/1683/6

@lukemulks
Copy link
Collaborator

This just happened to me, again.
I lost nearly everything (incl a bunch of work I was getting ready to submit in diff tabs)
Stuff that's gone:

  • brave stats
  • all history
  • all bookmarks
  • all open sessions (tabs and windows)
  • site preferences
  • security preferences (in settings - back to default)

Stuff that's OK:

  • Once payments was enabled again, my sitelist, wallet and payment stats were restored.
  • Authentication creds (I'm still signed into google - once I enable extensions, my creds are remembered)
  • Brave is still my default browser in Windows10

Browser version:

  • Brave: 0.14.0

  • rev: 7dfeeb0

  • This is the 2nd time this has happened to me, on 2 separate Windows machines, between January and now.

  • This is the 2nd reported case of this happening to a Windows user this week.

Conditions:

  • 4 Brave windows were open, with no more than 7 tabs open in each window.
  • Brave had been running OK, but had been running all day, and I have been running some heavy testing today.
  • I had Chrome open for some separate testing, with several windows open.
  • I had Slack open
  • I had Sublime Text open.
  • I got a BSOD - forced reboot.
  • I opened Brave after, and found that everything was gone.

I have noticed that Brave has been using a lot of memory over the past couple weeks (fluctuates, but is noticeable).

I have hardware acceleration enabled in Brave settings, if that makes a difference. Not sure if it does or not.

@BrendanEich
Copy link
Member

From what was not lost, this appears to be a bug in our handling of session-store-1 update. @lukemulks what was in the .tmp file, how big was it?

@lukemulks
Copy link
Collaborator

@BrendanEich the temp file was ~300k, the session-store-1 file was at less than 100k (I had only opened the browser and explored settings after noticing the stat count and session wasn't restored once I rebooted).

After I noticed what happened, I closed Brave, made a new folder, put session-store-1 in it.
Made another new folder, put the session temp store in it, and then renamed it to session-store-1.
I placed the renamed temp file back in the original location, and rebooted the browser.

I noticed that didn't seem to change anything, so I reversed the process in case I was mixing up the instructions, and it yielded the same result.

I can dump both sessions here if that helps at all? I'm not sure if they both were wiped, but the tmp file seemed small for what it contained. It all looks like hot mess when I open up the file, but can drop both files here. There are some params at the top and bottom that make sense to me.

The tmp file was dated as last modified on 02.16.17

@diracdeltas
Copy link
Member

diracdeltas commented Mar 16, 2017

FYI if this happens to you, make sure you make a backup-copy of session-store-1 before you re-open Brave. If you forget to do this and re-open Brave, you still have about 5 minutes to backup session-store-1 before everything is lost.

Usually the deletion happens on startup, not shutdown.

@luixxiul
Copy link
Contributor

Does sync work in case of that kind of accident?

@diracdeltas
Copy link
Member

@luixxiul only for bookmarks, site settings, and (optionally) history right now, assuming either you saved the code words or have another synced device you can copy them from.

@davidak
Copy link

davidak commented Sep 29, 2017

I opened my notebook today at work and all Brave windows are white. I can't reload or do anything. I closed the App and started again. One window opened i closed yesterday, but the window that was still open are lost. This is kind of a critical feature to me, so i have a session save extension in Chromium. There i also lost my tabs 2-3 times... (i have sometimes 200-300 tabs but here it was less than 30!)

Brave: 0.18.36
rev: 7ab85e9
Muon: 4.3.22
libchromiumcontent: 61.0.3163.79
V8: 6.1.534.32
Node.js: 7.9.0
Update Channel: dev
OS Platform: Linux
OS Release: 4.10.0-33-generic
OS Architecture: x64

@NumDeP
Copy link

NumDeP commented Oct 14, 2017

+1

davidak pushed a commit to davidak/ansible-ubuntu-desktop that referenced this issue Oct 16, 2017
it is not usable and i lost data multiple times
brave/browser-laptop#5512
@alexwykoff alexwykoff modified the milestones: 1.0.0, Backlog Nov 1, 2017
@bsclifton bsclifton added priority/P2 Crashes. Loss of data. Severe memory leak. and removed impact/high labels Nov 22, 2017
@bsclifton bsclifton modified the milestones: Triage Backlog, Backlog (Prioritized) Nov 22, 2017
@VosWouter87
Copy link

VosWouter87 commented Feb 8, 2018

Chrome won't restore my session any more, which is really annoying because I want to continue with the tabs.
I only had a single session file that looks like it has perfect and consistent JSON structure.
All I need from it are the urls, I'm happy to copy-paste them into Chrome.
But I cannot find them in the file, can you explain the restore file structure and where I can find the urls that where open?
I don't need the history or anything else in the tabs.

@capouch
Copy link

capouch commented Jun 27, 2018

Sorry for any noise, but it's unclear after reading through this and several other issues whether or not I should be surprised to learn that after I forgot and left my laptop on battery only, the machine shut down and now after rebooting my bookmarks seem to be 100% completely gone away forever. The browser opened with all tabs where they were, and passwords were all still there. So I was decoyed by that, and didn't notice until later (longer than 5 minutes) that my bookmarks had disappeared.

Is there any hope? Linux Slackware 14-current, 0.22.810. I back up weekly, but naturally these past few days were filled with intense work because of an upcoming conference presentation.

@davidak
Copy link

davidak commented Jun 27, 2018 via email

@bsclifton bsclifton modified the milestones: Backlog (Prioritized), Triage Backlog Sep 18, 2018
@bsclifton bsclifton added the addressed-with-brave-core Needs confirmation, but this issue may be resolved with Brave Core. label Sep 19, 2018
@bsclifton bsclifton removed this from the Triage Backlog milestone Sep 19, 2018
@bsclifton
Copy link
Member Author

I think we made some good progress with browser-laptop, but I don't think we'll be able to address the remaining issues

This experience for sure will be better with brave-core (new version of our product forked from Chromium). For folks that ran into issues with Brave who wanted to give it a second try, you can try the new version (currently on our Developer channel) available here:
https://brave.com/download-dev

@capouch
Copy link

capouch commented Sep 20, 2018

I just switched to the brave-core version. Will distribution be done someday with a similar (e.g. Brave.tar.bz2) version loadable from the Releases github page, as was done with browser-laptop? Or is there a "transition document" out there that needs to be perused?

@cndouglas
Copy link

@capouch The brave-core releases are available here: https://github.com/brave/brave-browser/releases

@bsclifton
Copy link
Member Author

@capouch in addition to the releases page that @liunkae mentioned, we also have a Linux setup document for package manager integration:
https://brave-browser.readthedocs.io/en/latest/installing-brave.html#linux

@capouch
Copy link

capouch commented Sep 27, 2018

Has something changed for newer release packs? wget 403s. . .

`wget https://brave-browser-apt-dev.s3.brave.com/pool/main/b/brave-browser-dev/brave-browser-dev_0.55.10_amd64.deb

--2018-09-27 03:14:41-- https://brave-browser-apt-dev.s3.brave.com/pool/main/b/brave-browser-dev/brave-browser-dev_0.55.10_amd64.deb

Resolving brave-browser-apt-dev.s3.brave.com... 151.101.194.217, 151.101.130.217, 151.101.66.217, ...

Connecting to brave-browser-apt-dev.s3.brave.com|151.101.194.217|:443... connected.

HTTP request sent, awaiting response... 403 Forbidden

2018-09-27 03:14:42 ERROR 403: Forbidden.`

@bsclifton
Copy link
Member Author

@capouch I think you've gotten sorted right? (I saw you commenting in brave-browser repo). Just wanted to check 😄

@capouch
Copy link

capouch commented Sep 28, 2018

@bsclifton Yes, thank you. Now there are .debs right there with the release announcement, at least (as of early this morning) for the 55 series, but not yet for 0.56.x

@sgnls
Copy link

sgnls commented Oct 5, 2018

AFAIC this is not due to any sort of 'corruption', perhaps not even an update (though evidentally the management / backup of the session-state is for discussion), but the sum of content in the 'session-state-1' file.

File itself is 1004K in size, UTF-8, parseable (less, cat, grep) and contains no malformed characters (9545).

If I enter an end-of-line (\n) before each URL in the file and output to a new file, I am able to manipulate and read the file with any editor (Atom, gedit) without issue.

Without removing any cached data, removing 'session-state-1' restores Brave's functionality and I have maintained sessions... though I have lost all bookmarks and ad, tracker block and upgrade metrics (far more frustrating than it should be).

For what it's worth, I first noticed issues when arranging bookmarks into folders; objects would disappear or re-appear in the original folder. It looks to correlate with updating the session-state file itself, but I've not looked into the mechanics of the write-backs yet. My research suggests this issue manifests after a varying period of time, which marries my thinking.

Given that the construct of the file (JSON) appears sound, I am able to extract important URLs and bookmarks... so that's something. I intend to play with stripping N 'records' from the file as I believe I should be able to coax it back into operation.

--##--

$ file session-store-1
session-store-1: UTF-8 Unicode text, with very long lines, with no line terminators

$ wc session-store-1
      0    9545 1027284 session-store-1

$ cat session-store-1 | sed 's/http/\nhttp/g' | wc -l
5052

$ cat session-store-1 | sed 's/http/\nhttp/g' > session-store-2

$ wc session-store-2
   5052   14586 1032336 session-store-2

@sgnls
Copy link

sgnls commented Oct 5, 2018

Preliminary skimming of extracted bookmarks from the 'session-state-1' file suggests that there are duplicates (which were invisible in browser) that correlate with my re-arranging (i.e. folders and URLs exist in both source and destination).

Perhaps the trigger for this is not the content-length of 'session-state-1', but something related to the bookmarks themselves and the way they are parsed at start-up?

Something wasn't happy here, too;

  • hxxp://url.com|0|9","order":2,"type":"bookmark"}],"NaN":[{"key":"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
addressed-with-brave-core Needs confirmation, but this issue may be resolved with Brave Core. parity Features which should be supported in Brave since they're supported in other major browsers. priority/P2 Crashes. Loss of data. Severe memory leak. project-tracking
Projects
None yet
Development

No branches or pull requests