CSCGIDispatcher not routing received messages

CodeSite Dispatcher, CodeSite Viewers, CodeSite Controller

CSCGIDispatcher not routing received messages

Postby BerndLinde » Wed Aug 13, 2014 6:57 am

Heya

We are busy investigating using the CodeSide HTTP dispatcher for remote debug info from our clients (various setups from moderate security to high-security firewalls etc., hence not wanting to have our clients need to get TCP/UDP ports configured)

I have made little testing applications with both the VCL (Delphi XE) and FCL (VS2010/C#) versions, which I use both locally and from a VM on our internal network.
I have setup the CSCGIDispatcher.exe on my local IIS server and confirmed that it is accessible and executable.

The problem that I am having is that messages are being sent to the CSCGIDispatcher, but they are not arriving on my local dispatcher or live viewer.

I have tested the direct TCP sending methods aswell, which are successfully received by the local CSDispatcher.
I have checked the CSDispatcher logs both on the VM and locally to check that the senders are getting registered (For the TCP method they are both recognized on the sender and receiver, but via the HTTP method they are only recognized on the sender)
I have also used Wireshark to ensure that the http traffic does arrive and checked the IIS logs to confirm that the requests are coming in.

My setups:
Local dev PC:
Windows 8.1 with UAC enabled
Hostname: D022
IP: 172.30.2.27
IIS 8.5 running with CGI and ISAPI components installed, CSCGIDispatcher setup'd
Delphi XE with CodeSite Studio 4.6.2 installed
Visual Studio 2010 with CodeSite FCL DLL manually added to references.

VM PC (VD030):
Windows 7 Ultimate with UAC enabled
Hostname: VD030
IP: 172.30.2.50
CodeSiteTools not installed, opted for the CSDispatcher.exe in the same directory as my application to be started when required.

Delphi code for calling the HTTP remote destination:
Code: Select all
procedure TfrmMain.btnProcessClick(Sender: TObject);
var
  csDest: TCodeSiteDestination;
begin
  csDest := TCodeSiteDestination.Create(self);
  csDest.HTTP.URL := 'http://D022/CSTest/CSCGIDispatcher.exe';
  csDest.HTTP.Alias := 'Default';
  csDest.HTTP.Active := true;

  csDest.Viewer.Active := false;

  CodeSiteManager.DefaultDestination := csDest;

  CodeSite.Send('Testing message');
end;


C# equivalent for the call
Code: Select all
private void btnGo_Click(object sender, EventArgs e)
{
  CodeSiteManager.DefaultDestination.HTTP.Alias = "Default";
  CodeSiteManager.DefaultDestination.HTTP.URL = "http://D022/CSTest/CSCGIDispatcher.exe";
  CodeSiteManager.DefaultDestination.HTTP.Active = true;

  // Disable the local live viewer
  CodeSiteManager.DefaultDestination.Viewer.Active = false;

  CodeSite.Send("Testing message");
}


Log entries in IIS for the calls made from the VM to my local IIS:
Code: Select all
#Software: Microsoft Internet Information Services 8.5
#Version: 1.0
#Date: 2014-08-13 11:26:50
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2014-08-13 11:26:50 172.30.2.27 POST /CSTest/CSCGIDispatcher.exe/connect Alias=Default 80 - 172.30.2.50 Mozilla/3.0+(compatible;+Indy+Library) - 200 0 0 106
2014-08-13 11:26:50 172.30.2.27 POST /CSTest/CSCGIDispatcher.exe/message Alias=Default 80 - 172.30.2.50 Mozilla/3.0+(compatible;+Indy+Library) - 200 0 0 259


Versions of the config INI files I have also tried:
Code: Select all
[Default]
RemoteDestinationDetails=Viewer
Host=D022

[Default]
RemoteDestinationDetails=Viewer
Host=127.0.0.1

[Default]
RemoteDestinationDetails=Viewer
Host=localhost

[Default]
RemoteDestinationDetails=Viewer
Host=172.30.2.27


So after that wall of text, the questions are:
  1. What am I doing wrong that the CSCgiDispatcher cannot route the messages to the local dispatcher?
  2. Is the HTTP routing a viable option for the future, since I haven't seen it being mentioned in CodeSite 5 yet.
BerndLinde
 
Posts: 13
Joined:
Tue Aug 12, 2014 9:16 am

Re: CSCGIDispatcher not routing received messages

Postby Raize Support » Thu Aug 14, 2014 3:44 am

Hi,

Thanks for the detailed information regarding the issue you are running into.

I am trying to get a handle on how you have things setup. The first thing to check is to make sure that the CSCgiDispatcher is accessible. If you enter the HTTP Destination URL (i.e. http://D022/CSTest/CSCGIDispatcher.exe) into a web browser, what results do you get?

If the CSCgiDispatcher.exe is installed and operating correctly, you should see

CodeSite HTTP Dispatcher
Raize Software, Inc.


You also mentioned that you tested the direct TCP Sending methods. What precisely did you test? That is, did you set the destination to use TCP? Or, did you use the ConnectUsingTcp method? Was the app that sends the CodeSite message on a separate machine, or on the same machine as the destination Viewer.

For the machine that is to receive the redirected CodeSite messages from the CSCgiDispatcher, are the Tcp ports being monitored in the CSDispatcher? In CodeSite 4, the TCP and UDP ports are not monitored by default. Also, does this computer have any firewall blocks on the port being used?

BTW, the CSCgiDispatcher.exe is still available in CodeSite Studio 5.

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

Re: CSCGIDispatcher not routing received messages

Postby BerndLinde » Thu Aug 14, 2014 4:58 am

Hi Ray

Thank you for the response.

Raize Support wrote:The first thing to check is to make sure that the CSCgiDispatcher is accessible. If you enter the HTTP Destination URL (i.e. http://D022/CSTest/CSCGIDispatcher.exe) into a web browser, what results do you get?

If the CSCgiDispatcher.exe is installed and operating correctly, you should see

CodeSite HTTP Dispatcher
Raize Software, Inc.


Yupe, I am getting that result. From both the hosting machine (D022) and the remote machine (VD030) when browsing to "http://D022/CSTest/CSCGIDispatcher.exe"

Raize Support wrote:You also mentioned that you tested the direct TCP Sending methods. What precisely did you test? That is, did you set the destination to use TCP? Or, did you use the ConnectUsingTcp method?


I set the destination to use TCP, C# and Delphi code as below (within the same methods as in my original post) :

C#
Code: Select all
CodeSiteManager.DefaultDestination.TCP.Host = "D022";
CodeSiteManager.DefaultDestination.TCP.Port = 3434;
CodeSiteManager.DefaultDestination.TCP.Active = true;

Delphi
Code: Select all
  csDest.TCP.SetHost('D022');
  csDest.TCP.SetPort(3434);
  csDest.TCP.Active := true;


Raize Support wrote:Was the app that sends the CodeSite message on a separate machine, or on the same machine as the destination Viewer.

Both scenarios. I ran the application on both the same machine (D022) and a separate machine (VD030) as what the destination Viewer is running.

Raize Support wrote:For the machine that is to receive the redirected CodeSite messages from the CSCgiDispatcher, are the Tcp ports being monitored in the CSDispatcher? In CodeSite 4, the TCP and UDP ports are not monitored by default. Also, does this computer have any firewall blocks on the port being used?

Yupe, I checked that the TCP and UPD ports are monitored. When loading the CSDispatcher, this entry is inside the log file:
"Setting 14.08.2014 11:46:10.388 Enabled; UIMode=Unrestricted; MonitorPorts=3434,3435; FolderVariables=0; RestrictFolders=No; Categories=0; BlockedMessages=0; "

I have also tested with the firewall disabled and enabled, from both the source and destination machines (standard windows firewall)
BerndLinde
 
Posts: 13
Joined:
Tue Aug 12, 2014 9:16 am

Re: CSCGIDispatcher not routing received messages

Postby Raize Support » Thu Aug 14, 2014 5:42 pm

Hi,

Yesterday, I had setup an environment as nearly the same as yours as I could determine, and everything worked correctly. However, the key difference was that I am using CodeSite Studio 5. After reading your last response, I went back and switched to using the CSCgiDispatcher.exe from CodeSite Studio 4, and having done so experienced the same problem you are running into. That is, the messages are not getting transported to the remote dispatcher.

I have uploaded the CSCgiDispatcher.exe from CodeSite Studio 5 to our website: http://www.raize.com/DevTools/CodeSite/ ... atcher.zip

Please try using this in your environment.

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

Re: CSCGIDispatcher not routing received messages

Postby BerndLinde » Fri Aug 15, 2014 7:34 am

Hi Ray,

Thanks for the upload, I have tried it in my environment but without success.

I have spent more time with various tracing utilities (ProcMon, Wireshark, IIS logging) to try and identify additional information that might be able to help identify why the messages are not coming through.

With ProcMon I have noticed that the CSCgiDispatcher.exe at no point queries the CSCgiDispatcher.ini file, that is in the same folder as the exe (C:\wwwroot\CSTest\).
Might this not be a reason as to why messages are not being routed?

With Wireshark I have seen that the calls to CSCgiDispatcher.exe always return with a status 200 and the default html that one gets when calling the URL from a browser.

I have attached all the different logs for you to check for additional information.
CodeSite Logs and Capture files.7z
CodeSite Logs and Capture files
(222.26 KiB) Downloaded 357 times


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

Re: CSCGIDispatcher not routing received messages

Postby Raize Support » Fri Aug 15, 2014 4:08 pm

Hi Bernd,

On our system, the CSCgiDispatcher.exe is definitely reading the INI file located in the same folder as the exe. The messages are appearing in the Live Viewer on the remote computer. Could you have a misspelling between the CodeSiteDestination object properties and the INI section headers, so the CSCgiDispatcher.exe is not finding the correct alias entry?

As far as the 200 result code, that is a standard result code for OK. What is strange is the header portion of the IIS Call Logs you sent. Specifically,

Code: Select all
failureReason="STATUS_CODE"
               statusCode="200"
               triggerStatusCode="200"


What is odd is that a status code of 200 is NOT an failure condition. Could this be some configuration setting in your web server?

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

Re: CSCGIDispatcher not routing received messages

Postby BerndLinde » Tue Aug 19, 2014 8:56 am

Hi Ray

I have double checked the aliases to make sure that I have them correct, I added different aliases and tried them as well, but at no point does the CSCgiDispatcher query the CSCgiDispatcher.ini file (according to ProcMon) or the messages arrive at the remote CSDispatcher or CSLiveViewer.

On the same IIS server I have a Mercurial CGI web application running under Python without issues.

The INI settings file that I currently have is like this:
Code: Select all
[Default]
RemoteDestinationDetails=Viewer
Host=D022

[SelfIPTest]
RemoteDestinationDetails=Viewer
Host=127.0.0.1

[LocalHostTest]
RemoteDestinationDetails=Viewer
Host=localhost

[LocalIPTest]
RemoteDestinationDetails=Viewer
Host=172.30.2.27


I adjusted my testing applications to allow for a bit more dynamic testing, both the DelphiXE and VS2010/C# source code versions are attached.


On an unrelated topic, I noticed that the HTTP Alias setting in C# is not set when it is set in code, it always stays as "Default". I haven't checked this yet with CS5 as I don't have access to that yet.
I set them in the same way in the Delphi and C# code, the Delphi Alias changes, but not the C# one.

Kind Regards
Bernd
Attachments
CodeSiteTester CSharp.7z
VS2010 with C# testing application
(7.09 KiB) Downloaded 333 times
CodeSiteTester DelphiXE.7z
DelphiXE testing application
(83.01 KiB) Downloaded 335 times
BerndLinde
 
Posts: 13
Joined:
Tue Aug 12, 2014 9:16 am

Re: CSCGIDispatcher not routing received messages

Postby Raize Support » Wed Aug 20, 2014 1:54 am

Hi Bernd,

It sounds like you might be running into an IIS security issue/setting that is preventing EXE CGI apps from being executed in recent versions of IIS. I was testing under an older version of IIS. Unfortunately, I don't recall if it is possible to override this limitation in newer versions of IIS. Perhaps the ISAPI version would be better in this situation.

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

Re: CSCGIDispatcher not routing received messages

Postby BerndLinde » Wed Aug 20, 2014 7:35 am

Hi Ray

I have implemented the ISAPI module into the IIS server and I get the same results as with the CGI version.
When calling the URL from a browser, I get the "CodeSite HTTP Dispatcher Raize Software, Inc." page, but when sending messages to it from the testing applications, nothing is received by the dispatcher at the destination.

INI settings are the same as for the CGI module, but in a file called "CSIsapiDispatcher.ini" which is residing in the same directory as the CSIsapiDispatcher.dll

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 2:30 am

I wonder if something in your application code is causing the logger to become disabled. Just before you try to send a CodeSite message, please check the Enabled property of the logger you are using. Is the logger enabled? Also, please check the Enabled property of the CodeSiteManager. If either of these properties are False, then the logger will not try to send a CodeSite message.

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

Next

Return to Tools

Who is online

Users browsing this forum: No registered users and 1 guest

cron