mkaply / cck2wizard

CCK2
Mozilla Public License 2.0
46 stars 9 forks source link

Error message prior to starting FF 58 with CCK2 install #75

Closed tsherrington closed 6 years ago

tsherrington commented 6 years ago

Hi there, I'm getting a lot of PCs that is giving an error when FF 58 starts (57.0.4 starts fine). The error is: [Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsIPrefBranch.setComplexValue]" nsresult: "0x80004002 (NS_NOINTERFACE)" location: "JS frame :: resource://cck2/Preferences.jsm :: _set :: line 194" data: no]

_set@resource://cck2/Preferences.jsm:194:11 set@resource://cck2/Preferences.jsm:152:5 init@resource://cck2/CCK2.jsm:170:7 @cck2.cfg:59:1

(notice that the line number for cck2.cfg is different than the bug mentioned in 73.)

If I click OK, FF starts fine. I can fix the problem by removing and reinstalling FF 58 with the latest CCK2 download, but I'm wondering if I can just replace a damaged file to fix the machines that are currently having the problem.

tsherrington commented 6 years ago

Copying the entire autoconfig folder into the \program files\mozilla firefox folder (and overwriting everything) doesn't fix the problem.

tsherrington commented 6 years ago

The only way I can fix this error right now is to uninstall FF58 (which requires a restart) then remove the \program files\mozilla firefox folder and then reinstall.

Edit: This was working, but now the only way I can fix it is to delete all the CCK2 files that are in the \program files\mozilla firefox folder.

Not sure if fresh installs are working, but I'll be testing that shortly.

mkaply commented 6 years ago

You should just be able to the overwrite the file Preferences.jsm from the new CCK2 - https://raw.githubusercontent.com/mkaply/cck2wizard/master/cck2/modules/Preferences.jsm into your existing installs to avoid this problem.

KevinWaberski commented 6 years ago

Actually i do have exactly the same issue on my systems. I downloadrd the whole mudules-folder and replaced every single file - but the error still remains on an existing ff58 installation.

I cannot uninstall + reinstall all of our firefox deployments. i sther eanother tweak?

thanks in advance

tsherrington commented 6 years ago

Ok, I tried replacing just preferences.jsm - no change, still get the pop up. Then I replaced all the files with the new autoconfig - no change. The only fix appears to be to remove all the files from the autoconfig folder, which is a pain.

tsherrington commented 6 years ago

I just thought of something. Maybe I'm doing the installation with CCK2 wrong. What I do is this: 1)I install Firefox (but don't start it). 2)I copy the autoconfig folder to the Firefox installation folder. 3)I run Firefox and CCK2 installs all the stuff I want for this user.

Is there any reason I shouldn't just remove the CCK2 files at this point? Wouldn't that solve these kinds of problems in the future?

mkaply commented 6 years ago

You still need the CCK2 files to set prefs at startup. I think you're running into a different problem. I'd like to provide you a new Preferences.jsm to see if I can debug. Can you try with this Preferences.jsm? It will now show an error popup, but it will report to the Javascript console so I can see what is happening.

Preferences.jsm.zip

KevinWaberski commented 6 years ago

Thankss for your quick response and your help. I'll test it tomorrow when I am back in office and post the log.

KevinWaberski commented 6 years ago

Hey there,

I just updated to 58.0.1 in the background. The error still exists and starting the firefox with the new preferences.jsm says:

can't set pref extensions.cck2.MyCompany1.27.installedVersion to value '1.27'; it isn't a String, Number, or Boolean

errorCritical@resource://cck2/CCK2.jsm:1111:13 init@resource://cck2/CCK2.jsm:570:7 @cck2.cfg:118:1

My system is a Windows 10 x64 - using Firefox 58.0.1 x64 The error is hitting my Firefox on every Win 10 VM Win 7 VMs and hardware cleints are not affected (3 tested so far).

tsherrington commented 6 years ago

You still need the CCK2 files to set prefs at startup. I think you're running into a different problem. I'd like to provide you a new Preferences.jsm to see if I can debug. Can you try with this Preferences.jsm? It will now show an error popup, but it will report to the Javascript console so I can see what is happening.

Preferences.jsm.zip

The first time I tried this file, I got the "cannot open configuration file. Contact your administrator" message. But FF was updating to 58.0.1 at the same time. I exitied FF, deleted all the CCK2 files, put them back in and put your preferences.jsm file in and FF is now opening normally, so maybe it was fixed by the 58.0.1 update?

Let me know what you need from me.

mkaply commented 6 years ago

@KevinWaberski OK, now we're getting somewhere. Although I'm still confused as to why that would happen. Can I give you another Preferences.jsm to try?

mkaply commented 6 years ago

