The session file is invalid: TypeError: this._initialState.windows[0] is undefined

REOPENED
Unassigned

Status

()

Firefox
Session Restore
--
minor
REOPENED
7 years ago
5 years ago

People

(Reporter: rtrappman, Unassigned)

Tracking

9 Branch
x86_64
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 1 obsolete attachment)

8.94 KB, application/octet-stream
Details
21.62 KB, application/x-javascript
Details
110 bytes, application/x-javascript
Details
(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows NT 6.0; rv:2.0b8pre) Gecko/20101119 Firefox/4.0b8pre
Build Identifier: Mozilla/5.0 (Windows NT 6.0; rv:2.0b8pre) Gecko/20101119 Firefox/4.0b8pre

Upon launching Firefox, I get "SessionStore: The session file is invalid: TypeError: this._initialState.windows[0] is undefined" in the Error Console.



Reproducible: Sometimes




No apparent data loss.
(Reporter)

Updated

7 years ago
Version: unspecified → Trunk
I've seen something like this before - It means that somehow you had a session file get saved that had no windows in it.

Do you remember what your state was like when quitting?
Related to bug 401030 maybe?
(In reply to comment #2)
> Related to bug 401030 maybe?

Shouldn't be. That was the result of an incompatible extension.
(Reporter)

Comment 4

7 years ago
I had several tabs open, but I closed it like I normally do...
Rhett, could you please elaborate on what "closed it like I normally do" means?  Specifically, can you please provide detailed steps you follow to reproduce this bug?

Also, it might help if we can get a copy of your sessionstore.js file.
Summary: SessionStore: The session file is invalid: TypeError: this._initialState.windows[0] is undefined → The session file is invalid: TypeError: this._initialState.windows[0] is undefined
(Reporter)

Comment 6

7 years ago
>Rhett, could you please elaborate on what "closed it like I normally do" means?
I used the Red "X" at the top right of Firefox.

I'll upload the sessionstore.js file shortly...
(Reporter)

Comment 7

7 years ago
Created attachment 498445 [details]
sessionstore.bak
(Reporter)

Comment 8

7 years ago
Created attachment 498446 [details]
Session Store.bak
(Reporter)

Updated

7 years ago
Attachment #498446 - Attachment is obsolete: true
(Reporter)

Updated

7 years ago
Attachment #498445 - Attachment description: Session Store → sessionstore.bak
(Reporter)

Comment 9

7 years ago
Created attachment 498448 [details]
sessionstore.js
(Reporter)

Comment 10

7 years ago
It appears that both the backup and the current sessionstore.js are valid.
The valid one must have overwritten it since the time of the error.
I'm leaning toward resolving this INCOMPLETE for the time being.  Since the general scenario this would occur in is a window-less session, and a window-less session is extremely hard to create in Windows, this one is going to be hard for most users to stumble upon.

Rhett, please reopen if you can reproduce this bug and attach your broken sessionstore.js.

Thanks.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → VERIFIED
Created attachment 560501 [details]
"Empty" session

I'm been getting this lately in Firefox 6 on multiple machines.  Looking at the sessionstore.js file, it ends up blank which technically isn't invalid, there's just no windows since the last closed window was blank.  I'm not sure how it ends up in such a state though. 

I'll mention that when this error occurs, SessionStore does not send out the "sessionstore-windows-restored" or "sessionstore-browser-state-restored" notifications since there is an this._initialState variable so it won't get sent in onLoad, but there's no restored session so it won't get sent in _sendRestoreCompletedNotifications either.  Since my add-on looks for this to indicate the window load has completed, to kick off my secondary processing and it never arrives, my add-on never completes the startup processing.

Updated

6 years ago
Status: VERIFIED → REOPENED
Ever confirmed: true
Resolution: INCOMPLETE → ---
@morac, is this reproducible on Firefox 9.0a1?
Yes, I can reproduce it in 9.0a1 by using the sessionstore.js file I attached, but generating that isn't reproducible.   I managed to do it once by closing the browser window when there are no open tabs (i.e. only about:blank), but when trying to repeat this I ended up with an "about:blank" element in the windows object.  There might be some kind of timing element or something.

In any case the reason the error occurs with the attached sessionstore.js file is fairly obvious since there is no entry 0 in the windows array as the length is 0.  A check for windows.length > 0 would work around the problem.  It doesn't explain how the sessionstore.js file is generated in the first place though.


On a side note, it looks like the "sessionstore-windows-restored" notification is sent when this error occurs in Firefox 3.6 and 9.0a1, but not in 6.0.2.
Right, I think the root of this bug is that initialState.windows[0] should never be undefined. I will defer to the developers on this one though. Thanks for the added information.
(Reporter)

Updated

6 years ago
Version: Trunk → 9 Branch
I encountered this today but could save my work by the workaround described in 495123 comment 31.
You need to log in before you can comment on or make changes to this bug.