Thursday, March 29, 2007

You cannot back up databases to a network drive failed to open, operating system error = 5 (Access is denied.)

CAUSE
This error message usually occurs as a result of incorrect permissions to the network drive.

To enable backups to network drives, perform the following steps:

1.The SQL Server service must be started using a domain user account to access any resources on a remote computer. Verify that the MSSQLServer service is started under a domain account that has write access to both the Windows NT Server share and its underlying partition (if the partition is formatted with the Windows NT file system, or NTFS).
2.In Control Panel, double-click the Services icon.
3.Select the MSSQLServer service and then click Startup.
4.Examine the startup options for the service and verify that This Account is selected and that a valid domain account is supplied in the form Domain_Name\Domain_account (with the correct password).NOTE: If you changed the service to run under a domain account, you must stop and restart the MSSQLServer service.
5.Verify that the account specified has write access on the Windows NT share to which you are backing up, as well as the underlying partition (if the partition is formatted as NTFS). To do this, perform the following steps:
a.Right-click the share name in Windows NT Explorer.
b.Click Sharing on the shortcut menu.
c. On the Security tab, click Permissions.

Sunday, March 18, 2007

The project location is not trusted

Somedays back I download the AjaxControlToolKit zip file that had some sample implementations. But, when I tried to open the solution and I got an error saying "The project location is not trusted"

On googling, I found the probable reason is that - if you open client project on a Universal Naming Convention path - shared path.

[Btw, what is Universal Naming Convention path?? - In a network, the Universal Naming Convention (UNC) is a way to identify a shared file in a computer without having to specify (or know) the storage device it is on. In Windows operating systems, Novell NetWare, and possibly other operating systems, the UNC can be used instead of the local naming system (such as the DOS naming system in Windows). In Windows operating systems, the UNC name format is: \\servername\sharename\path\filename]

In my case, it was deceptive suggestion. There wasn't any UNC path referred and in the dialog box that VS.net shows error, show "C:\projects\..." path as non-trusted location.

Actual reason for this error was that I downloaded this Zip file, which I extracted to my project location, was from Internet and was NOT trusted by Windows and hence I had to "unblock" zip file. This you can do by "right-click" the zip file and go to properties and you would see "Unblock" button at the bottom on the dialog.

If you get this error because it actually refers to the UNC path, solution is http://msdn2.microsoft.com/en-us/library/bs2bkwxc(VS.80).aspx

Thursday, March 08, 2007

Daylight saving - patch broke Vj++

Our website is nearly 10 years old. Started of as static webpages, now it is a complete enterprise application. Website has been suffering more and more changes, as we were getting more successful in business, over a period of time.
Someone on one fine day, decided let us use notorious Vj++ and ASP with JScript (for the benifit of java style syntax), though many people who used MS platform preffered to use VB and ASP together. But I am not sure if VB would have be powerful enough to have designed the application as it has been designed now. We have been paying for that decision for sometime.
1. Vj++ no more supported by MS
2. Vj++ does not supported multi processor - so we had to always make sure that the CPU affinity is set to one CPU for ASP application
3. I believe there would some performance set back and more to go....

To add more to this list, recently as we know, Daylist Saving logic has changed and Microsoft had a patch to cope with it. After we applied the patch, our application broke. It was very strange and it took some time to debug that.

Finally, found that the DST fix broke the dateformat returned by the Date object of Vj++. Previously, the dateobject returned time localized like EST, CST etc. But now, it always return in GMT and this change broke some part of the system. We had to then write a patch class that extends the current Date object and return the date in old format.

Akamai

Content Delivery Network - this is a new concept of hosting the content in wide distributed network. In a website, we have lots of content. Contents are static and dynamic. Simple approach to CDN would be that the static contents are not going to change and we can cache the content or make the request to these static content less time consuming or we dont need the our server to server the static request.

Akamai, is one of the CDN provider. So it works like this. Akamai has around 20000+ servers set across different geographical location around the world. Request for some of the resources will be distributed all across these servers and client will get their content from closest server.

Let me explain in detail. Think of 20 images in a web page and assume the website is www.example.com. So when you refer to the images on the web page, it would look like <img src="http://www.example.com/images/logo.gif" />

So, when the image is requested from the browser the request would land on to the example.com servers. The round trip time or no of hops to this server would be different from different location around the world. This would affect the overall speed in the delivery of the content.

Instead, we can Akamai our contents. In the above example, once we sign up with Akamai they will give us a domain name. Eg. ak.example.com. In our website, we refer to the image content as <img src="http://ak.example.com/images/logo.gif" />. So what happens now?

Now, comes something called Dynamic IP look up. Typically, when a browser makes a request "ak.example.com", the DNS directory returns the IP address mapped to this domain and the communication happens subsequently. But in this above case it works differently. "ak.example.com" would have different IP published in the different DNS directory on different location and hence the IP would be different from different location. Which would mean, the IP returned is one of their 20000+ servers, but closest to them. Thus it reduces a lots of network latency involved. So when a server get the request first time, it would request the example.com server, and cache the image in to their server and all subsequent request will be served from Akamai servers. It is possible to purge the content using their admin tool so that we can refresh the cache.

Above description is very simple description about akamai.

Wednesday, March 07, 2007

1.x to 2 .net app migration!

I read this article online, just kept it here for my reference.

If you’ve read through various migration HOW-TOs, you might’ve noticed a suggestion to turn off batch compilation and rebuild your project to see if any compilation errors come up. This is a very important point as the section in web.config is a tricky one.

Here’s what an MSDN article suggests:
Open the web.config file and turn batch compilation off and re-compile that application to see if any further compilation errors might exist. This can be done by setting the batch=false attribute in the compilation tag as such: . Turning off batch compilation may expose masked compilation errors that may exist in the application but are not reported.
Important: The batch=false attribute should only be added to find such errors and then reverted once any additional compilation errors are fixed. Leaving batch=false in the compilation section has significant performance impact on build times for the application in Visual Studio 2005, so make sure you remove this attribute after doing this check.
More reading on this subject:

Don’t run production ASP.NET Applications with debug="true" enabled
Beware Of Deploying Debug Code In Production
PageParser.GetCompiledPageInstance Weirdness