I can't use FileDownloadHandler on TeamCity agent - windows-server-2003

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.

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.

Code is working fine locally, but not execute after hosting

I am using dot net core 2.1.
when I execute local code Process.Start("C:/Windows/notepad.exe"); it is working fine.
But when I hosted my code on IIS it is not working.
I already give all the permission.
If you want to open the client machine's notepad, it's impossible. The process start will just open the server's nodepad.
Since the client side browser will just get the server's reponse which is the html codes and show it. The process start is running on the server-side not client side.
The reason why you could open the nodepad is the client and server is the same machine.

Need to access my VM Windows 8 Local IIS from my Mac OS X host machine

I'm doing all my mobile development on my Mac OS X (Xamarin Studio or native languages), and using Parallels to work my Microsoft Azure Mobile Services backend in Visual Studio.
I've came to the point I want to test my Azure Mobile API, but I don't want to publish the service for every change and also debug it.
My problem is that I deploy to my IIS, express or local, works fine in terms of seeing the land page of the API on my Mac physical hosting machine but as soon as I click try it out I get an authentication message, check screenshot, I don't want any security to be applied right now.
How to disable it and test my Azure Mobile Service API from my Mac and eventually from my mobile projects.
[EDIT]
I should mention that from my VM Windows 8 the IIS is running properly and I can access the API without any username/password.
[EDIT 2] From #lindydonna answer.
The proxy seems to working fine since from my Mac I can call localhost/MyApiService and it goes to my Windows 8 VM Local IIS server.
So I have access the API server, all the controllers and their endpoints, you select an endpoint and get the sample screen, click try it out and fails to complete the HTTP request, 404/NotFound error. See screenshot.
The BODY of the GET request in this gist.
The above is a problem in the Local IIS settings since the same behavior applies in the Windows 8 VM environment when trying the Azure Mobile Service test page.
I made it to work using Postman, it returns JSON data properly, the iOS simulator doesn't seem to work with localhost. The MobileServiceContext throws an exception when trying to pull.
protected virtual async Task PullAsync (IMobileServiceTableQuery<TEntity> query)
{
try {
await Initialization;
IMobileServiceSyncTable<TEntity> entityTable = GetTable ();
await entityTable.PullAsync (typeof(TEntity).ToString (), query); // <-- The System.Net.WebException thrown here.
await entityTable.PurgeAsync ();
} catch (MobileServiceInvalidOperationException preconditionFailedEx) {
Debug.WriteLine(preconditionFailedEx.Message);
}
}
The problem is that your IIS Express instance is configured not to accept external network connections as a security precaution, and the Parallels VM is considered a different machine.
The easiest solution is to follow this Fiddler tutorial: Configure Fiddler for Mac, which will set up Fiddler as a proxy on the VM.
Then, on your Mac, you should modify your network settings and add a proxy setting that connects to the Fiddler proxy (http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureForMac#configure-mac-). Your iOS simulator will pick up those proxy settings.
NOTE: the Fiddler setting opens up a port on the VM, which you should turn off once you are no longer using it, as a security precaution.
Also, according to this response (iOS 8 / Xcode 6 Simulator is not using HTTP Proxy anymore) you need to also restart your iOS simulator so that it picks up the new settings.
Leave the username blank and use your Application or Master Key as the password.
Also answered here: Authentication for Azure Mobile Web Services test pages

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.

Teamcity build agent in disconnected state

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.

Resources