OpenRasta IIS6 Intermittent HTTP 404 - iis-6

Background
I have an API built with OpenRasta that serves JSON-encoded data to an HTML/AJAX enabled interface.
Problem
When hosted with IIS 6, I'm experiencing intermittent 404 errors when a resource is queried. Everything works well after an application pool restart; after a few successful requests the 404 errors start and persist until the app pool is recycled. I have confirmed ISAPI mapping is set in IIS 6, what am I missing?
Trace output for intermittent failed request
Unregistering host of type OpenRasta.Hosting.AspNet.AspNetHost
Trace output for successful request for comparison (namespace and resource URIs redacted)
Registering host of type OpenRasta.Hosting.AspNet.AspNetHost
Using dependency resolver of type OpenRasta.DI.InternalDependencyResolver.
Registering host's root dependencies..
Using dependency registrar of type OpenRasta.Configuration.DefaultDependencyRegistrar..
Ignoring constructor, following dependencies didn't have a registration:OpenRasta.TypeSystem.Surrogates.ISurrogateBuilder[].
Registering host's leaf dependencies..
Using configuration source <namespace>.api.Configuration.
Ignoring constructor, following dependencies didn't have a registration:System.Func`1[System.Collections.Generic.IEnumerable`1[OpenRasta.Configuration.MetaModel.Handlers.IMetaModelHandler]].
Ignoring constructor, following dependencies didn't have a registration:System.Diagnostics.TraceSource.
Ignoring constructor, following dependencies didn't have a registration:OpenRasta.OperationModel.MethodBased.IMethodFilter[].
Incoming host request for http://<resource URI>.
Adding communication context data.
Entering OpenRastaRewriterHandler: Rewriting to original path.
Entering OpenRastaIntegratedHandler: Request for http://<resource URI>.
Incoming host request for http://<resource URI>.
Adding communication context data.
Found 1 operation(s) with a matching name..
Found 0 operation(s) with matching [HttpOperation] attribute..
Operation <handler>::Get() selected with 0 required members and 0 optional members, without request codec.
Ignoring constructor, following dependencies didn't have a registration:OpenRasta.OperationModel.Interceptors.IOperationInterceptor[].
Executing OperationResult OperationResult: type=OK, statusCode=200..
Selected codec JsonDataContractCodec out of 1 codecs for entity of type List`1 and negotiated media type application/json; q=0.5..
Codec JsonDataContractCodec selected..
Entering ResponseEntityWriterContributor: Generating response entity..
Setting Content-Length to 133.
Exiting ResponseEntityWriterContributor.
Writing http headers..
Exiting OpenRastaIntegratedHandler.
Exiting OpenRastaRewriterHandler.
Request finished..
OpenRasta.Hosting.AspNet.dll built from GitHub master:

Related

Reverse proxy support in Quarkus

I have Embedded Jetty running which has reverse proxy servlet mapped for a particular URL. For ex: http://url1/abc is reverse proxied to http://url2. This works great, whenever someone calls http://url1/abc, data is served from http://url2.
I want to achieve the same using quarkus. Is this possible to do it in Quarkus? I think one of the option is to write own code in ContainerRequestFilter but I am looking more for OOTB support just like jetty. Can somehow undertow be leveraged here?
Please help.
UPDATE 1
I tried to do it through undertow-handlers.conf (placing it in META-INF folder). It worked well for redirect and rewrite but throwing error for reverse-proxy:
path-prefix('/a') -> redirect('/b)
path-prefix('/a1') -> rewrite('/b1')
path-prefix('/a2') -> reverse-proxy('http://localhost:7100/b')
If I have first two only, quarkus is started successfully and requests are served correctly. If I started using third one, quarkus start gets failed with below error.
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: UT000045: Error parsing predicated handler string no handler named reverse-proxy known handlers are [disallowed-methods, allowed-methods, jdbc-access-log, secure-cookie, access-log, mark-secure, response-rate-limit, canonical-path, response-code, disable-cache, ssl-headers, trace, blocking, url-decoding, access-control, redirect, set, ip-access-control, request-limit, resource, restart, clear, byte-range, done, rewrite, forwarded, stuck-thread-detector, jvm-route, learning-push, dump-request, proxy-peer-address, resolve-local-name, header, store-response, path-separator, resolve-peer-name]:
Although, I see undertow has reverse-proxy handler, not sure why it is not working for me.
http://undertow.io/undertow-docs/undertow-docs-2.0.0/index.html#predicates-attributes-and-handlers
I think the main issue is of dependency here. I see io\undertow\server\handlers package in my app libs but not io\undertow\server\handlers\proxy where I think the reverse proxy code is present.
How can I pull this dependency in my app?

ADLS Gen 2 Storage API - Refusing Http Verbs

I'm having a problem with some endpoints within the ADLS Gen 2 API Path operations.
I can create, list, get properties of, and delete file systems just fine.
However, after adding a directory to a file system, certain verbs are failing - HEAD, GET, and DELETE.
For example, I have created a filesystem named c79b0781, with a directory path of abc/def
Call failed with status code 400 (The HTTP verb specified is invalid - it is not recognized by the server.): DELETE https://myadls.dfs.core.windows.net/c79b0781/abc?recursive=true&timeout=30
For headers, I have:
x-ms-version: 2018-11-09
I can delete the filesystem from the Azure Storage Explorer, but the API is refusing my query.
The List action is also failing with a similar error
Call failed with status code 400 (The HTTP verb specified is invalid - it is not recognized by the server.): GET https://myadls.dfs.core.windows.net/c79b0781?resource=filesystem&recursive=false&timeout=30
With headers:
x-ms-version: 2018-11-09
And finally, my Get Properties is also failing
Call failed with status code 400 (The HTTP verb specified is invalid - it is not recognized by the server.): HEAD https://myadls.dfs.core.windows.net/c79b0781?resource=filesystem&timeout=30
It seems to only happen when I add directories to the file system.
A bit more in depth:
This Test works
PUT https://myadls.dfs.core.windows.net/c79b0781?resource=filesystem
GET https://myadls.dfs.core.windows.net/c79b0781?recursive=false&resource=filesystem
DELETE https://myadls.dfs.core.windows.net/c79b0781?resource=filesystem
My second Test with directory creation
PUT https://myadls.dfs.core.windows.net/c79b0781?resource=filesystem
PUT https://myadls.dfs.core.windows.net/c79b0781/abc/123?resource=directory
After this point, the calls begin rejecting HTTP verbs
GET https://myadls.dfs.core.windows.net/c79b0781?recursive=false&resource=filesystem
Examining my directory create request closer, it looks like this:
PUT https://myadls.dfs.core.windows.net/c79b0781/abc/123?resource=directory
With Headers:
Authorization: [omitted]
Content-Length: 0
And I can see the folders in Storage explorer, I just cannot act on them after this point.
Test Case 2
I have started down a path wondering if it is permissions. So, I created a new File System through the Azure Storage Explorer with abc/def folder structure within.
Test 1 (passing)
Get List for directory "abc"
Get List for directory "abc/def"
Test 2 (failing)
Create Directory "uvw/xyz"
Get List for directory "abc" Fails here
Get List for directory "abc/def"
Get List for directory "uvw/xyz"
Once I create a directory through the api, it is as if the entire filesystem begins rejecting all HTTP requests.
This bug ended up leading me down a rabbit hole into my Flurl implementation that I am using for performing rest requests.
The Put method had no body and was calling PutJsonAsync where according to the spec, it expects the content type to be application/octet-stream with content length 0.
I replaced the call to PutJsonAsync to PutAsync and everything magically started working.
So, there seems to be some bug within Flurl itself that caused this issue, due to my misuse in my wrapper code.

HTTP Error 500.19 config file path does not exist

Error Summary
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070003
Config Error Cannot read configuration file
Config File \?\D:\Company\ABC\web.config
Requested URL http://localhost:80/services/application/cardmanagement
Physical Path D:\ABC\DEF\Website.Hosts
Logon Method Not yet determined
Logon User Not yet determined
Config Source
-1:
0:
I am getting this strange error when I try to browse the service. Problem is Physical path is correct but config path is even does not exist in my machine where all applications and iis installed. So I am surprised from where its taking that path and how to correct it.

HTTP Error 404.0 - Not Found when accesing SVC service

I have REST service application which is hosted in an IIS 8 in a Windows 8 PC. When I request the service I am getting an error as follows ... HTTP Error 404.0 - Not Found.
Here is the detailed error message.
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Most likely causes:
•The directory or file specified does not exist on the Web server.
•The URL contains a typographical error.
•A custom filter or module, such as URLScan, restricts access to the file.
Things you can try:
•Create the content on the Web server.
•Review the browser URL.
•Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click here.
Detailed Error Information:
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://IP.com/Wining/RService.svc/general
Physical Path C:\inetpub\wwwroot\Wining\RService.svc\general
Logon Method Anonymous
Logon User Anonymous
Any help on this would be greatly appreciated.
There are myriads of possible causes. In general, the target resource at given URL is not found, so it may be simply missing, misconfigured, not started, etc. First - check the server logs, they usually contain more detailed information about the issue.
Also, please doublecheck that the service really is up and running. Connect to the www server and check it via localhost not ip.com.
I'm not an expert, but judging from the snippet you provided, it seems to be WCF service, the Handler: StaticFile seems very odd. It seems like the IIS misinterpretes your request as a StaticFile (a resource read from the disks and just passed-through without any further processing) which for me seems perfectly wrong.
You may have not installed the service properly, or have url mappings and/or handlers messed up, or you may even have NET/ASP framework not properly installed.. What have you installed first? .Net or IIS?
check similar questios, there are many.. for example:
WCF on IIS8; *.svc handler mapping doesn't work
HTTP 404 when accessing .svc file in IIS
I had to enable HTTP Activation in .NET Framework 4.5 Advanced Services > WCF Services (running on WIndows 2012) and after an IISReset it worked fine.

Response 400 (bad request) when invoking WCF service with other user than Administrator

I have a simple WCF service (hosted in Server01) which I've been using with no problems. After installing in this particular server (lets call it ClientServer01), I started to get the response 400.
So we have the following two cenarios.
Call WCF service from ClientServer01 from myApp.exe running as Administrator - Works
Call WCF service from ClientServer01 from myApp.exe running as CustomUser - Crashes
Aditional data:
ClientServer01 uses a proxy that is inside it's network to communicate
I'm able to ping Server01 from ClientServer01 using cmd running as Administrator and CustomUser both
Already tried setting expect100Continue="false" as described here
I've made MyApp.exe to isolate the problem and for debugging purposes, the real application is an IIS website in ClientServer01
The service is not a big deal. Pretty basic unsecured WCF service with BasicHttpBinding
Before asking, I tried to analyse the request with fiddler, it worked, because the component that was really making the request was fiddler. Today I tried it again, but running fiddler as mycustom user here is the output:
ERROR
The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL:
/MyServiceAppName/MyServiceName.svc
Invalid URL
Some aspect of the requested URL is incorrect.
Some possible problems are:
• Missing or incorrect access protocol (should be “http://” or similar)
• Missing hostname
• Illegal double-escape in the URL-Path
• Illegal character in hostname; underscores are not allowed.
Your cache administrator is webmaster.
Generated Mon, 27 May 2013 13:58:09 GMT by fw3.companyhostname.com.br
(squid/3.1.11)
Am I missing some server, proxy or WCF configuration that would allow CustomUser to make an http request thought port 80 to a basic WebService?
Thanks
CustomUser's proxy was not configured. So UseDefaultWebProxy would refer to an invalid proxy.
There are some solutions to this kind of problem
Set target user proxy settings (the most appropriate IMO)
Set binding ProxyAddress property
Set default app proxy in .config file tag configuration/system.net/defaultProxy/proxy <proxy proxyaddress="http://ip:port" />