@KevinWaberski Actually, this was my dumb mistake. Try thisone. Preferences.jsm.zip

ScottHamper commented 6 years ago

@mkaply,

That one resolved the error for me!

mkaply commented 6 years ago

@ScottHamper Can you check your Javascript console to see the error it is reporting? I'm basically hiding it now, but I really want to know what is going on so I can fix the core problem. Thanks!

ScottHamper commented 6 years ago

@mkaply,

Oh man, sorry about that! I am derping super hard - the computer I originally tried this on stopped exhibiting the problem after one occurrence (but there was no console output, and I even put the old Preferences.jsm file back in place - still couldn't re-trigger the problem).

... So I grabbed a different computer that is consistently throwing the error on start-up. However, after replacing the Preferences.jsm file, I'm still getting the same error message that reports line 194 in Preferences.jsm, even when I can visually see that the problematic code has moved to line 197. Is this file being cached somewhere/somehow and I am just clueless?

For verification, I've put Preferences.jsm at C:\Program Files (x86)\Mozilla\Firefox\cck2\modules. This computer originally had an older version of Firefox installed that was later updated, which is why it's still in (x86).

mkaply commented 6 years ago

Weird. It must be caching it somehow. You could try creating a new profile?

KevinWaberski commented 6 years ago

Actually, this was my dumb mistake. Try thisone. Preferences.jsm.zip

Thank you very much. This one resolves the error. Tested on 2 VMs and Win10 and 2 VMs Win7 - x64. I was not able to compare thie old and new file to check out what you did - but it is incredible good. Thanks for your support in this case.

I would try to help you with my log - but it seems to be completey empty - no warnings or errors. Can I help you improve it any more?

petewest commented 6 years ago

I found that by deleting the contents of %LOCALAPPDATA%\Mozilla\Firefox\Profiles\*\startupCache it works.

tsherrington commented 6 years ago

@petewest - did you update the autoconfig files first and then delete the %LOCALAPPDATA%\Mozilla\Firefox\Profiles*\startupCache - or just delete startupCache?

petewest commented 6 years ago

I had to use the updated https://raw.githubusercontent.com/mkaply/cck2wizard/master/cck2/modules/Preferences.jsm linked above, but I didn’t touch any other files. I think it’s where other users get the error for the first time with the old Preferences.jsm, then I copy the modified file on to their PC but it’s dated earlier than their cache files so it doesn’t rebuild the cache.

ScottHamper commented 6 years ago

Thanks, @petewest!

Ok, so here's what I think happened for my deployments:

tsherrington commented 6 years ago

I'm still having problems here.
I have a tower which just updated to FF58.0.1. I did the following to fix the CCK2 error. 1)Copied the contents of autoconfig.zip to \program files\mozilla firefox, overwriting the earlier files. 2)Then I ran the following script to clean out the cache folders: cd /d %LOCALAPPDATA%\Mozilla\Firefox\Profiles for /f %%f in ('dir /ad/b') do echo %%f del startupCache*.*

It still gave the attached error. cck2-error

Then I tried removing all the autoconfig files from the Firefox install folder but that gave me the error with configuration file, please contact your administrator.

I put back all the autoconfig files, but got the original message.

Then I tried starting FF in safemode (firefox.exe -safe-mode) and it started fine, and after closing it, started in normal mode fine as well.

The problem is that this is a lot of fiddling for end users.

I'm using CCK2 2.2.3.5 on a Firefox ESR to generate the file.

So right now, I'm still manually resolving the error. What am I missing?

Thanks,

Thane

andi74sauer commented 6 years ago

On macOS it works again with FF ESR and CCK2 2.2.3.5 or by replacing the Preferences.jsm file with the one above. https://github.com/mkaply/cck2wizard/files/1678151/Preferences.jsm.zip

Thanks.

Andreas

tsherrington commented 6 years ago

I'm using the same perferences.jsm that @andi74sauer is using but with the errors in my message above.

ScottHamper commented 6 years ago

@tsherrington - I don't think the batch script you posted actually deletes the startupCache folders (at least it didn't, when I tried it).

This worked successfully for me:

for /d %%d in ("%LOCALAPPDATA%\Mozilla\Firefox\Profiles\*") do rmdir /q /s "%%d\startupCache"

Any time you see the error message that you posted earlier means that Firefox is still loading a copy of Preferences.jsm from an older version than 2.2.3.5.

The setComplexValue method call that's throwing the error is no longer on line 194 as of 2.2.3.5 (nor is it at column 11 - you can see how this line moved in commit 81a0145).

tsherrington commented 6 years ago

@ScottHamper - I was trying to remove the files without the removing folder. Thanks for the heads up. I'll change that script.