46

I am getting "Google Chrome didn't shut down correctly" twice a week - it becomes a very annoying problem -
I always fixed this issue by removing the chrome's default user profile and re-opening the chrome, but doing this will remove all my extensions / apps / bookmarks / settings.
but this is happening more often and I keep losing settings

is there a way to end this madness? I am running Win 8.1 / latest version of chrome

user44517
  • 461

12 Answers12

34

I went into Settings / Advanced (in Chrome) and checked the box for "Continue running background apps when Google Chrome is closed" option. This fixed the problem for me.

Ironically, I went to this setting because another user had fixed it by UNCHECKING that option, which worked for him.

Perhaps simply changing the option causes Chrome to clean up something internally. I believe my bogus error msg began when Chrome actually DID fail to shut down correctly, and somehow the error flag got stuck.

EDIT: As of second half of 2018 the "Continue running background apps when Google Chrome is closed" option is now available in Settings > Advanced > System in Google Chrome (Windows 10).

trejder
  • 12,105
21

This was just happening to me too. Just do the following things:

  1. Open the folder %UserProfile%\AppData\Local\Google\Chrome\User Data\Default\
  2. Open the file preferences
  3. Towards the bottom, find the following line:

    "exit_type": "Crashed"
    

    Then replace Crashed with normal like this:

    "exit_type": "normal"
    
  4. Save and relaunch Chrome

The problem should be fixed!

KyleMit
  • 6,865
Ryan
  • 219
3

Not working since Chrome 43

I've used Ryan's (one time solution) and valentt's (needed to change another preference) answers to fix it forever (I hope so) on Ubuntu

