Had another interesting one today whilst trying to deploy locally during a CI build using MSDeploy, I kept getting the error:

Exception calling "SyncTo" with "4" argument(s): "Connected to the destination computer ("localhost") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site."

I wanted to use integrated security but the Web Management service just wasn't playing.  So I found that you just need to enable NTLM in the registry:

  • Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\WebManagement\Server
  • Create a new DWord key called "WindowsAuthenticationEnabled"
  • Set it's value to 1
  • Restart the Web Management Service


I'm currently working on using Team City as a continous integration(CI) server rather than TFS as from my experience TFS has never really been a contender as a good CI server, it's far too limited and I might list these out one day.  For the purpose of this post I'm documenting my steps to install TeamCity for production use rather than as a play pen on someones desktop.

Prerequisites

- This presumes that SQL Server is already installed

 

  1. Download and install TeamCity from here:  http://www.jetbrains.com/teamcity/download/
  2. Install Team City with the following options:





  3. Use AD for security

    - Edit C:\TeamCity\.BuildServer\config\main-config.xml
    - Change <login-module> to jetbrains.buildServer.serverSide.impl.auth.NTDomainLoginModule
    - When you navigate to Team City for the first time you'll be prompeted to enter an admin accouint, logging in with a domain account will automatially add that user to the TC admin group

    If you find problems trying to login you can try and setup the admins again with http://localhost:8080/setupAdmin.html
  4. Enable per project permissions:  Adminstration -> Global Settings -> select "Per-Project permissions"
  5. Use SQL Server rather than the internal DB:

    - See  http://confluence.jetbrains.net/display/TCD7/Setting+up+an+External+Database#SettingupanExternalDatabase-jtds
    - I used the native SQLJDBC drivers and as per the instructions I created a database.properties file in D:\TeamCity\.BuildServer\config
    - Browse to http://localhost:8080
    - You may get an error saying that some maintenance is required, open the teamcity-server.log and copy the token key at the end of the file and use this to enter the maintenance screen
    - Click "Create Database"
    - After a while the DB will be created, as a success message I received a 404 TomCat message.  
    - Navigating to the Team City home page and running through the admin setup shows that everything is working correctly
  6. Setup SMTP Email With Exchange Server
    - Make sure you have the following "roles" installed: Web Server with IIS6 management tools option selected
    - Make sure you have the SMTP feature installed
    - Run the IIS6 Management tools and drill down to the SMTP server
    - On the SMTP server properties -> Delivery Tab -> Advanced -> [enter the smarthost address]



    - Enable relay for the local server:

  7. In Team City -> Administration -> Email Notifier -> [Set SMTP Host to 127.0.0.1]

 

Notes

 

  • If you need to reconfigure anything afterwards such as changing the TeamCity Data location then you must run C:\TeamCity\Bin\Tomcat7w.exe //ES//TeamCity  which will display a UI where the internal properties can bet set
  • Database problems:

    SEVERE: The web application [] registered the JDBC driver [org.apache.commons.dbcp.PoolingDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

 


When deleting a service using the syntax: sc delete tcbuildagent you might come across the error:

The specified service has been marked for deletion

This is an easy one to fix and no need to reboot, just close down the services window or server manger!


Posted in: Windows 2008  Tags:
Dan posted on April 19, 2012 13:20

Whilst trying to edit some work item definitions in Visual Studio 2010 I came across a nasty error:

"The format of one argument does not meet the contract of the method.  Error 0x80131537"

 

Solution

Clear all contents from C:\Users\USER_NAME\AppData\Local\Microsoft\Team Foundation\3.0\Cache

:-)


Posted in: Tools  Tags:

Seems like a few bugs exist in the PowerShell Web Administration cmdlets, for example I was trying to use Get-Website to find a website by its name but it always retured an array of all websites and ignored the name argument:

This DOESN'T WORK:

 $site = Get-Website -Name "DanSite"  

This WORKS:

 $site = Get-Item "iis:sites/DanSite"  

 


Posted in: IIS7 , PowerShell  Tags: , ,
Admin posted on November 14, 2011 08:50

 

MSDeploy is really good for deploying websites and syncing up websites but it can be a real pain to configure and get going intially.  The MSDeploy documentation is a bit poor as well and quite often you'll get a very strange error which can be quite cryptic.  Here's a good example that had me stumped for a little while:

Info: Using ID '0204878c-dbb9-4ac8-8d38-1ed9f6f91e0b' for connections to the remote server. Error Code: ERROR_DESTINATION_NOT_REACHABLE More Information: Could not connect to the destination computer ("X.X.X.X"). On the destination computer, make sure that Web Deploy is installed and that the required process ("The Web Management Service") is started.
Error: The remote server returned an error: (404) Not Found.
Error count: 1.

The error message isn't actually too bad in this case, it's saying either the Web Management Service isn't running OR it can't find MSDeploy.  Ok so checklist for this problem:

- Web Management Service (WMSVC) is running on the target server
- Port 8172 is open (checked with Telnet for good measure)
- I can connect to https://servername:8172/msdeploy.axd
- MSDeploy is installed (c:\program files\IIS\MSDeploy\Microsoft Web Deploy V2\msdeploy.exe)

After running through all of this I still received the ERROR_DESTINATION_NOT_REACHABLE message.  So after a while of head scratching I looked at the msdeploy version numbers and noticed that my package was created on the build server using msdeploy version 7.1.1046.1 but on the target servers it was runing the latest version of MSDeploy which at the time of writing is 7.1.1070.1.  Something suspicious perhaps!!  

The Fix

I installed MSDeploy version 7.1.1046.1 on the target servers and bingo no more nasty error messages!  I don't know if this is just a coincidence and I will try and test by upgrading the build server version to the latest MSDepply version but for now this fixed the issue.

 

 


Admin posted on November 2, 2011 22:07

Recently I started to experient with creating my own network of sites with different class C IP addresses, there's quite a few companies offering SEO hosting with multiple class C IP addresses which is very useful and there are some reasonable prices around (beware you do get what you pay for though).  I have a mixture of WordPress and .net websites so I wanted an SEO hosting company that could cater for both as it seems most SEO hosting companies only offer Linux.

I came across 2gbhosting.com which on the face of it sounded quite good:

- 99.9% uptime guaranteed
- 24/7 support
- .net, php 5 and everything else you would pretty much need

I signed up with my 6 domains and I must say that I have never used such an APPALING service, the uptime is more like 50% (if you are lucky), the performance on a site with hardly any traffic is dog slow.  In fact one of my good ranking domains has now got the following description in Google:

 

Here's some reponses from their support after I logged several calls regarding the availability of my sites:

 

 

 

So if a backup is running I can tell you for a fact  that your sites WILL stop running, what a great service.  In summary DO NOT USE 2GBHOSTING.COM FOR YOUR SEO HOSTING.


Posted in: SEO  Tags: ,

Had a good one recently on a newly built server whilst trying to get PowerShell WinRM working with a local admin user, here's the scenerio:

 Enter-PSSession -ComputerName servername -Port 81 -cred servername\localusername  
 [servername]: Import-Module webadministration   
Process should have elevated status to access IIS configuration data.

When running this as a local admin account I receive the error "Process should have elevated status to access IIS configuration data.", yet if I use my domain account which is also in the admin group on the server in question then everything works!  How weird...

Anyway the problem lies in the Remote User Account Control (UAC) settings in the registry, here's the fix (taken from http://support.microsoft.com/kb/942817):

  1. Run regedit
  2. Locate and then click the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system
  3. On the Edit menu, point to New, and then click DWORD Value.
  4. Type LocalAccountTokenFilterPolicy for the name of the DWORD, and then press ENTER.
  5. Right-click LocalAccountTokenFilterPolicy, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Exit Registry Editor.

or in Powershell:

new-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -propertyType DWord -Name "LocalAccountTokenFilterPolicy" -Value 1

 

This setting will take effect straight away so no reboot required.

 

 


Posted in: PowerShell  Tags: ,
Admin posted on October 30, 2011 17:25

I'm currently looking at implenting sitesearch for one of my client sites, I looked at a few options including Microsoft's Search Server Express 2010 and a commercial solution from http://www.sitesearchasp.net.

Here's my results:

Microsoft Site Search Express 2010

In a nutshell I a spent about half a day trying to get this working, don't waste your time with this crap (being polite as possible) as it's an absolute nightmare.  It's quite a big install and it actually installs SharePoint 2010 as well which I didn't particually want.

See the following blog posts on the "hacks" required to get it working on a non domain server:
http://soerennielsen.wordpress.com/2010/07/15/how-to-install-a-sharepoint-2010-complete-server-without-ad/
http://www.trinkit.com/blog/2009/4/9/the-sharepoint-search-service-and-anonymous-access

After doing all of this I still couldn't get it working with a nice error from Sharepoint:

At this point with nothing sensible coming form the logs I lost the will to live, deleted everything and am currently trying to delete the thought of SharePoint  from my memory.  Lets move on....

 

SiteSearchAsp.Net

Report coming soon....

 


Posted in: ASP.NET MVC , Windows 2008  Tags:
Admin posted on October 30, 2011 16:38

This might catch some people out:  Downloading a ps1 file from the Internet and tring to execute results in error:

 

Run only scripts that you trust. While scripts from the Internet can be useful, this script can potentially harm your computer. Do you want to run C:\Downloads\SetupEnterpriseSearch.ps1?

Even with executionpoilcy set to unrestricted you'll get this message, this is because by default these files downloaded are maked as blocked so to unlock simply right click on the script in question and click "unblock".

 


Posted in: PowerShell  Tags:

Calendar

«  May 2012  »
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
View posts in large calendar

Recent Comments

Banners

Theme Grabber
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012 Dan Gibbons .Net Developer