CSCGIDispatcher not routing received messages

CodeSite Dispatcher, CodeSite Viewers, CodeSite Controller

Re: CSCGIDispatcher not routing received messages

Postby BerndLinde » Thu Aug 21, 2014 3:42 am

Hi Ray

I checked the following properties and they are all true:
CodeSite.Enabled
CodeSiteManager.Enabled
CodeSite.Destination.HTTP.Active
CodeSiteManager.DefaultDestination.HTTP.Active

The CodeSite messages are being sent because I see them in Wireshark arriving at my IIS server and in the IIS logs.

Kind Regards
Bernd
BerndLinde
 
Posts: 13
Joined:
Tue Aug 12, 2014 9:16 am

Re: CSCGIDispatcher not routing received messages

Postby Raize Support » Thu Aug 21, 2014 12:08 pm

Hi Bernd,

Thank you for confirming those settings. This is very strange indeed because everything is working correctly on our test systems. Now that you have verified that the CodeSite messages are indeed getting sent, and that IIS is serving up the CGI/ISAPI content when invoked from a browser, the only thing that I can think of is that the CGI app and ISAPI dll do not have rights to open the INI file.

What version of IIS are you using? And what version of Windows?

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 603
Joined:
Fri Mar 25, 2011 9:04 pm

Re: CSCGIDispatcher not routing received messages

Postby BerndLinde » Fri Aug 22, 2014 2:49 am

Hi Ray,

I am running the IIS server under Windows 8.1 64bit and the version of IIS is 8.5.
I'll need to get it all running under IIS 8.5 since that will be our server environment that will be used in production if we implement this feature into our application (Windows Server 2012 R2 with IIS 8.5).

I checked the user rights for the folder and inherently for the two files (the DLL and INI) and the user "IUSR" has read, execute and write rights to the folder and files.
I did look for the IIS_IUSR user, but it seems that they changed that user from IIS_IUSR to IUSR in the latest versions.
Also, while using ProcMon, I didn't see any access denied entries, to the INI file, while the DLL is executed.

I setup the ISAPI DLL as the instructions/example here http://chee-yang.blogspot.de/2009/10/configure-windows-7-iis7-for-isapi-dll.html, modifying the steps as they differ between IIS 7 and IIS 8.5, up to the part of enabling 32bit applications to run.

Kind Regards
Bernd
BerndLinde
 
Posts: 13
Joined:
Tue Aug 12, 2014 9:16 am

Re: CSCGIDispatcher not routing received messages

Postby Raize Support » Mon Aug 25, 2014 12:54 am

Hi Bernd,

Thank you for the additional information. The most interesting is the fact you are running 64-bit IIS server. The test server that I used was a 32-bit server. The fact that the INI file is not being access on your system now sounds like a VirtualStore mapping situation. That is, Windows is redirecting access to the *.ini file from the directory containing the CSCgiDispatcher.exe file and/or CSIsapiDispatcher.dll to a VirtualStore directory. This would explain why the CGI and ISAPI modules do work correctly when you invoke them from a web browser. IIS is certainly able to serve up the content. A VirtualStore would also explain why the INI file is NOT being accessed. I am assuming that you are monitoring the INI file in the same directory. If the "real" INI file is being accessed in a virtual store, then your monitoring software would not get triggered.

As a result, there are a couple things I would like you to check. First, check to see if there are any folders/files located in the VirtualStore. Windows typically stores the VirtualStore in the user's AppData directory: For example, C:\Users\<user>\AppData\Local\VirtualStore
You may see a subdirectory for "Program Files (x86)" and for "ProgramData". I would be curious if there is one for "inetpub" or some other IIS related directory.

The other thing that I would like you to check, if possible, is to try running the CSDispatcher.exe on the same machine that is running IIS. The default behavior of the Dispatcher web modules (CGI and ISAPI) is to send the incoming CodeSite message to the CodeSite Dispatcher running on localhost using the default TCP port (3434). So, even if the INI file is not read in with "new" values, the default values should be being used. Note, you will need to manually start the CSDispatcher.exe. Once you do, try to send a message. Then send me the Dispatcher log.

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 603
Joined:
Fri Mar 25, 2011 9:04 pm

Re: CSCGIDispatcher not routing received messages

Postby BerndLinde » Mon Aug 25, 2014 2:30 am

Hi Ray