add following to Startup Apllications (don't forget to change your profile name and chrome directory):

sed -i 's/exit_type\"\:\ \"Crashed/exit_type\"\:\ \"normal/g' /home/janot/.config/google-chrome-beta/Default/Preferences
janot
  • 1,063
1

I found the answers complicated so I just thought why not stop it from saving any browsing history, which must be what is not shutting down properly. I never refer to it anyway. So I stopped it from saving browsing history. It worked.

Jenny
  • 11
1

This is how i solved Chrome not shutting down correctly! Simply start chrome automatically at start-up with the following command: google-chrome --no-startup-window

This solved it for me!

FYI: I am running Mint 64bit v17.1 (cinnamon)

romke
  • 11
1

On Windows it may be necessary to remove System, Hidden and Read-only attributes from the file %UserProfile%\AppData\Local\Google\Chrome\User Data\Default\Preferences due to malware corruption. The "crashed" status is preserved every launch because the file attributes forbid Chrome from removing the "crashed" status. You can do this with the following command (elevation is not required):

attrib -h -s -r "%UserProfile%\AppData\Local\Google\Chrome\User Data\Default\Preferences"

After opening Chrome and either clicking the 'x' or the 'restore' buttons on the warning, close Chrome and the next time you open it the error will be gone.

Braiam
  • 4,777
shawn
  • 965
0

in Ubuntu or similar, for chromium and google-chrome

sed -i \
    's,"exit_type":\s*"Crashed","exit_type":"Normal",g' \
    ~/.config/{google-chrome,chromium}/@(Profile\ ?|Default)/Preferences

Execute this before launching the browser. I put this in a bash script:

$ cat ~/bin/internet
#!/usr/bin/env bash
shopt -s extglob
sed -i \
    's,"exit_type":\s*"Crashed","exit_type":"Normal",g' \
    ~/.config/{google-chrome,chromium}/@(Profile\ ?|Default)/Preferences
exec "$@"

You can also modify .desktop files if you use them:

$ sudo sed -i 's,Exec=,Exec=/home/bartek/bin/internet,g' /usr/share/applications/{google-chrome,chromium-browser}.desktop
$ grep Exec /usr/share/applications/{google-chrome,chromium-browser}.desktop
/usr/share/applications/google-chrome.desktop:Exec=/home/bartek/bin/internet /usr/bin/google-chrome-stable %U
/usr/share/applications/google-chrome.desktop:Exec=/home/bartek/bin/internet /usr/bin/google-chrome-stable
/usr/share/applications/google-chrome.desktop:Exec=/home/bartek/bin/internet /usr/bin/google-chrome-stable --incognito
/usr/share/applications/chromium-browser.desktop:Exec=/home/bartek/bin/internet chromium-browser %U
/usr/share/applications/chromium-browser.desktop:Exec=/home/bartek/bin/internet chromium-browser
/usr/share/applications/chromium-browser.desktop:Exec=/home/bartek/bin/internet chromium-browser --incognito
/usr/share/applications/chromium-browser.desktop:Exec=/home/bartek/bin/internet chromium-browser --temp-profile

Command Details:

- replaces JSON file key "exit_type" from "Crashed" to "Normal"
- JSON might include white space after colons, removed
- {google-chrome,chromium} - bash brace expansion, creates multiple paths if any of those exist
- /@(Profile\ ?|Default) - bash extended pattern, similar to brace expansion, allows for wildcards ? in patterns
- I used comma instead of common / in sed pattern, for readability

Based on janot's answer (this in turn based on others' work.

0

I fixed mine:

  • Create a new windows sign on Account - or just activate Guest Account

  • Using Win Explorer (Tools, Folder Options), Set it to show Hidden Files

  • Then go to: Users\new_or_guest_account\AppData\Local\Google

  • "Copy" the folder

  • Go to: Users\the_account_having_trouble\AppData\Local\Google

  • Delete (or rename) The Google Folder

  • "Paste" Google Folder

You should be good to go.

You can restore Bookmarks by copy and paste of the Bookmarks file that is in this folder: C:\Users\account\AppData\Local\Google\Chrome\User Data\Default

Sun
  • 6,480
0

I recently solved this problem by removing the duplicate of my account in the beginning of the Preferences file.

Open: %UserProfile%\AppData\Local\Google\Chrome\User Data\Default\Preferences

And locate (probably at the top of the file)

"account_info": [ {
      "account_id": "address@gmail.com",
      "email": "adress@gmail.com",
      "gaia": "256524851203586575245"
   }, {
      "account_id": "adress@gmail.com",
      "email": "adress@gmail.com",
      "gaia": "256524851203586575245"
   } ],

I removed the duplicate, so i ended up with:

"account_info": [ {
      "account_id": "address@gmail.com",
      "email": "adress@gmail.com",
      "gaia": "256524851203586575245"
   } ],

This kept all my extensions and preferences. And this hasn't opened multiple tabs after start-up or given the "Google Chrome didn't shut down correctly" message even after shutting down windows without closing chrome.

(I did notice that the array contained a duplicate account again after a while but it didn't cause any problems.)

ct194
  • 1
0

When trying to use Ryan's excellent answer, I found that the file %UserProfile%\AppData\Local\Google\Chrome\User Data\Default\Preferences was in use. I searched for it using Sysinternals Process Explorer's "Find Handle or DLL", found out that it was some Lenovo Utility - C:\Program Files (x86)\Lenovo\LocationAware\lpdagent.exe - Location Task Manager LPD Access Agent.

Solution: Killed lpdagent.exe, opened Chrome once - got "Google Chrome didn't shut down correctly" one more time, and then no more - the problem was fixed.

Jonathan
  • 3,633
0

I get this error every time there is a chrome update.

I find that I cannot save the preferences file as it is in use by another program (even with chrome shut down!). This indicates that chrome is running in the background.

My solution is to toggle the "Continue running background apps when Google Chrome is closed" setting.
[I switch it on, close chrome then start chrome and switch it off] This then allows me to change the "exit_type" in the preferences file as suggested above.

Works for me :)

-1

Launch it using following command:

google chrome --restore-last-session

http://peter.sh/experiments/chromium-command-line-switches/#restore-last-session

From Gili's answer

janot
  • 1,063