Showing posts with label Error. Show all posts
Showing posts with label Error. Show all posts

Wednesday, April 20, 2011

HTTP Error 503. The service is unavailable.

I was trying to solve a problem with Silverlight/WCF error when I actually got this error:

Service-unavailable-error

Someone suggested this solution:

In the IIS Manager\App Pools\Application’s AppPool –> Advanced Settings –> Load User Profile = false:

iis-advanced-settings-load-user-profile

If it helps you please post a response and I will move the solution to my real blog.

 

You can still read my tortured experience (though in the end only format solved it):

I was using IISreset, IISreset /stop, IISreset /start like crazy.

Going to the IIS I found one of the AppPool was stopped so I decided to start it:

IIS-app-pool-start

For like 2 minutes I thought that have been a mistake since it just didn’t complete. But when it completed it was still stopped.

Restart didn’t solve the problem.

Looking at the event log I found one error:

Log Name:      System
Source:        Microsoft-Windows-WAS
Date:          03/02/2011 15:08:03
Event ID:      5002
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Description:
Application pool 'ASP.NET v4.0' is being automatically disabled due to a series of failures in the process(es) serving that application pool.

And about 5 warnings:

Log Name:      System
Source:        Microsoft-Windows-WAS
Date:          03/02/2011 15:08:03
Event ID:      5022
Task Category: None
Level:         Warning
Keywords:      Classic
User:          N/A
Description:
The Windows Process Activation Service failed to create a worker process for the application pool 'ASP.NET v4.0'. The data field contains the error number.

 

Now I know I did some changes in the web.config file – so I decided to undo those. And try to start the App Pool again.

 

I found this error in the Event Viewer: Application Log (it started around the time I started having problems):

Log Name:      Application
Source:        Microsoft-Windows-User Profiles Service
Date:          03/02/2011 14:36:20
Event ID:      1500
Task Category: None
Level:         Error
Keywords:     
User:          IIS APPPOOL\ASP.NET v4.0
Description:
Windows cannot log you on because your profile cannot be loaded. Check that you are connected to the network, and that your network is functioning correctly.

DETAIL - Only part of a ReadProcessMemory or WriteProcessMemory request was completed.

This is an Error for ITs though…

 

But the simplest solution did work – I just moved my applications to another App Pool… Until I had to restart my and then got my trouble doubled:

IIS-double-trouble

(I am starting to use “temp” named App Pools – God Save Me!)

 

Hope I won’t need to format this computer…
Format seems to solve this problem (formatted for a different reason)…

Keywords: IIS, Error

IceRocket Tags: ,

Sunday, February 20, 2011

Rebuild All failed without any errors (Silverlight), Part 2

A bit of an update from part 1.

I decided to do a clean of the solution (plus manually delete the XAP from the web project) and then a build and got this in the build:

MSBUILD : error : Xap packaging failed. Exception of type 'System.OutOfMemoryException' was thrown.

So the first thing I decided to do was open a new Visual Studio 2010 and attach it to the old instance of VS2010. Then clean –> rebuild This time I got a bit more:

'devenv.exe' (Managed (v4.0.30319)): Loaded 'C:\Program Files\Microsoft SDKs\Expression\Blend\Silverlight\v4.0\Libraries\System.Windows.Interactivity.dll'
'devenv.exe' (Managed (v4.0.30319)): Loaded 'c:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Xml.dll'
'devenv.exe' (Managed (v4.0.30319)): Loaded 'C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\XamlServices.dll'
A first chance exception of type 'MS.Internal.Xaml.XamlTypeResolutionException' occurred in XamlServices.dll
A first chance exception of type 'MS.Internal.Xaml.XamlTypeResolutionException' occurred in XamlServices.dll

… Just imagine 600 more lines like those 2

A first chance exception of type 'MS.Internal.Xaml.XamlTypeResolutionException' occurred in XamlServices.dll
A first chance exception of type 'System.OutOfMemoryException' occurred in Microsoft.Silverlight.Build.Tasks.dll
A first chance exception of type 'System.OutOfMemoryException' occurred in Microsoft.Silverlight.Build.Tasks.dll
A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualStudio.ORDesigner.Dsl.dll
…Another repeat performance this time only 10 lines

A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualStudio.ORDesigner.Dsl.dll
A first chance exception of type 'JetBrains.Util.Assertion.AssertionException' occurred in JetBrains.Platform.ReSharper.ProjectModel.dll
A first chance exception of type 'JetBrains.Util.Assertion.AssertionException' occurred in JetBrains.Platform.ReSharper.ProjectModel.dll
A first chance exception of type 'System.InvalidOperationException' occurred in JetBrains.Platform.ReSharper.VSIntegration.dll
A first chance exception of type 'System.InvalidOperationException' occurred in JetBrains.Platform.dotTrace.VSIntegration.dll

…Seems like dotTrace and Resharper are playing a tag war with Exceptions and my system resources…

At this point I decided to do two things:

  1. Uninstall dotTrace Performance since I don’t really use it
  2. Use dotTrace Memory profiler on Visual Studio 2010 and see where the hell all my memory is being wasted… unfortunately that failed me since dotTrace Memory needed more memory than I had.

The next thing I decided to do is uninstall Resharper 6.0 EAP and work without Resharper, well no problems for a day but also less work.

At this point I decided to try working with Resharper 5.1 and the problem returned it just took VS ~7 hours to fail my build. Looking at the clean output this time got me:

========== Clean: 20 succeeded, 10 failed, 0 skipped ==========

Looking at the debug output of the clean, I had this errors:

A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualStudio.ORDesigner.Dsl.dll (188 times)
A first chance exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll  (2 times)
'devenv.exe' (Managed (v4.0.30319)): Loaded 'C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\XamlServices.dll' (4 times)
'devenv.exe' (Managed (v4.0.30319)): Loaded 'c:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Windows.dll' (4 times)
A first chance exception of type 'MS.Internal.Xaml.XamlNamespaceException' occurred in XamlServices.dll (23 times)
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll (20 times)
A first chance exception of type 'MS.Internal.Xaml.XamlTypeResolutionException' occurred in XamlServices.dll (712 times)

A first chance exception of type 'JetBrains.Application.Progress.ProcessCancelledException' occurred in JetBrains.Platform.ReSharper.Shell.dll (2 times)
A first chance exception of type 'JetBrains.Metadata.Utils.PE.MetadataReaderException' occurred in JetBrains.Platform.ReSharper.Metadata.dll (4 times)
A first chance exception of type 'System.ArgumentException' occurred in JetBrains.Platform.ReSharper.Metadata.dll (7 times)
A first chance exception of type 'JetBrains.Application.Progress.ProcessCancelledException' occurred in JetBrains.ReSharper.Daemon.dll (5 times)
The thread 'Cache.AddAssembly #0' (0x2038) has exited with code 0 (0x0). (1 times)
The thread 'Cache.AddAssembly #1' (0x23f8) has exited with code 0 (0x0). (1 times)
A first chance exception of type 'Microsoft.Build.Shared.InternalErrorException' occurred in Microsoft.Build.dll (26 times)

'devenv.exe' (Managed (v4.0.30319)): Loaded '...' (41 times)

The thread '<No Name>' (0x####) has exited with code 0 (0x0). (16 times)

---Cleaned Failed Message---
A first chance exception of type 'JetBrains.ReSharper.Psi.Xaml.Parsing.MarkupExtensionsTreeBuilder.IsTextException' occurred in JetBrains.ReSharper.Psi.Xaml.dll (29 times)

 

I am pretty sure I have problems in my xaml but why and where? I believe the Xaml has troubles being parsed but it makes do with what it has (by throwing exceptions which the compiler ignores). I don’t understand why the application works though…

So while the debugger is still attached I tried opening a Xaml file, got my errors:

A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll (2 times)
A first chance exception of type 'System.BadImageFormatException' occurred in mscorlib.dll (9 times)
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll (1 times)
'devenv.exe' (Managed (v4.0.30319)): Loaded '...' (6 times)
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll (3 times)

It took me a while but I got the BadImageFormatException details:

Message: Could not load file or assembly 'System.Core.ni.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Stack Trace: at System.Reflection.AssemblyName.nGetFileInformation(String s)
     at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)

Could not load file or assembly 'System.Net.ni.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.

And also for: 'System.ni.dll', 'System.Runtime.Serialization.ni.dll', 'System.ServiceModel.ni.dll', 'System.ServiceModel.Web.ni.dll', 'System.Windows.Browser.ni.dll', 'System.Windows.ni.dll', 'System.Xml.ni.dll'.

Thank God it didn’t search for Knight.ni.dll… (it seems I am not the first developer with this joke…)

 

The FileNotFoundException was caused by:

Message: Could not load file or assembly 'System.debug.resources, Version=2.0.5.0, Culture=en-US, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

FusionLog:

=== Pre-bind state information ===
LOG: User = (my user)
LOG: DisplayName = System.debug.resources, Version=2.0.5.0, Culture=en-US, PublicKeyToken=7cec85d7bea7798e
(Fully-specified)
LOG: Appbase = file:///c:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.debug.resources, Version=2.0.5.0, Culture=en-US, PublicKeyToken=7cec85d7bea7798e
...

Stack Trace:

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

 

And twice for:

Could not load file or assembly 'file:///C:\Projects\Company.GIS.GISApp\Bin\Company.GIS.GISApp.dll' or one of its dependencies. The system cannot find the file specified.

(this is my Web application that host the XAP file)

 

I decided going over my XAML files with the designer opened and fix the errors:

  1. Cannot register duplicate Name '…' in this scope. Fixed using this. The reason behind this can be found here.
  2. The file '/FolderName/ControlNameResources.xaml' is not part of the project or its 'Build Action' property is not set to 'Resource'. Fixed this by giving the correct path: '../FolderName/ControlNameResources.xaml'
  3. Cannot find a Resource with the Name/Key WebConfig [Line: 53 Position: 37]. Now this was in a control that was already fixed
  4. Element is already the child of another element. [Line: 0 Position: 0]. Again the same control as in 3,
  5. System.InvalidOperationException
    An unhandled exception was encountered while trying to render the current silverlight project on the design surface. To diagnose this failure, please try to run the project in a regular browser using the silverlight developer runtime.
       at Microsoft.Windows.Design.Platform.SilverlightViewProducer.OnUnhandledException(Object sender, ViewUnhandledExceptionEventArgs e)
       at Microsoft.Expression.Platform.Silverlight.SilverlightPlatformSpecificView.OnUnhandledException(Object sender, ViewUnhandledExceptionEventArgs args)
       at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
       at Microsoft.Expression.Platform.Silverlight.Host.SilverlightImageHost.<>c__DisplayClass1.<Application_UnhandledException>b__0(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

     
    System.Exception
    Error HRESULT E_FAIL has been returned from a call to a COM component.
       at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
       at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, String s)
       at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
       at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
       at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
       at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at System.Windows.ResourceDictionary.set_Source(Uri value)
       at BetterPlace.OBS.GIS.MapControl.LoadFeatureLayers() in C:\Projects\Company.GIS.MapControl\MapControl.cs:line 688
       at Company.GIS.MapControl.OnApplyTemplate() in C:\Projects\Company.GIS.MapControl\MapControl.cs:line 163
       at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)

     

 

The other option is that I have problems with exceptions being thrown in VS , see Tess’s Blog Post.

Found this:

http://willg.co.uk/default.aspx

Could be useful

 

I had hoped the Visual Studio 2010 SP1 will solve this problem – no such luck.

Hopefully installing the whole system from scratch will solve the problem (I have 4GB of memory and windows 7 32Bit and already wanted to upgrade to 64bit). I am not posting this on Microsoft forums because if doesn’t happen on the new system I won’t be able to post debugger dumps and logs that they will surely need.

 

Keywords: VS2010, build, error

IceRocket Tags: ,,

Thursday, February 3, 2011

Silverlight error connecting to WCF

So after I fixed some of the memory problems with my application yesterday. I started my application and tried our address auto complete feature (it’s one of the most basic features that we have). I got this little error on the bottom left of the screen:

silverlight-default-exception-handler

Double clicking it I got my exception:

Message: Unhandled Error in Silverlight Application An AsyncCallback threw an exception.   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnGetResponse(IAsyncResult result)
   at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClassd.<InvokeGetResponseCallback>b__b(Object state2)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Line: 1
Char: 1
Code: 0
URI: http://localhost/version/MyApplication/js/update.js

First I thought that maybe I am trying to use another server, I fixed that but still got the error (so that wasn’t the problem).

So I started logging and got the following error reading the traces.svclog log file:

There is an unclosed literal string. Line ##, position ##.

So I decided to open the file with Notepad++ and used TextFX->TextFX HTML Tidy->Tidy: reindent XML

I couldn’t find and reference to my AutoComplete service but I found this error lurking around:

System.Runtime.InteropServices.COMException
                  (0x8004150D): Out of server memory [SDE.Default]
                  at
                  ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactoryClass.OpenFromString(String
                  connectStr, Int32 hWnd) at
                  Company.GIS.Core.Esri.WorkspaceProvider.CreateWorkspace(String
                  sdeConnectionString) in
                  C:\Projects\P652\Company\GIS\Framework\Server\Source\Company.GIS.Core\Company.GIS.Core.Esri\Workspace\WorkspaceProvider.cs:line
                  105 at …

Apparently my memory problems just got worst because ESRI decided to jump ship (shit).

Tried to change the web.config and do a bit IISreset, Start the debugger and got the error: HTTP Error 503. The service is unavailable.

Restart doesn’t help…

But the simplest solution did work – I just moved my applications to another App Pool…

And found out the hard way that my team leader didn’t check in his changes and because of that I got the original Error!

//TODO: I still need to study the COMException Out of server memory

Keywords: IIS, Error, Silverlight, WCF

IceRocket Tags: ,,,