I have a SQL Server 2008 R2 instance on a Windows 2008 R2 box, and windows has not been updated for almost a year (I know), last night windows patches were applied (around a 100 that were pending), and this morning SQL Server will not start.
The error in event viewer is:
initerrlog: Could not open error log file 'D:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL1\MSSQL\Log\ERRORLOG'. Operating system error = 5(failed to retrieve text for this error. Reason: 15105).
As per many links (e.g.SQLServerCentral), I have found this does appear to be some kind of permissions issues. The service account SQL Server is configured to use is a network service account, I have checked this in AD and appears to be OK and the password is correct (nothing has changed since yesterday in that regard, when it was working) I have also tried:
Made the service account local admin on the box (temporarily)
Ensure that the service account was also added to the SQL Server groups on the server
Given explicit permission to the service account to the error log folder (full control); then to the whole program files folder (full control)
And I still get the same error.
Next, I tried to change the service account used (to either a network admin - (I know, just to test) or local service account) in Configuration Manager, when applying these changes I get a WMI Provider error:
WMI Provider Error [call to WMI Provider error code: 0x800742a2]
I am a bit confused by this and haven't seen the like before.
Does anyone have any ideas about what is going on, or anything else to try that I've missed?
Edit 1 :
To add, I've checked the first hits when searching for the WMI error MS Support, SQLServerCentral, but they still seem to be suggesting permissions problems. I've double checked all the above relating to permissions issues and can't see how that is the problem (The service account is now local admin (!), in the SQL Server groups on the box, and has explicit full control to all program files). I am wondering whether this WMI error is a red herring, or totally separate problem.
Edit 2 :
It seems there was something up with the ERRORLOG file that was preventing startup, not a permissions issue - not sure what, but perhaps a corruption or something of the file itself, as deleting it (well, copying it elsewhere) seems to have forced SQL Server to generate a new one and it started up OK. I'm not sure what is wrong with the errorlog file (I will see if I can open it and investigate), and I don't know what the WMI Provider error was, now that the service is online I can't fully test it now, I will try again later in some planned downtime to see if the WMI Provider comes up (and update this as appropriate/add as answer).
Edit 3 (final update):
Seems all of the symptoms were misleading and the usual cause (permissions) to this kind of problem wasn't the cause in this case, it was a problem with the ERRORLOG file itself, and removing it (to be recreated) solved the issue and services came up. I've added an answer describing this. However, this seems to be the only case I can find of these symptoms having this cause, and many cases where it is permissions, which I've included links to above, the answer in this question goes into good detail on. Therefore, if you have this problem in the future, I suggest follow those steps (checking permissions issue first), before checking out the ERRORLOG file itself.