473,378 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

IIS stopped Working

1
I am developing web application using (C#) and (ASP.NET Web API) and MS SQL 2008 R2 and hosting on IIS7 in Windows Server 2008, All APIs return data in JSON

When i call any API from any web browser and refresh the page to call again before the first call finishes it give me warning in the event viewer and after 0 to 5 minutes the worker process in the II7 stopped for about 2 minutes(hang) and all APIs calls from all users at the period of those 2 minutes don't work and event viewer give me an error:


The Warning in the event viewer

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 6/5/2012 3:29:10 PM
Event time (UTC): 6/5/2012 1:29:10 PM
Event ID: 63adcb812864465cab58e9f870bcbb92
Event sequence: 5
Event occurrence: 1
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/2/ROOT/AAA-2-129833765408950000
Trust level: Full
Application Virtual Path: /AAA
Application Path: C:\inetpub\wwwroot\AAA\
Machine name: MyMachine

Process information:
Process ID: 9860
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
Exception type: HttpException
Exception message: The remote host closed the connection. The error code is 0x800704CD.
at System.Web.Http.WebHost.HttpControllerHandler.EndP rocessRequest(IAsyncResult result)
at System.Web.Http.WebHost.HttpControllerHandler.Syst em.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncR esult result)
at System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)



Request information:
Request URL: My API URL
Request path: API Path
User host address: My IP
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
Thread ID: 8
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Web.Http.WebHost.HttpControllerHandler.EndP rocessRequest(IAsyncResult result)
at System.Web.Http.WebHost.HttpControllerHandler.Syst em.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncR esult result)
at System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)







The Error in the event viewer


An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/2/ROOT/AAA

Process ID: 9860

Exception: System.AggregateException

Message: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.

StackTrace: at System.Threading.Tasks.TaskExceptionHolder.Finaliz e()

InnerException: System.Web.HttpException

Message: The remote host closed the connection. The error code is 0x800704CD.

StackTrace: at System.Web.Http.WebHost.HttpControllerHandler.EndP rocessRequest(IAsyncResult result)
at System.Web.Http.WebHost.HttpControllerHandler.Syst em.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncR esult result)
at System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)

code behind