I have looked for additional folders/files under the VirtualStore directories I could find on the drive where the IIS server is and there is nothing related to IIS or CodeSite.
What I see is that IIS creates user profiles for the different application pools that one configures in IIS, but unfortunately there are also no CodeSite files in there (Currently I have an "DefaultAppPool" and "CGITest" folder under my "Users" folder, which corresponds to the AppPools I have on IIS)
I have also made Explorer show System protected files and folders, in case it was sneaky around there.

The monitoring software that I am using is ProcMon http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

I have been running the CSDispatcher.exe on the same machine as the IIS server. I am using my local machine as the IIS server and as the endpoint for all the calls, so the CSDispatcher and CSLiveViewer are running locally, with the sample application that is sending the messages running remotely (I have also tried running it locally also, same result).

There are unfortunately no additional entries to the CSDispatcher's log file when the messages arrive at the IIS server, only the normal start-up log entries.

Kind Regards
Bernd
BerndLinde
 
Posts: 13
Joined:
Tue Aug 12, 2014 9:16 am

Re: CSCGIDispatcher not routing received messages

Postby Raize Support » Mon Aug 25, 2014 2:52 am

Ok. That is actually all very useful.

Please confirm:

1. Switching back to using the CSCgiDispatcher.exe, invoking the exe from a web browser does still display the "CodeSite HTTP Dispatcher" heading.

2. You are using CodeSite 4 to build your test project that is sending the actual CodeSite message.


And do you have any monitoring in place that shows the request that is coming into IIS when the message is sent? If you do, I would like to see the request data. If not, I will probably have to create a modified version of the CSCgiDispatcher to do some logging of its own.

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 603
Joined:
Fri Mar 25, 2011 9:04 pm

Re: CSCGIDispatcher not routing received messages

Postby BerndLinde » Mon Aug 25, 2014 3:36 am

Hi Ray

To confirm:
1. Both the CGI and Isapi modules return the "CodeSite HTTP Dispatcher" headings when called from the web browser

2. I am using CodeSite Studio 4.6.2 to build my projects, both in DelphiXE and C#.

I am getting two HTTP requests messages incoming per logging message sent, the details below:

First request and it's corresponding response message
Code: Select all
POST /CST/CSCGIDispatcher.exe/connect?Alias=Default HTTP/1.0
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 47
Host: d022
Accept: text/html, */*
Accept-Encoding: CSIdEntity
User-Agent: Mozilla/3.0 (compatible; Indy Library)

{521B3ACD-6A46-4206-822A-88A389AC4008}&|&Viewer


Code: Select all
HTTP/1.1 200 OK
Content-Length: 97
Content-Type: text/html
Server: Microsoft-IIS/8.5
Content:
Date: Mon, 25 Aug 2014 08:22:46 GMT
Connection: keep-alive

<h2>CodeSite HTTP Dispatcher</h2><br><br><a href='http://www.raize.com/'>Raize Software, Inc.</a>


Second request and it's corresponding response message
Code: Select all
POST /CST/CSCGIDispatcher.exe/message?Alias=Default HTTP/1.0
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 367
Host: d022
Accept: text/html, */*
Accept-Encoding: CSIdEntity
User-Agent: Mozilla/3.0 (compatible; Indy Library)

2130706433&|&261&|&AAAAAKIpOgLuOAsAxP///w8AAAAAAAAAABcAADQ2NDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAezUyMUIzQUNELTZBNDYtNDIwNi04MjJBLTg4QTM4OUFDNDAwOH0AAAAAVkQwMzAAAAAAAAAAAAAAAENvZGVTaXRlQ2xpZW50AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVGVzdGluZyBtZXNzYWdlAAAA


Code: Select all
HTTP/1.1 200 OK
Content-Length: 97
Content-Type: text/html
Server: Microsoft-IIS/8.5
Content:
Date: Mon, 25 Aug 2014 08:22:46 GMT
Connection: keep-alive

<h2>CodeSite HTTP Dispatcher</h2><br><br><a href='http://www.raize.com/'>Raize Software, Inc.</a>


Kind Regards
Bernd
BerndLinde
 
Posts: 13
Joined:
Tue Aug 12, 2014 9:16 am

Re: CSCGIDispatcher not routing received messages

Postby Raize Support » Mon Aug 25, 2014 9:11 pm

Ok, I believe I have finally made some progress. I have another server that is 64-bit and is running IIS 7.5. It's not Win 8 with IIS 8.5, but this server is already configured and available. So, I started a new round of testing with it to see if it would lead to any solutions.

I created a new virtual directory to hold the CSCgiDispatcher.exe and started the Dispatcher on the same machine. I then create a simple test app:

Code: Select all
procedure TForm5.FormCreate(Sender: TObject);
var
  Dest: TCodeSiteDestination;
begin
  Dest := TCodeSiteDestination.Create( Self );

  Dest.HTTP.Active := True;
  Dest.HTTP.URL := 'http://hoth/cgi-bin/CSCgiDispatcher.exe';

  CodeSiteManager.DefaultDestination := Dest;
end;

procedure TForm5.Button1Click(Sender: TObject);
begin
  CodeSite.Send( 'Message via HTTP' );
end;


This test app was built and run from a different machine from the IIS server. I then ran the app and clicked the button. On the IIS server, the CodeSite Live Viewer was started and the "Message via HTTP" message showed up.

I then added a CSCgiDispatcher.ini file into the cgi-bin directory and it contained the following:
Code: Select all
[Default]
Host=Kamino
RemoteDestinationDetails=Viewer


Kamino is the name of the machine my test app is running on. I started the CodeSite Dispatcher on Kamino and then ran my test app and clicked the button. The CodeSite Live Viewer got started on Kamino and the message showed up in the viewer.

The key point in all of this is that I am using CodeSite 5. So, the next step was to repeat the same steps using CodeSite 4. Well, this is where it got interesting. I dug out a copy of 4.6.2 and rebuilt the test app using CS4. I then terminated the Dispatcher and Live Viewer on my dev machine and restarted the CS4 versions. I then went to the IIS server and terminated the Dispatcher and Live Viewer on that machine and restarted the CS4 versions. I also delete the CSCgiDispatcher.ini file to duplicate the original test.

I then went back to the dev machine (Kamino) and ran the CS4 version of the test app and clicked the button. Nothing showed up in the Live Viewer on the IIS Server. After a bit of digging around, I realized that I still had the CS5 version of the CSCgiDispatcher.exe in the cgi-bin directory. I then changed this to the CS4 version and ran the test again. The CodeSite message showed up in the Live Viewer on the IIS server.

I haven't tracked down the exact reason why the CS5 version of the CSCgiDispatcher does not handle CS4 messages properly, the regular CodeSite Dispatcher in CS5 does handle CS4 messages, but apparently this is not the case for the CSCgiDispatcher. By the way, the CSIsapiDispatcher is built using the same web module as the CGI version, so it suffers the same problem.

So, sending you the CS5 version of the CSCgiDispatcher was a big mistake on my part, and I apologize for that. I needed to use this version because I was using CodeSite 5. This is most certainly contributing to the issues you are running into. So the first step is to switch back to using the CS4 version of the CSCgiDispatcher.

I would also highly recommend upgrading to CodeSite 5. CodeSite 4 was last updated 4 years ago, but CodeSite 5 is still actively being updated. Plus, CS5 has many new features and enhancements over CS4.

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 603
Joined:
Fri Mar 25, 2011 9:04 pm

Re: CSCGIDispatcher not routing received messages

Postby BerndLinde » Wed Aug 27, 2014 2:08 am

Hi Ray

Thank you for doing all the testing setups and trying to help me resolve this.
I reverted teh CSCgiDispatcher.exe back to the CS4 version and tested again, but no luck with the messages arriving at the destination Dispatcher or LiveViewer.

I have gotten word that we do have a CS5 license and that I will have access to it, so I will rebuild the applications and deploy the CS5 Dispatchers and DLL's and let you know what the outcome is.

Kind Regards
Bernd
BerndLinde
 
Posts: 13
Joined:
Tue Aug 12, 2014 9:16 am

Re: CSCGIDispatcher not routing received messages

Postby BerndLinde » Wed Aug 27, 2014 4:02 am

Hi Ray

I have rebuild the testing applications with CS5, deployed the CS5 CGI and Isapi modules to my IIS server.
I ran a full battery of tests again as before, but to no luck. HTTP messages are not being received by the target CSDispatcher.

I have tried with Firewall and Anti-Virus disabled, I have checked that the http queries are getting to the IIS server and are logged as being processed, all with the same responses as before.

As before, if I configure the testing application to send messages via both the HTTP and TCP protocol, then the TCP messages arrive at the destination CSDispatcher and Live Viewer, but the HTTP messages don't. When I configure it for just HTTP, there is no activity on the CSDispatcher or Live Viewer.

Any idea what the next steps can be that we can try to resolve this?

Kind Regards
Bernd
BerndLinde
 
Posts: 13
Joined:
Tue Aug 12, 2014 9:16 am

PreviousNext

Return to Tools

Who is online

Users browsing this forum: No registered users and 1 guest

cron