Bonobo Git server issue resolution with Windows 2012

Within the last couple of days I had to set up a new development/test server and as part of the installation I wanted to add a Git server. I looked through the many options and decided that I would go with Bonobo. The instructions were very straight forward and seemed simple enough. I followed each step and got to the point where you open a web browser to set up the default configuration. When I did it, I was presented with the following:

At first I searched the web for what could be the issue and there were many "resolutions" but none of them worked for me. So then I took a closer look at the error screen. Do you notice something special about it? (url scan info) As it turns out the default install that I was given of IIS on Windows Server 2012 has a URL scan setting I didn't know about. I located the urlscan.ini file and found the option of "AllowDotInPath"=0. I changed this option to 1 and the Bonobo Git server started working immediately. I don't know if this is a new "feature" of the latest version of urlscan, however there wasn't a single reference to it on the web that I found.

Hopefully this can help out someone else who is having the same issues.

Checking if an object exists in SQL Server

Recently I was trying to remember the code to check and see if a procedures exists before I do something with it and I did a search on the internet to see what came up. The most common response that I saw was:

view plain print about
1if exists (
2 select * from dbo.sysobjects
3 where id = object_id(N'[dbo].[usp_my_dummy_proc]')
4 and OBJECTPROPERTY(id, N'IsProcedure') = 1
5 )
6    select 'IT EXISTS!';
Looking at this code, a couple of things are happening, first the object id is collected and then used to find the object in sysobjects. Next it is validating that it is a procedure.

For my purposes though, this was overkill. I was already creating a procedure using a template and one of the last steps I wanted to do was change the permissions. However if there is an error creating the procedure I didn't want the permission change to generate another error. In this case, I didn't need to check if it was a procedure because I was creating it right then. As I looked at the code, I also noticed something else, there are two hits being made just to check for existence when all that is needed is one. I say there are two because object_id(N'object_name') will return an id if something exists and a null if it doesn't.

Therefore, you can save on excess processing if you just want to know if something is there by doing the following:

view plain print about
1IF (OBJECT_ID(N'[dbo].[usp_my_dummy_proc]') IS NOT NULL)
2 SELECT 'IT EXISTS!';

Just another little code snippet to help when you need to just know if it exists.

Finding ports for SQL Server Named Instances

Today I needed to make a connection to a named instance of a Microsoft SQL Server 2008 R2 database, however I could not use the named instance in the application I was using. Instead, server name and port needed to be used.

Important things to note: * Each named instance is assigned it's own port number. * The table sys.dm_exe_connections has this port information.

The following query will give you the port number if you are already connected to the database:

SELECT DISTINCT LOCAL_TCP_PORT FROM sys.dm_exec_connections WHERE LOCAL_TCP_PORT is not null;

I have heard a rumor that there are some configurations of SQL server that would allow the server to assign random ports on reboot, but I have not been able to verify that. It should just be considered that there is a possibility that if the server is rebooted you may have to rebuild any connections using the port number.

CF9 and Java7

Recently Adobe released hot fixes that allow CF9 and CF10 to run on Java 7 [1].

I actually had to do this on a new install, however there was an issue. I was using the instructions for installing the Cumulative hot fix 4 for ColdFusion 9.01 [2], however I kept having a problem with the ColdFusion instance not starting.

The instance kept failing with Windows Error 2. In the cfusion-out.log the only error was "Error loading: E:/Java7/jre7/bin\server\jvm.dll" and checking the Windows System logs showed the error: "The Macromedia JRun CFusion Server terminated with service-specific error The system cannot find the file specified..".

The instructions [2] stated that if you got an error "MSVCR100.dll is missing." that you should copy that file from the java install into {ColdFusion-Home}\runtime\bin however I was not getting that error and with a Multi-Instance install, the \runtime\bin folder does not exist.

More searching turned up a post about Java 7 and .Net [3] that had to do with the same file. Their solution was to copy msvcr100.dll to C:\Windows\System32. I figured it couldn't hurt, so I tried it and it all started working.

In this case the errors didn't match and the log files were not specific enough to get much information, however it is sometimes helpful to just try stuff if you have the time and a need.

Update: Some of this information would have been really hard to figure out with out the help of a blog post [4] from Charlie Arehart!

HTML and XML dangerous characters

This is just a short post about the characters that can cause issues when you try to convert them to HTML or XML. This is the precursor to another related post, but I wanted to get these out here for posterity, my own reference, and to try to goad me into doing the next blog post.

The following characters don't play well with XML and HTML and should be encoded to make them safe for these uses.

Character Encoding
''
""
<&lt;
>&gt;
&&amp;

Be prepared, this was in preparation for a SQL blog entry!

SSIS variables and dates with ODBC

When you are logging a process, one of the main things you need is to do is track dates and times. However SSIS has a bit of a gotcha. If you are using Variables, you can't use the DateTime data type.

If you do, and say you use an Execute SQL component to return data from an ODBC connection, it won't do what you may think it should. When I did it in this configuration, the variable populated with '1900-01-01 00:00:00.000' even though I had used getdate() to populate the variable.

When I changed the variable to be a string and changed the getdate() to convert(varchar, getdate(), 121), the variable populated with the correct date. Just so you know the convert with the option 121 formats the date into the ODBC standard for dates.

There was another gotcha that I hadn't expected, say you want to put that date back into the SQL server through another Execute SQL component, you can't use any of the date types as the input. In order to it to correctly be inserted into a date field you have to use the input type of NVARCHAR. Then everything will transfer as expected.

Moved to HostMediaUK

After years of using a different hosting provider I have switched to HostMediaUK.

There were a few hiccups, but they were all my fault. I should really learn to read the introductory emails! :)

My old hosting provider severely limited what could be used in ColdFusion. I couldn't even get BlogCFC working properly.

[More]