Expand|Select|Wrap|Line Numbers
  1.  
  2.   // GET /api/v1/content      
  3.     [HttpGet]
  4.     public IEnumerable<ME_API_V1.Models.Content> GetContent()
  5.     {
  6.         Request.Headers.Add("Accept", "application/json");
  7.         List<ZMSLibrary.ME.Models.Content> contentList = new List<ZMSLibrary.ME.Models.Content>() ;
  8.         try
  9.         {
  10.             //DateTime CurrentDateTime = DateTime.Now;
  11.  
  12.             var querystring = this.Request.RequestUri.Query;
  13.             var parameters = HttpUtility.ParseQueryString(querystring);
  14.  
  15.             string userID = parameters["userID"];
  16.             string countryCode = parameters["countryCode"];
  17.             string language = parameters["language"];
  18.             string categoryName = parameters["categoryName"];
  19.             string subcategoryID = parameters["subcategoryID"];
  20.             string count = parameters["count"];
  21.             string start = parameters["start"];
  22.             string platform = parameters["platform"];
  23.             string imageSize = parameters["imageSize"];
  24.  
  25.  
  26.  
  27.             //Check IP Restiriction
  28.             Restriction restiriction = new Restriction(ConfigurationManager.ConnectionStrings["AppSQLConnection"].ToString());
  29.             bool allowedCheck = restiriction.IsUserAllowed(userID);
  30.             if (!allowedCheck)
  31.             {
  32.                 dynamic json = new JsonObject();
  33.                 json.message = "Authorized Only for Mobinil in Egypt";
  34.                 var msg = new HttpResponseMessage(System.Net.HttpStatusCode.Forbidden);
  35.                 msg.Content = new StringContent(json.ToString());
  36.                 msg.Content.Headers.ContentType.MediaType = "application/json";
  37.                 throw new HttpResponseException(msg);
  38.             }
  39.             else
  40.             {
  41.  
  42.  
  43.  
  44.                 //Validate input data
  45.                 if (InputValidation.isValidUserid(userID) &&
  46.                     InputValidation.isValidCountryCode(countryCode) &&
  47.                     InputValidation.isValidLanguage(language) &&
  48.                     InputValidation.isValidCategory(categoryName) &&
  49.                     InputValidation.isValidUserid(subcategoryID) &&
  50.                     InputValidation.isValidPlatform(platform)
  51.                     )
  52.                 {
  53.                     if (!InputValidation.isValidImageSize(imageSize))
  54.                     {
  55.                         imageSize = "high";
  56.                     }
  57.  
  58.                     if (!InputValidation.isValidUserid(count) || !InputValidation.isValidUserid(start))
  59.                     {
  60.                         start = WebConfigurationManager.AppSettings["DefaultStart"];
  61.                         count = WebConfigurationManager.AppSettings["DefaultCount"];
  62.                     }
  63.  
  64.                     ContentOperations contentOperations = new ContentOperations();
  65.                     contentList = contentOperations.getContent(subcategoryID, categoryName, count, start, countryCode, userID, ConfigurationManager.ConnectionStrings["AppSQLConnection"].ToString(), WebConfigurationManager.AppSettings["FileFolderName"], imageSize, language, platform);
  66.                     if (contentList != null)
  67.                     {
  68.                         List<ME_API_V1.Models.Content> contentOutputList = new List<ME_API_V1.Models.Content>();
  69.                         foreach (ZMSLibrary.ME.Models.Content c in contentList)
  70.                         {
  71.                             File tempFile = new File();
  72.                             ME_API_V1.Models.Content cTemp = new ME_API_V1.Models.Content();
  73.                             cTemp.contentID = int.Parse(c.ContentID);
  74.                             if (c.Rating == "1")
  75.                                 cTemp.userRating = "Like";
  76.                             else if (c.Rating == "0")
  77.                                 cTemp.userRating = "Dislike";
  78.  
  79.                             cTemp.date = String.Format("{0:G}", c.ContentDate);
  80.  
  81.                             //if (c.Provider.ContentProviderName != "")  //to make the value null instead of ""
  82.                             cTemp.providerName = c.Provider.ContentProviderName;
  83.                             //if (c.Provider.ContentProviderIcon != "")
  84.                             cTemp.providerIconURL = c.Provider.ContentProviderIcon;
  85.                             //if (c.Provider.ContentProviderImage != "")
  86.                             cTemp.providerImageURL = c.Provider.ContentProviderImage;
  87.  
  88.                             if (language == "AR")
  89.                             {
  90.                                 //if (c.ContentArabicTitle != "")
  91.                                 cTemp.title = c.ContentArabicTitle;
  92.                                 //if (c.ContentArabicSubTitle != "")
  93.                                 cTemp.subtitle = c.ContentArabicSubTitle;
  94.                                 //if (c.ContentArabicDescription != "")
  95.                                 cTemp.description = c.ContentArabicDescription;
  96.                             }
  97.                             else
  98.                             {
  99.                                 //if (c.ContentEnglishTitle != "")
  100.                                 cTemp.title = c.ContentEnglishTitle;
  101.                                 //if (c.ContentEnglishSubTitle != "")
  102.                                 cTemp.subtitle = c.ContentEnglishSubTitle;
  103.                                 //if (c.ContentEnglishDescription != "")
  104.                                 cTemp.description = c.ContentEnglishDescription;
  105.                             }
  106.  
  107.                             if (categoryName == "Music")
  108.                             {
  109.                                 foreach (ContentFile cf in c.ContentFiles)
  110.                                 {
  111.                                     if (cf.FileType.FileTypeName == "Icon")
  112.                                         tempFile.iconURL = cf.ContentFileName;
  113.                                     else if (cf.FileType.FileTypeName == "Image")
  114.                                         tempFile.imageURL = cf.ContentFileName;
  115.                                     else if (cf.FileType.FileTypeName == "Clip_High")
  116.                                         tempFile.highVideoURL = cf.ContentFileName;
  117.                                     else if (cf.FileType.FileTypeName == "Clip_Low")
  118.                                         tempFile.lowVideoURL = cf.ContentFileName;
  119.                                     else if (cf.FileType.FileTypeName == "Tone")
  120.                                         tempFile.toneURL = cf.ContentFileName;
  121.                                     else if (cf.FileType.FileTypeName == "Song")
  122.                                         tempFile.songURL = cf.ContentFileName;
  123.                                     else if (cf.FileType.FileTypeName == "YouTube")
  124.                                         tempFile.youtubeID = cf.ContentFileName;
  125.  
  126.                                 }
  127.  
  128.                             }
  129.                             else if (categoryName == "News")
  130.                             {
  131.                                 foreach (ContentFile cf in c.ContentFiles)
  132.                                 {
  133.                                     if (cf.FileType.FileTypeName == "Icon")
  134.                                         tempFile.iconURL = cf.ContentFileName;
  135.                                     else if (cf.FileType.FileTypeName == "Image")
  136.                                         tempFile.imageURL = cf.ContentFileName;
  137.  
  138.                                 }
  139.  
  140.                             }
  141.                             else if (categoryName == "Videos")
  142.                             {
  143.                                 foreach (ContentFile cf in c.ContentFiles)
  144.                                 {
  145.                                     if (cf.FileType.FileTypeName == "Icon")
  146.                                         tempFile.iconURL = cf.ContentFileName;
  147.                                     else if (cf.FileType.FileTypeName == "Image")
  148.                                         tempFile.imageURL = cf.ContentFileName;
  149.                                     else if (cf.FileType.FileTypeName == "Video_High")
  150.                                         tempFile.highVideoURL = cf.ContentFileName;
  151.                                     else if (cf.FileType.FileTypeName == "Video_Low")
  152.                                         tempFile.lowVideoURL = cf.ContentFileName;
  153.                                     else if (cf.FileType.FileTypeName == "YouTube")
  154.                                         tempFile.youtubeID = cf.ContentFileName;
  155.  
  156.                                 }
  157.  
  158.                             }
  159.                             else if (categoryName == "Applications")
  160.                             {
  161.                                 foreach (ContentFile cf in c.ContentFiles)
  162.                                 {
  163.                                     if (cf.FileType.FileTypeName == "Icon")
  164.                                         tempFile.iconURL = cf.ContentFileName;
  165.                                     else if (cf.FileType.FileTypeName == "Image")
  166.                                         tempFile.imageURL = cf.ContentFileName;
  167.                                     else if (cf.FileType.FileTypeName == "App_Android" || cf.FileType.FileTypeName == "App_Nokia" || cf.FileType.FileTypeName == "App_Blackberry" || cf.FileType.FileTypeName == "App_iPhone")
  168.                                     {                                           
  169.                                             tempFile.appURL = cf.ContentFileName;                                               
  170.                                     }
  171.  
  172.                                 }
  173.  
  174.                             }
  175.  
  176.                             cTemp.files = tempFile;
  177.                             contentOutputList.Add(cTemp);
  178.                         }
  179.                         return contentOutputList;
  180.  
  181.                     }
  182.  
  183.                 }
  184.  
  185.                 if (contentList == null)
  186.                     throw new Exception();
  187.                 else
  188.                 {
  189.                     json.message = "Wrong or missing data";
  190.                     var msg = new HttpResponseMessage(System.Net.HttpStatusCode.BadRequest);
  191.                     msg.Content = new StringContent(json.ToString());
  192.                     msg.Content.Headers.ContentType.MediaType = "application/json";
  193.                     throw new HttpResponseException(msg);
  194.                 }
  195.             }
  196.  
  197.  
  198.  
  199.  
  200.         }       
  201.         catch (Exception ex)
  202.         {
  203.             if (ex is HttpResponseException)
  204.             {
  205.                 throw;
  206.             }
  207.             else
  208.             {
  209.                 json.message = "Error in System";
  210.                 var msg = new HttpResponseMessage(System.Net.HttpStatusCode.InternalServerError);
  211.                 msg.Content = new StringContent(json.ToString());
  212.                 msg.Content.Headers.ContentType.MediaType = "application/json";
  213.                 throw new HttpResponseException(msg);
  214.             }
  215.         }
  216.  
  217.     }
  218. }
  219.  
