Changing the port of ccnet (in order to run multiple instances on the same machine) does not work?

821 views
Skip to first unread message

Inge

unread,
Jun 20, 2011, 6:15:02 AM6/20/11
to ccnet...@googlegroups.com

According to both docs and several other resources (e.g. http://confluence.public.thoughtworks.org/display/CCNET/The+Server+Service+Application) it sounds like running multiple instances of ccnet should be easy as pie.

I have a separate copy of the server in its own directory, and it works fine.
I then change the TCP port it is using, which defaults to 21234. I do this in ccnet.exe.config as I am testing from the console app, like so:

  <system.runtime.remoting>
    <application>
      <channels>
        <!--<channel ref="tcp" port="21234">-->
   <channel ref="tcp" port="7777">
          <serverProviders>
            <formatter ref="binary" typeFilterLevel="Full"/>
          </serverProviders>
        </channel>
      </channels>
    </application>
  </system.runtime.remoting>

This looks good during initial startup:

C:\CCNET\Main>ccnet
CruiseControl.NET Server 1.6.7981.1 -- .NET Continuous Integration Server
Copyright © 2003 - 2011 ThoughtWorks Inc.  All Rights Reserved.
.NET Runtime Version: 2.0.50727.4959    Image Runtime Version: v2.0.50727
OS Version: Microsoft Windows NT 6.1.7600.0     Server locale: nb-NO

<-- snip -->

[CCNet Server:WARN] Configuration does not have any version information - assuming the configuration is for version 1.6
[CCNet Server:INFO] Log cache time set to 5 minutes
[CCNet Server:INFO] Registered channel: tcp
[CCNet Server:INFO] CruiseManager: Listening on url: tcp://164.9.245.117:7777/CruiseManager.rem
[CCNet Server:INFO] Registered channel: tcp
[CCNet Server:INFO] CruiseServerClient: Listening on url: tcp://164.9.245.117:7777/CruiseServerClient.rem
[CCNet Server:INFO] Starting CruiseControl.NET Server

However, then it still tries to connect to the default port:

[Cargo:DEBUG] Retrieving ProjectStatus from server: tcp://localhost:21234/CruiseManager.rem

Which of course doesn't work so well:

[Cargo:ERROR] INTERNAL ERROR: No connection could be made because the target machine actively refused it 127.0.0.1:21234
----------
ThoughtWorks.CruiseControl.Remote.CommunicationsException: No connection could be made because the target machine actively refused it 127.0.0.1:21234
   at ThoughtWorks.CruiseControl.Remote.RemotingConnection.SendMessage(String action, ServerRequest request)
   at ThoughtWorks.CruiseControl.Remote.CruiseServerClient.GetProjectStatus()
   at ThoughtWorks.CruiseControl.Core.Triggers.ProjectTrigger.GetCurrentProjectStatus()
   at ThoughtWorks.CruiseControl.Core.Triggers.ProjectTrigger.Fire()
   at ThoughtWorks.CruiseControl.Core.Triggers.MultipleTrigger.Fire()
   at ThoughtWorks.CruiseControl.Core.ProjectIntegrator.PollTriggers()
   at ThoughtWorks.CruiseControl.Core.ProjectIntegrator.Integrate()
   at ThoughtWorks.CruiseControl.Core.ProjectIntegrator.Run()
----------


Checking with netstat and telnet I can confirm that it IS listening on port 7777 and that it is possible to connect.

So at this point I am not sure if there is something obvious I have missed, or if there is an actual bug related to this.

Thank you for your time.

Tony B

unread,
Jun 21, 2011, 9:57:43 AM6/21/11
to ccnet-user
Are you starting the service or the command line server? They have
separate .config files (ccnet.exe.config and ccservice.exe.config).

I am running successfully in a multi-server configuration. I have
modified the ccservice.exe.config files for both servers. One retains
the original port and the other uses a different port. Both services
start and run without issue. (I am running 1.5.7256.1).

On Jun 20, 5:15 am, Inge <stub...@gmail.com> wrote:
> According to both docs and several other resources (e.g.http://confluence.public.thoughtworks.org/display/CCNET/The+Server+Se...)

Inge

unread,
Jun 21, 2011, 3:11:17 PM6/21/11
to ccnet...@googlegroups.com
1. I am starting the ccnet.exe command line server
2. The console logging shows that a)it initiates listener on the specified port (7777  in my example) - and netstat/telnet confirms this. b)that it requests project updates from the default port 21234.
3. I downloaded and tested with your version (1.5.7256.1) - and got the same result

If I run a service on both the default port and a different port - THIS HIDES THE PROBLEM, as both are requesting data from the server listening on the default port.

It would be very helpful if you tried to run ONLY the project on the non-default port, and that you check the console debug output for where it is trying to get project status from
(e.g. [Cargo:DEBUG] Retrieving ProjectStatus from server: tcp://localhost:21234/CruiseManager.rem )

You could also try to run both servers on two different non-default ports and see if that works. 

It still seems to me to only want to connect to the default port in order to request ProjectStatus.

Thank you for testing :)
-Inge

Inge

unread,
Jun 24, 2011, 4:25:44 AM6/24/11
to ccnet...@googlegroups.com
I just realized that your test was with ccservice while I was testing with ccnet.exe - I'll redo the test with ccservice and we will see if that helps. But my experience is still that there is a potential bug with ccnet.exe and using a non-default port.

Ruben Willems

unread,
Jul 21, 2011, 9:34:42 AM7/21/11
to ccnet...@googlegroups.com
Hi

the string "Retrieving ProjectStatus from server" only exists in a project trigger

so maybe this project needs to update the uri of the project trigger to point to the correct one

with kind regards
Ruben Willems

Inge

unread,
Aug 3, 2011, 4:59:28 AM8/3/11
to ccnet...@googlegroups.com
Here is an example of the log entry from ccnet:

[Cargo:DEBUG] Retrieving ProjectStatus from server: tcp://localhost:21234/CruiseManager.rem

I don't specify that URI anywhere that I know of. But yes, the problem is that the port is 21234 instead of whatever I set in ccnet.exe.config or ccservice.exe.config...

So anyone have any tips?

Daniel Ash

unread,
Aug 20, 2013, 3:35:36 PM8/20/13
to ccnet...@googlegroups.com
Did you ever figure this out?  I'm having a very similar issue and have yet to find a solution.

Thanks

Dan

Ruben Willems

unread,
Aug 21, 2013, 12:14:08 AM8/21/13
to ccnet...@googlegroups.com
Hi

ccnet should work on different ports,
because the testing in CCNet actually uses a CCNet instance for the integration tests.

I think the OP changed the port while CCNet was running,  and that scenario could leave the original port in use.
Steps to set up CCNet for using another port than the default one :
° make sure it is stopped
° change the port number in the config
° change any project trigger in ccnet.config accordingly
° start CCNet





with kind regards
Ruben Willems

--
 
---
You received this message because you are subscribed to the Google Groups "ccnet-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ccnet-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages