*** Errors / Exception on Startup - READ FIRST ***

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

*** Errors / Exception on Startup - READ FIRST ***

Post by s55 »

If you see something similar to:

If you get a: System.UnauthorizedAccessException: Access to the path 'C:\Documents and Settings\Admin\Application Data\HandBrake\settings.xml' is denied.
It'll tell you what file it was trying to access. Usually settings.xml or presets.xml. Goto the path it shows and delete this file. Restart HandBrake.




If you get a System.TypeInitializationException: The type initializer for 'Handbrake.Functions.Main' threw an exception. ---> HandBrake.ApplicationServices.Exceptions.GeneralApplicationException: Exception of type 'HandBrake.ApplicationServices.Exceptions.GeneralApplicationException' was thrown.

Grab the latest nightly build (see forum announcements) and use that instead.

For some, this will only happen on first launch. In which case just ignore it. It usually doesn't happen again.
sixteenornumber
Posts: 7
Joined: Wed Mar 21, 2012 10:40 am

Re: Errors on Startup (Update check bug)

Post by sixteenornumber »

even after installing the the latest nightly build, (I've tried 236,237 & 238) I get the same error
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Errors on Startup (Update check bug)

Post by s55 »

Do you want to post that error? (I've seen 2 dozen people say that in the last few weeks and it's been a mixture of different problems. Some fixed, some not)
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Errors on Startup (Update check bug)

Post by s55 »

I've just made a change to include pdb's and enabled full debug for the nightly builds. It'll hopefully give me a better indication of where this error is.
Looks like the user settings service from the above, but difficult to say why.

https://trac.handbrake.fr/changeset/4530

The next nightly should give a better error message, so give it a shot when it's available. (Bare in mind the WIndows build server is down right at the minute, so it might not happen tonight, but it's on the queue so will happen when the server is fixed)
sixteenornumber
Posts: 7
Joined: Wed Mar 21, 2012 10:40 am

Re: Errors on Startup (Update check bug)

Post by sixteenornumber »

s55 wrote:Do you want to post that error? (I've seen 2 dozen people say that in the last few weeks and it's been a mixture of different problems. Some fixed, some not)
you linked me to this page sorry, here you go

Code: Select all

An Unknown Error has occured.
System.TypeInitializationException: The type initializer for 'Handbrake.Functions.Main' threw an exception. ---> HandBrake.ApplicationServices.Exceptions.GeneralApplicationException: Exception of type 'HandBrake.ApplicationServices.Exceptions.GeneralApplicationException' was thrown.
   at HandBrake.ApplicationServices.Services.UserSettingService.Load()
   at HandBrake.ApplicationServices.Services.UserSettingService..ctor()
   at HandBrake.ApplicationServices.ServiceManager.get_UserSettingService()
   at Handbrake.Functions.Main..cctor()
   --- End of inner exception stack trace ---
   at Handbrake.Functions.Main.SetCliVersionData()
   at Handbrake.Program.Main(String[] args)
Last edited by Anonymous on Sun Mar 25, 2012 11:04 pm, edited 1 time in total.
Reason: Logs should be placed in between [code] [/code] blocks
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Errors on Startup (Update check bug)

Post by s55 »

