Teamcity build agent in disconnected state - linux

I am running teamcity on Linux server, and it was working completely fine. Once I reboot the server machine and it stopped working. I managed to start the teamcity server using runAll.sh command, but the build agent stays in "disconnected" state. The inactivity reason is being shown as 'server shutdown'. I tried to start the agent using 'agent.sh stop' and 'agent.sh start' but it does not seem to work. Could not get anything meaningful from the logs.
Kindly help.
Thanks

Incase, if you modified the teamcity port then you'll need to change the build agent configuration files to reflect the new serverUrl value. You can find this setting in the C:\TeamCity\buildAgent\conf\buildAgent.properties file.

On the machine that restarted, make sure the firewall didn't come back up in a state that blocks access to/from the agent.
When you restart the agent, the teamcity-agent.log file should have a line saying something like, "buildServer.AGENT.registration - Registering on server". If it succeeds, it should say something like "buildServer.AGENT.registration - Registered: id:.., authorizationToken:..".

Just found this while looking thru my unanswered questions, It was actually a permission issue. I wasn't running the commands as root user. Once I ran 'agent.sh stop' and 'agent.sh start' as a root user, it worked okay.

Related

What steps are required to make ColdFusion websockets work on an Azure VM behind Cloudflare?

We are attempting to use websockets in ColdFusion (2018.0.13.329786) in an app we have running on Azure VMs behind Cloudflare. However, we are continually getting this error on the client side:
WebSocket connection to 'wss://www.*************.com/cfws' failed:
CFWebSocketWrapper.open # cfwebsocketCore.js:21
init # cfwebsocketChannel.js:49
_cf_websockets_init_6539553945348401 # strategies-for-devel…ing-with-impact:175
fire # cfajax.js:1214
$E.windowLoadHandler # cfajax.js:1321
Uncaught TypeError: Cannot set properties of undefined (setting 'readyState')
at WebSocket.wsConnection.onerror (cfwebsocketCore.js:54:29)
wsConnection.onerror # cfwebsocketCore.js:54
error (async)
CFWebSocketWrapper.open # cfwebsocketCore.js:53
init # cfwebsocketChannel.js:49
_cf_websockets_init_6539553945348401 # *************:175
fire # cfajax.js:1214
$E.windowLoadHandler # cfajax.js:1321
load (async)
$E.onWindowLoad # cfajax.js:1297
cfinit # cfajax.js:1332
(anonymous) # cfajax.js:1834
We have a cfc that's called when a message is posted to a channel that writes to a log file on the server, and this log file never gets updated. This is unsurprising as it appears that something is preventing the connection altogether.
From a configuration perspective, we run these updates when the VM is created:
webSocketObj= createObject("component","cfide.adminapi.websocket");
webSocketObj.setProperty(propertyName="EnableWebSocketServer", propertyValue="true");
webSocketObj.setProperty(propertyName="EnableProxyPort", propertyValue="8581");
and then via cfExecute:
#server.coldfusion.rootdir#/lib/wsproxyconfig.jar -ws IIS -site All -host localhost -port 8581
and then the CF service and IIS are restarted.
We have also enabled the websocket 'switch' in Cloudflare.
This should be the same as going into CF Admin, going to the websockets tab, and then ticking "Use Proxy", and then using the default port of 8581. This should send everything through IIS on port 443 from the client perspective.
Cloudflare and Azure say that no special configuration is needed. And we can see that CF has port 8581 open.
The most infuriating thing is that we worked on this in our Dev environment last year and after much trial and error got it working. However, our notes from that time were not good and when we did the above to try to get this working in our QA environment it did not work. We're obviously missing a step somewhere, but have not been able to figure it out.
Can anyone who has gotten this working explain what steps are required to make ColdFusion websockets work on an Azure VM behind Cloudflare?
We solved this issue. Hopefully this will help anyone else who runs into the same problem:
Per this doc, we realized that the wsproxyconfig was supposed to be creating an 'application' (like a virtual folder) in IIS called cfws pointing to <CF_INSTALL_HOME>/config/wsproxy/1. However, it was not doing so. Once that application was created, everything started working as expected.
Upon further testing we found that it created this application only if it was run as administrator. Otherwise, it reported success and provided no warnings or failures, but did not create the application.
We were running wsproxyconfig from the command line via CFExecute, so it was running under an administrative user, but that was apparently not sufficient. So we moved the wsproxyconfig call to one of our PowerShell scripts and had it run with administrative privileges and that solved our problem.
This had apparently worked in our dev environment originally because we ran wsproxyconfig manually.