Jun 14 '12 #1
1 4897
Frinavale
9,735 Expert Mod 8TB
The exception is occurring in your application.
I looked it up since I've never seen an AggregateException before and discovered that it is used extensively in the Task Parallel Library and Parallel LINQ (PLINQ).

MSDN documentation on the exception suggests that you read these articles to handle these exceptions:Since I don't see you using Parallel coding in the code that you posted, I recommend that you check out your models.

-Frinny
Jun 14 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Bill | last post by:
I used to be able to run the following ASP code on our corp machine (W2K Server Edition and IIS-5) and successfully send a net-msg to anyone on our intranet. Last week it stopped working... and...
4
by: Dag Sunde | last post by:
I've been working on a system that have been running for the last couple of years, but stopped working on my dev. machine after reinstalling WinXP yesterday. To my knowledge, it have been set up...
2
by: Dag Sunde | last post by:
I have the following code fragment in one of my pages: if (typeof document.getElementById('myApplet').getTableAsSDV != 'undefined') { rowBuffer =...
6
by: Susan Bricker | last post by:
Hi. Does anyone have a clue why my mouse wheel stopped working while I was working on the VB behind a form in MS/Access? I would swear that the mouse wheel was working a short time ago. I've...
4
by: vzaffiro | last post by:
Our Development Server (windows 2003, framework 1.1) was working great for months, then one day all the client side validators stopped working. Only the server side validation is working. Our code...
0
by: Oenone | last post by:
My VS2005 Edit and Continue function appears to have stopped working in my VB project. It definitely was working, but now when I run my project (a WinForms project) and break into it, I am...
4
by: JohnB111 | last post by:
Hi Environment: Windows XPPRO SP2 IIS 5.1 AVG Anti Virus (Not script Blocking) The following code used to work perfectly on my local development machine and still does on my web server.
3
by: Just D. | last post by:
All, Did anybody see this bug? We're having two login pages in a huge application, both are with validation controls. Everything works just great on two developer's machines working under...
2
by: Rico | last post by:
Hello, I have an ASP.net application, it's a third party forum software running on an SQL Server back end. This application was working fine with no issues. Then yesterday, without being...
1
by: rickcasey | last post by:
I wonder if anyone has experienced something like this, as it seems truly bizarre and is causing me to tear out my hair (what little there is left of it).... The exec() function just suddenly...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.