Thursday, January 21, 2010

Invalid handle error in Visual Source Safe

I was getting an "Invalid handle" error message the other day when trying to access Visual Source Safe and it drove me mad for a couple of days until I found a solution. So I thought I would blog it in case you run across the same problem.
I was at a customer site using my laptop which was not connected to the customer's domain. When I plug in the network cable I get issued an IP address from their DHCP server. I then fire up my Virtual Machine with my development environment on it including Visual Source Safe 2005. The virtual machine network connections are configured so that it too is issued an IP address from the customer's DHCP.
Using the logon credentials the customer has issued me, I can connect to servers and file shares on their domain.
Now the Visual Source Safe database was located on one of the customer's servers and I noticed that the network connection was unreliable. At times when I pinged the server I got "request timed out" or "host destination unreachable". The result was when I opened Visual Source Safe sometimes it would work just fine and other times it would give me the "Invalid handle" error. It got to a point where I was unable to connect to Source Safe for several days.
The solution as it turned out was quite simple. I mapped a drive letter to a network share on the VSS server. Note it's important to map a drive letter, just using "Run" to connect to the share was not enough. Now of course if you can't even ping the server then mapping the drive won't work either. But I found that once I was able to map the drive the "Invalid handle" error would go away - at least for the rest of the day. I still find that each day I need to disconnect the drive and then reconnect but it's a small price to pay to have access to VSS for the rest of the day.
So if you come across the same situation I hope this helps you to solve it.

6 comments:

Unknown said...

Thank you very much, it helped me !

Krypta said...

So helpful!!! Thank you!

Dmitry Lukas Pavlov said...

Thanks!! very useful!!

King Alliance LLC said...

Thxs for the post...it was a huge help. We had someone here in the ofc have the exact same problem & your recommendation worked perfectly...Thank you!

Nullius said...

Great .. that worked like a charm :-)
Thanks!

Martina said...

Thank you so much! It helped a lot!