Too many posts to keep track off :(

Yup, ok. Same issue. When the next nightly builds, grab it and hopefully it'll give a better error message.
sixteenornumber
Posts: 7
Joined: Wed Mar 21, 2012 10:40 am

Re: Errors on Startup (Update check bug)

Post by sixteenornumber »

ok, thanks
sixteenornumber
Posts: 7
Joined: Wed Mar 21, 2012 10:40 am

Re: Errors on Startup (Update check bug)

Post by sixteenornumber »

here is the new error report from the nightly build. thanks

Code: Select all

HandBrake has detected corruption in the settings file. User settings will now be reset to defaults.
Please restart HandBrake before continuing.
HandBrake.ApplicationServices.Exceptions.GeneralApplicationException: Exception of type 'HandBrake.ApplicationServices.Exceptions.GeneralApplicationException' was thrown.
   at HandBrake.ApplicationServices.Services.UserSettingService.Load() in c:\HandBrake\Hudson\workspace\WindowsGui64\CS\HandBrake.ApplicationServices\Services\UserSettingService.cs:line 156
   at HandBrake.ApplicationServices.Services.UserSettingService..ctor() in c:\HandBrake\Hudson\workspace\WindowsGui64\CS\HandBrake.ApplicationServices\Services\UserSettingService.cs:line 45
   at Handbrake.frmMain..ctor(String[] args)
   at Handbrake.Program.Main(String[] args)

 ---- 

System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing.
   at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlReader.MoveToContent()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderSerializableDictionary2.Read1_dictionary()
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at HandBrake.ApplicationServices.Services.UserSettingService.Load() in c:\HandBrake\Hudson\workspace\WindowsGui64\CS\HandBrake.ApplicationServices\Services\UserSettingService.cs:line 140
Last edited by Anonymous on Sun Mar 25, 2012 11:03 pm, edited 1 time in total.
Reason: Logs should be placed in between [code] [/code] blocks
as400
Posts: 7
Joined: Wed Mar 28, 2012 8:13 pm

Re: Errors on Startup (Update check bug)

Post by as400 »

Has anyone seen this error message I am suddenly getting?

Code: Select all

An Unknown Error has occured.
System.UnauthorizedAccessException: Access to the path 'C:\Users\Pooh Bear\AppData\Roaming\HandBrake\settings.xml' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at HandBrake.ApplicationServices.Services.UserSettingService.Save()
at HandBrake.ApplicationServices.Services.UserSettingService.SetUserSetting(String name, Object value)
at Handbrake.frmMain..ctor(String[] args)
at Handbrake.Program.Main(String[] args)
Last edited by Anonymous on Thu Mar 29, 2012 12:09 pm, edited 1 time in total.
Reason: Logs should be placed in between [code] [/code] blocks
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Errors on Startup (Update check bug)

Post by s55 »

Restart your pc. Looks like something has a hold of that file and HandBrake can't access it as a result. Maybe Antivirus app
sixteenornumber
Posts: 7
Joined: Wed Mar 21, 2012 10:40 am

Re: Errors on Startup (Update check bug)

Post by sixteenornumber »

s55 wrote:Restart your pc. Looks like something has a hold of that file and HandBrake can't access it as a result. Maybe Antivirus app
Assuming you are responding to my post, that hasn't helped. If you weren't responding to my post, do you have any idea what's wrong?
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Errors on Startup (Update check bug)

Post by s55 »

Can I suggest that you delete the file, and let HandBrake re-create it. It's possible the file permissions have gotten messed up somehow.
as400
Posts: 7
Joined: Wed Mar 28, 2012 8:13 pm

Re: Errors on Startup (Update check bug)

Post by as400 »

Hello further to my previous message I reinstalled Handbrake and now get this: "please restart Handbrake before continuing"...not sure how to do that!

Code: Select all

HandBrake has detected corruption in the settings file. User settings will now be reset to defaults.
Please restart HandBrake before continuing.
HandBrake.ApplicationServices.Exceptions.GeneralApplicationException: Exception of type 'HandBrake.ApplicationServices.Exceptions.GeneralApplicationException' was thrown.
   at HandBrake.ApplicationServices.Services.UserSettingService.Load() in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\HandBrake.ApplicationServices\Services\UserSettingService.cs:line 156
   at HandBrake.ApplicationServices.Services.UserSettingService..ctor() in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\HandBrake.ApplicationServices\Services\UserSettingService.cs:line 44
   at HandBrake.ApplicationServices.ServiceManager.get_UserSettingService() in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\HandBrake.ApplicationServices\ServiceManager.cs:line 29
   at Handbrake.frmMain..ctor(String[] args) in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\frmMain.cs:line 56
   at Handbrake.Program.Main(String[] args) in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\Program.cs:line 79

 ---- 

HandBrake.ApplicationServices.Exceptions.GeneralApplicationException: Exception of type 'HandBrake.ApplicationServices.Exceptions.GeneralApplicationException' was thrown.
   at HandBrake.ApplicationServices.Services.UserSettingService.Save() in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\HandBrake.ApplicationServices\Services\UserSettingService.cs:line 122
   at HandBrake.ApplicationServices.Services.UserSettingService.Load() in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\HandBrake.ApplicationServices\Services\UserSettingService.cs:line 151
Last edited by Anonymous on Thu Mar 29, 2012 8:24 pm, edited 1 time in total.
Reason: Logs should be placed in between [code] [/code] blocks
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Errors on Startup (Update check bug)

Post by s55 »

Close and re-open :P

I've made yet more tweaks and if your still having issue, try tomorrows build. (svn4557)
as400
Posts: 7
Joined: Wed Mar 28, 2012 8:13 pm

Re: Errors on Startup (Update check bug)

Post by as400 »

The application doesn't open so its difficult to close!...why after using this excellent program for so long am I suddenly getting these errors?
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Errors on Startup (Update check bug)

Post by s55 »

No idea. A very small group of users suddently seem to have having this issue for no apparnt reason.
Unfortunatly, since I don't have enough info from the exception and have yet to be able to re-create it, it's going to be a bit of trail/error and trying new builds to get down to the root of the problem. I know it's a pain :(

Btw, I've pushed a new nightly build up. can you download and provide whatever error it produces now. It should be more detailed now.
as400
Posts: 7
Joined: Wed Mar 28, 2012 8:13 pm

Re: Errors on Startup (Update check bug)

Post by as400 »

This is what I get from the normal build, I'm no expert! but is there some kind of security issue/...the only security I have running is Microsoft Security Essentials.

Code: Select all

An Unknown Error has occured.
System.UnauthorizedAccessException: Access to the path 'C:\Users\Pooh Bear\AppData\Roaming\HandBrake\settings.xml' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
   at HandBrake.ApplicationServices.Services.UserSettingService.Save()
   at HandBrake.ApplicationServices.Services.UserSettingService.SetUserSetting(String name, Object value)
   at Handbrake.frmMain..ctor(String[] args)
   at Handbrake.Program.Main(String[] args)

And from a nightly build....

Code: Select all

A problem occured when trying to save your preferences.
Any settings you changed may need to be reset the next time HandBrake launches.
HandBrake.ApplicationServices.Exceptions.GeneralApplicationException: Exception of type 'HandBrake.ApplicationServices.Exceptions.GeneralApplicationException' was thrown.
   at HandBrake.ApplicationServices.Services.UserSettingService.Save() in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\HandBrake.ApplicationServices\Services\UserSettingService.cs:line 117
   at HandBrake.ApplicationServices.Services.UserSettingService.Load() in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\HandBrake.ApplicationServices\Services\UserSettingService.cs:line 160
   at HandBrake.ApplicationServices.Services.UserSettingService..ctor() in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\HandBrake.ApplicationServices\Services\UserSettingService.cs:line 43
   at HandBrake.ApplicationServices.ServiceManager.get_UserSettingService() in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\HandBrake.ApplicationServices\ServiceManager.cs:line 29
   at Handbrake.frmMain..ctor(String[] args) in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\frmMain.cs:line 56
   at Handbrake.Program.Main(String[] args) in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\Program.cs:line 79

 ---- 

System.UnauthorizedAccessException: Access to the path 'C:\Users\Pooh Bear\AppData\Roaming\HandBrake\settings.xml' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
   at HandBrake.ApplicationServices.Services.UserSettingService.Save() in c:\HandBrake\Hudson\workspace\WindowsGUI\CS\HandBrake.ApplicationServices\Services\UserSettingService.cs:line 110
-----
Last edited by Anonymous on Thu Mar 29, 2012 11:06 pm, edited 1 time in total.
Reason: Logs should be placed in between [code] [/code] blocks
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Errors on Startup (Update check bug)

Post by s55 »

Yeh, it's the same underlying issue as other people are having. Security Essentials shouldn't be interfearing with it. It looks more like a permissions problem. HandBrake wrote that file and it's in a location that your user should have access to, so I don't know why Windows is blocking access to it.

Can you delete this file: C:\Users\Pooh Bear\AppData\Roaming\HandBrake\settings.xml
Failing that, try deleteing the C:\Users\Pooh Bear\AppData\Roaming\HandBrake folder. (Might want to back up preset files if you've made any changes)


Is this Vista or 7? 32 or 64bit edition?

I'll setup a virtual machine with MS Security essentials and just see if it's not that that's doing it.
as400
Posts: 7
Joined: Wed Mar 28, 2012 8:13 pm

Re: Errors on Startup (Update check bug)

Post by as400 »

windows 7 32bit thanks for your help.
GregiBoy
Veteran User
Posts: 908
Joined: Sat Feb 12, 2011 9:23 pm

Re: Errors on Startup (Update check bug)

Post by GregiBoy »

Have you tried running as "Administrator" ?
as400
Posts: 7
Joined: Wed Mar 28, 2012 8:13 pm

Re: Errors on Startup (Update check bug)

Post by as400 »

yes but no joy as admin either....
as400
Posts: 7
Joined: Wed Mar 28, 2012 8:13 pm

Re: Errors on Startup (Update check bug)

Post by as400 »

OK was just playing before bedtime, I installed Handbrake on my recover partition and now it loads fine...there is obviously something clashing with it on the partition that also has windows and all my other stuff....well as long as it runs I don't mind where it sits on my computer!....so a tip to others if your drive is partitioned.
rollin_eng
Veteran User
Posts: 4859
Joined: Wed May 04, 2011 11:06 pm

Re: Errors on Startup (Update check bug)

Post by rollin_eng »

Code: Select all

An Unknown Error has occured.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Handbrake.frmMain..ctor(String[] args)
   at Handbrake.Program.Main(String[] args)
I just got this error on svn4510
Last edited by Anonymous on Sun Apr 01, 2012 8:24 pm, edited 1 time in total.
Reason: Logs should be placed in between [code] [/code] blocks
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Errors on Startup (Update check bug)

Post by s55 »

4510 is old. try an updated build.
genx69
Posts: 2
Joined: Thu Apr 12, 2012 12:54 pm

Re: Errors on Startup (Update check bug)

Post by genx69 »

hi, i installed 32-bit for windows. i'm running windows vista. at start up, i received the following error. i tried reinstalling several times and got same error every time. thanks.

An Unknown Error has occured.
System.ArgumentException: Font 'Tahoma' does not support style 'Regular'.
at System.Drawing.Font.CreateNativeFont()
at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font.Initialize(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font..ctor(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet)
at Handbrake.Controls.PictureSettings.InitializeComponent()
at Handbrake.Controls.PictureSettings..ctor()
at Handbrake.frmMain.InitializeComponent()
at Handbrake.frmMain..ctor(String[] args)
at Handbrake.Program.Main(String[] args)
Locked