We are seeing a very strange problem with an ASP.NET application that was recently upgraded to NHibernate 3.10GA, Castle 2.5.2, and using Castle.Facilities.NHibernateIntegration. We are using ISessionManager from NHibernateIntegration with the Web.SessionWebModule component to manage our request response loop, and have it configured with isWeb=true.
Our application returns a page for a url encoded parameter, and this page also subsequently makes some web-service calls.
The problem happens very intermittently, and manifests itself as a NHibernate.LazyInitializationException - Could not initialize proxy - no Session error, caused by the lazy-loading of a many-to-one relationship from the main object. This would suggest that the session object is being lost while in the request-response loop for the page.
We decided to debug the OnBeginRequest and OnEndRequest methods in Castle.Facilities.NHibernation, and added some debugging statements to identify the thread. What we found is the following:
In the cases where there is an error, the threadId in the OnBeginRequest does not match the threadId in the OnEndRequest; and further it appears that the original thread is being used for other requests and responses. When the initial page request is finally returned it's threadid doesn't match the original threadid it was started in. Has anyone seen anything like this?
Here's the debug data. Note the [9] indicates the originating thread according to log4net
[9] DEBUG SessionWebModule - On begin request thread id: 9 for MyPage.aspx
[9] DEBUG SessionWebModule - On begin request thread id: 9 for example.ashx
[9] DEBUG SessionWebModule - On end request thread id: 9 example.ashx
[9] DEBUG SessionWebModule - On begin request thread id: 9 for WebService.asmx/js
[9] DEBUG SessionWebModule - On end request thread id: 9 for WebService.asmx/js
[6] ERROR NHibernate.LazyInitializationException - [error message describing relationship] -Could not initialize proxy - no Session.
[6] DEBUG SessionWebModule - On end request thread id: 9 for MyPage.aspx
Note the first and last line showing that the page request originated in thread 9, but returned in thread 6.
I beleive you are on IIS 7 and asp.net 2.0 ?
If yes , please try to set MaxConcurrentRequestsPerCPU
http://blogs.msdn.com/b/tmarq/archive/2007/07/21/asp-net-thread-usage-on-iis-7-0-and-6-0.aspx
Related
I have installed the API Mgr 1.7.0 in Win 7 64. I have been through the Quick Start guide and all appeared to work as described. However, when I get to the point of trying the subscribed-to cdyne api, the 'moving dots' graphic stays there forever. I can't find a way to stop it, other than a browser refresh. I can't see an entry in the API Mgr system logs.
I have removed the parameters and the auth info, which is supposed to return a 401, but it doesn't and the moving dots continue. I'm using Firefox 31, with AdBlock+ and Noscript. There are no blocked scripts as far as I can see.
[edit 1] I get the same problem with the first sample (YouTube). I wonder if the problem is caused by port values? As I have the ESB installed, I increased all the ports for API Mgr by 1. Maybe I missed one, or there is one that hasn't been documented.[/edit 1]
[edit 2] I have reinstalled the API Mgr. I stopped the ESB and left the APIM ports as default. I have recreated the Phone Verify service and I still have same problem with 'Try it now'. I set the global log level to DEBUG, but there is too much detail to be of use. I don't know what package names to set for this problem.
There was an entry in the Application Logs as follows, which might be relevant. The first few lines are shown:
System Error Occurred
Exception occurred while trying to invoke service method getApplicationNames
The following error details are available. Please refer logs for more details.
org.apache.axis2.AxisFault: Exception occurred while trying to invoke service method getApplicationNames
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:445)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.wso2.carbon.logging.view.stub.LogViewerStub.getApplicationNames(LogViewerStub.java:3700)
at org.wso2.carbon.logging.view.ui.LogViewerClient.getApplicationNames(LogViewerClient.java:165)
[/edit 2]
Regards, John
You may not have configured CORS. CORS is cross-origin resource sharing [1] and it is used by the try-it feature in the store.
The CORS configuration is stored in [API Manager Home]/reposotiry/conf/api-manager.xml . The header must include the Host name used by the CORS request. The host name being used by the try-it service is shown in gray at the bottom-left hand corner of the API-Console / try-it screen. It should show up as 'base url'. For example: [ base url: http://10.212.0.846.:8281 , api version: 1.0 ]
You may also be having trouble with the default APIs - please make sure that the APIs in [API Manager Home]/repository/deployment/server/synapse-configs/default/api/ are updated with your port offset. This may be preventing basic authentication. It is documented here [2]
Hope that helps.
-Colin
[1] http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
[2] https://docs.wso2.com/display/AM170/Changing+the+Default+Ports+with+Offset
We are getting the following error on our web server. We are also observing a strange problem leading to a virtual shuttpown to our asp.net web application. It does not crash. It simply stops processing requests. this happen regardless of the load of the server. It happens periodically, sometime every 90 minutes or 2 hours. Sometime also when no one is logged on.
We are caching certain data in memory to minimize database round trips . Could this happen when the cache expires and need to be reloaded due to something not configured properly?
Event code: 4010
Event message: An unhandled security exception has occurred.
Event time: 21/05/2014 08:57:36
Event time (UTC): 21/05/2014 06:57:36
Event ID: 9106022293a944059cd7a35dbdc48024
Event sequence: 262
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/3/ROOT-1-130451258156698671
Trust level: Full
Application Virtual Path: /
Application Path: D:\FolderXXX\
Machine name: MachineXXXX
Process information:
Process ID: 6664
Process name: w3wp.exe
Account name: UserXXX
Request information:
Request URL:
Request path:
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: UserXXX
Custom event details:
Yes, it could happen when the cache expires and needs to be reloaded again and the account has no rights. Either check how you reload cache and if account has rights or enable tracing for more information.
Read about similar issue at http://forums.asp.net/t/1629856.aspx
How to: Enable Tracing for an ASP.NET Application
I am using reCaptch in my MVC 3 web app running in the localhost.
Things were working fine few weeks back but suddenly failing.
Suddenly getting this error.
if(!ReCaptcha.Validate(_config.RecaptchaPrivateKey)){ <-- times out here
//process other fields in the form
}
As soon as I fill the form and hot submit I get this error :
The operation has timed out
Description : An unhandled exception occurred during the execution of the current ...
Exception Details : System.Net.WebException: The operation has timed out
Is this a proxy issue?
Is this because my site on localhost runs on port 3316?
localhost:3316/user/signup
I saw some posts that suggests that reCAPTCHA expects port 80 but my app runs on port 3316
What can be the issue?
Thanks
I got around this by creating proxy class that inherits IWebProxy.
Then specifying to use this proxy when internal, I had to transform it out for other environments that didn't need to use it.
See this question and accepted answer:
Is it possible to specify proxy credentials in your web.config?
The above link took some finding, so I favourited it for future use.
We're seeing lots of events like these even though we have authentication set to "None":
Event code: 4005
Event message: Forms authentication failed for the request. Reason: The ticket supplied was invalid.
Event time: 12/3/2013 12:50:06 PM
Event time (UTC): 12/3/2013 6:50:06 PM
Event ID: 9a0cc0c93a964b1c9bd7126dc367b09b
Event sequence: 163807
Event occurrence: 23853
Event detail code: 50201
Application information:
Application domain: /LM/W3SVC/1/ROOT/BG-4-130305700816025855
Trust level: Full
Application Virtual Path: /BG
Application Path: D:\inetpub\wwwroot\BG\
Machine name: ***
I even double-checked in IIS Manager at the site and server level and the GUI shows Forms Authentication set to Disabled.
This is using asp.net 4.0 running on Server 2008 R2. I tried adding a machineKey to machine.config just to test but it still fails. It doesn't seem like all requests are failing since I only see the error once a minute but I can't isolate which ones are failing. I even tried using Fiddler to send a bogus .ASPXAUTH cookie but I didn't see any new errors in the event log that match up with my request.
Anyone have any ideas?
Thanks,
tim
My website is running on Asp.net v4 , IIS 7 , Windows server 2008.
My cpu is running on 20-30% and the site is responding quickly.
Every 2-5 mins I'm receiving the following error:
Event code: 3001
Event message: The request has been aborted.
Exception type: HttpException
Exception message: Request timed out. ,
Request information:
Request URL: http://www.xxxx.com/Services/AxRefresh.asmx/AxUpdate
Request path: /Services/AxRefresh.asmx/AxUpdate
User host address: 84.110.251.198
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
i read that the error is related to the maximum concurrent requests limit
http://support.microsoft.com/kb/821268
but then i found out that on IIS 7 this limitation is changed and not relevant.
http://msdn.microsoft.com/en-us/library/dd560842(VS.100).aspx
Any other ideas what can be the problem or where to start looking ?
update:
found another link saying that all the below parameters:
maxWorkerThreads
minWorkerThreads
maxIoThreads
minFreeThreads
minLocalRequestFreeThreads
maxconnection
executionTimeout
are NOT relevant for IIS7+Asp.NET 4
here is the link
http://learn.iis.net/page.aspx/381/aspnet-20-breaking-changes-on-iis-70
**I still get the 100's errors daily on my iis7 **
The second link you found has no relationship with the first one, so you still need to apply the changes in the first article and see if it helps.