Kue (node.js) job doesn't run on remote server but works in development env

I use https://github.com/Automattic/kue for creating jobs. Locally all works correctly. But when I run my application on remote server (Amazon, Ubuntu 18) the job is not run.
Here is my local config:
port 1234
daemonize yes
dbfilename data.rdb
notify-keyspace-events Ex
Initially, My thought was that this is config issue but when I grab server config (it's different with local one) and use it in local environment. Things still work.
When, I go to the remote server and run 2 redis clients there. Subscribe to channel in one, and publish test message in another (per https://redis.io/topics/notifications). This test also works fine. That means that keyspace notifications configured properly.
The last thought I have is that something in OS blocks it because on previous versions on Ubuntu that logic worked correctly (locally I use ffuenf/ubuntu-16.04.4-server-amd64 in vagrant) So, the question is: are there anything in OS that can block Redis Keyspace Notifications?

Graylog2 sidecar collector logs not showing up on the dashboard

Installed the sidecar collector and configured it with the filebeat backend. It's running successfully. Made an output and attached some inputs to it with general log files. No logs showing up on the dashboard yet. Here's my debug output, which gives me nothing useful:
sudo service collector-sidecar stop
graylog-collector-sidecar -c /etc/graylog/collector-sidecar/collector_sidecar.yml
INFO[0000] Using collector-id: xxx
INFO[0000] Fetching configurations tagged by: [syslog linux]
INFO[0000] Starting collector supervisor
INFO[0000] [filebeat] Starting
INFO[0010] [filebeat] Configuration change detected, rewriting configuration file.
INFO[0010] [filebeat] Stopping
INFO[0014] [filebeat] Starting
Should I also make a system -> input? How can I debug the fact that logs are not showing up? What am I missing here?
I'll give this a shot...
recently I had a similar Problem, which in the end was triggered by the fact, that i ran the graylog2 docker container without opening port 5044. That seems to be the one on which the sidecar delivers content, whereas
it's heartbeat seems go on port 9000, which i had open, so graylog webinterface told me the collector was running OK.
As you configure an input in the collector configuration, you should not have to do so in the input section.
when i look into my inputs section, the collector-configured input shows up as a local input.
After adjusting the Docker container to open up 5044 everything went allright.
This refers to graylog running on docker, I don't know if that's your environment, but it might help anyway ;-)
cheers,
Arend

CruiseControl.NET multiple build servers authentication

I have CCNET 1.8.5.0 installed on two build servers and I configured WebDashboard on one server to monitor both of them. But it leads to such bug: when user logs in to one of the servers, webdashboard shows him as being authorized on other server too (Logout button is showed instead of Login). But when it tries to access project on second server he gets usual error:
Request processing has failed on the remote server: Permission to execute 'ViewProject' has been denied.
How could I force webdashboard to separate authorization on every server?
this seems to be a bug :-(
there is no configuration to my knowledge that would bypass this problem for the moment.

I can't use FileDownloadHandler on TeamCity agent

I have some trouble to run the FileDownloadHandler on my TeamCity agent.
Configuration:
windows server 2003
internet explorer 7
TeamCity Agent run as console
I have a very simple test:
using (new UseDialogOnce(Browser.DialogWatcher, handler))
{
Browser.Button(Find.ById("ButtonExportReport")).Click();
handler.WaitUntilFileDownloadDialogIsHandled(10);
handler.WaitUntilDownloadCompleted(20);
}
When I am logged with TeamCity user (so my status is Active in the task manager user tab), everything works. If I disconnect (without logging off, so my status is Disconnected in the task manager user tab), it doesn't work. I get
WatiN.Core.Exceptions.WatiNException: Has not shown dialog after 10 seconds.
Do you know what I could do ? I give up about investigating in WatiN source code, I try now to setup my server so the user session is always Active. Do you know else what I could do ?
After more investigation, I understood that WatiN need a real user logged directly on the server. So I configure the AutoLogin in windows 2003 server following this instruction: http://support.microsoft.com/kb/324737/en-us. So the server automatically logs as TeamCity user when it starts.
After, I disable the TeamCity Service and put in the Startup folder of the TeamCity user this batch file:
cd c:\BuildAgent\bin
agent.bat start
So it starts the agent when it logs, so at start up.

Resources