Why do multiple requests to ServiceStack http handlers fail? - servicestack

I've verified this behavior with multiple projects, including the Windows Service AppHost Starter Template example project (unmodified). Initial requests succeed and display the default TODO page, but subsequent requests never complete.
It's simple to reproduce this scenario. Just perform the first request to http://localhost:83. You'll see the default TODO page render fine. Now hit "refresh" in the browser and you should now see the request never come through. If running in debug mode through VS, you'll see ObjectDisposedExceptions in the Output window.
Is there a problem with the latest ServiceStack codebase?

There was an issue in the response stream not being closed properly.
Should now be fixed in the latest version. Can you try again with the latest version v3.07, either on:
https://github.com/ServiceStack/ServiceStack.Examples/downloads
https://github.com/ServiceStack/ServiceStack/downloads
or 'ServiceStack' on NuGet.

Related

Some API's are failing with TestCafe framework due to which data is not rendering on UI

I am using testcafe with typescript to automate the CRM application .At one point when i click on a button it is redirecting me to a new page where we have multiple API calls which renders data on UI .One API is failing everytime with automation whereas it is passing with manual.I connected with one of the developer and he confirm that data is being returned via the AJAX call. However the TestCafe test-framework proxy called hammerhead.js is throwing an exception with the message :
ERR_EMPTY_RESPONSE. I have tried everything i.e timeout , ajax timeout , hard wait but didn't get anything fruitful.
Network response
Data is not populating underUpdates from portal whereas it is working fine with rest other section as mentioned in picture

OpenProject webhooks not fired

I'm trying to use the OpenProject's webhook to send workpackage's data to a third-party system, but it isn't even fired.
I did all my tests using this OP docker container from version 7.4.0 to 7.4.7 but none of them worked. In all of these images, the webhook is included and configured, then theoretically any additional setting isn't needed (except the webhook register in the web interface).
The passenger and the worker:jobs are running. There isn't clue in the log files. The webhook is enabled and set to trigger a http POST call in a localhost address.
Did anyone pass through a similar issue? I'm not a Ruby developer, and I wonder if some kind of daemon or service start is missing.
Our team figured out how to make the webhooks works. It's only needed check the Work package added and Work package updated options in the Email notifications group on System settings of the instance.
This is a undocumented setting, and I see it as a feature issue.
Nevertheless, it's working.

Application Insights does not log successful requests

I have added Azure Application Insights to a number of my .Net WebAPI applications. I've noticed that I do not receive successful request telemetry from these applications. I do receive dependency telemetry and failed requests but not the actual telemetry that the request has been made. By fudging the URL or the request and forcing a failure, I can see that get sent to AI, so my issue is definitely not with the instrumentation key.
I initialize the instrumentation key as follows:
Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey =
ConfigurationManager.AppSettings["ApplicationInsightsKey"];
I have attempted to remove AI from the application entirely and added it again using the Configure Application Insights option but it still does not work. There is another of my web apps that uses AI that was configured a while back and it works perfectly, I have replaced the set up of the broken app with that of the working app and also made the package versions line up but I still only get telemetry for failed requests. The capture below from the Live Stream shows this, the red arrow points to the dependency calls made for the successful request, yet nothing shows in the Request Rate graph for it. In contrast there is a failure before it, and that is logged.
I just found the answer for this in a solved issue on the Application Insights Github. The solution is to open your ApplicationInsights.config and scroll to the telemetry module Microsoft.ApplicationInsights.Web.RequestTrackingTelemetryModule below it comment out the line System.Web.Handlers.TransferRequestHandler
This issue has been fixed and is due to go out in version 2.5 of the packages. You can read through the issue here https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/175
Try below one, it works for me:
Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration configuration = Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.CreateDefault();
configuration.InstrumentationKey = System.Web.Configuration.WebConfigurationManager.AppSettings["InstrumentationKey"];

OWin post to localhost fails unless Fiddler is running

I have a self-hosted OWIN application that embeds a System.Windows.Controls.WebBrowser control in a WPF view. This browser connects to a specific site which then communicates to my application via POSTs to 127.0.0.1:8002. The architecture is not under my control so not open to change.
The site is loaded happily and runs fine. The localhost communications only works if I have Fiddler running. If I take out Fiddler, I get an error.
I can do the post directly to the application using PostMan without Fiddler - no problems here.
I'm guessing normally everything is in-process and causing problems but Fiddler forces it to be out-of-process and invokes some marshaling magic that fixes the problem. Just a guess. I've tried running the OWIN service in a different thread; didn't help.
I've seen a similar (working) sample application, but it used Awesomium running in a separate process. This is not an option, we must run a specific version of IE.
Any thoughts on how to get OWIN to talk to the browser control?
The problem was solved by initialising OWIN with a wider range of URLs. Initially, I was just doing this:
StartOptions options = new StartOptions();
options.Urls.Add(String.Format("http://localhost:{0}", port));
WebApp.Start<ServiceStartup>(options);
When I added further URLs, the problem goes away. I'm guessing that Fiddler is changing the URLs on the way through.
StartOptions options = new StartOptions();
options.Urls.Add(String.Format("http://localhost:{0}", port));
options.Urls.Add(String.Format("http://127.0.0.1:{0}", port));
options.Urls.Add(string.Format("http://{0}:{1}", Environment.MachineName, port));
WebApp.Start<ServiceStartup>(options);

QUnit and PhantomJS testing of AJAX requests only works through proxy

I'm attempting to use grunt-contrib-qunit to run a pre-existing suite of qunit tests (testing parsing of ajax request results) in headless mode with Phantom on Windows 8.
The tests complete fine in these scenarios:
When the remote page is accessed directly from any browser without Fiddler or another proxy running
When Phantom runs the tests from a command prompt with Fiddler open and running
Oddly if I don't have fiddler open monitoring the requests, the AJAX requests I'm testing never seem to initialize. I've checked my default IE LAN Settings and there is no proxy enabled, I've also tried flipping the Auto Detect Settings checkbox there and no change.
Any thoughts??
Details on my setup:
Node v0.10.4
Latest grunt-contrib-qunit
Windows 8
QUnit is divided into 4 or 5 modules with setup and teardown tasks in some modules, asynchronous and synchronous tests, and autorun is set to false.
Update:
If I turn off the options in Fiddler for "Reuse client connections" and "Reuse connections to servers" I seem to get the same failure behavior as when Fiddler is off. This led me to believe its a problem with connections being closed prematurely, so I tried setting a custom keep-alive header -- but it still errors out.
Update 2:
I still question this because the page itself loads fine, but the requests fail, but it looks like this could possibly be related to NTLM authentication. Fiddler might somehow facilitating the handshake. There is an open issue for NTLM on the Phantom github page.
Update 3:
After continued troubleshooting this evening it looks like the issue is only with authentication on POST requests. GET requests seem to work fine. I'm working around this for now by routing all requests through an ASHX handler and thus dropping the auth component. Only thing I had to change was to disable web security on phantom to allow the cross-domain requests through.
I was going to say you need to turn off security, which is done by passing --web-security=no to phantomjs. This will sort out the CORS issues. However I see in your Update#2 that you've already discovered this.
For the POST authentication problem, I blogged about the workaround here:
http://darrendev.blogspot.jp/2013/04/phantomjs-post-auth-and-timeouts.html
I've heard the most recent version has fixed this, so upgrading might be the actual answer?
BTW, be careful with auth in PhantomJS, as the auth details are sent on all requests. E.g. if your test page fetches JQuery from a CDN, the CDN will be sent your authentication headers. (SlimerJS has some new features in place for getting around this; AFAIK PhantomJS does not yet.)

Resources