Archive for the ‘Error Messages’ Category

How to resolve the Windows 7 Error 0×80070522 “A required privilege is not held by the client.”?

Speaking of frustration!: You are the owner of your laptop as you have spent more than a thousand dollars on it and you have made sure you are the administrator or your user account is belonging to the administrator group. When you try to create or paste a text file into your C:\ drive, Windows throws you the error

Error 0×80070522 “A required privilege is not held by the client.”

It is similar to being locked out of your own car or having so much spams on your WordPress blogs that you are disabling the comments.

This reminds me of the funny DIRECTV commercials.

You are upset! When you are upset you start Googling how to resolve the problem. When you start Googling, you get misleading answers by the experts who are trying to increase their points in the various websites that give credits for the first responders or voted by some people as the correct answers when they have not even tried the solutions proposed. When you follow those advice to change the security settings or change ownership of the C:\ drive, you cause your computer to lock you out of the C:\ drive -> deny you access to your own C:\ drive. Think twice before follow those advice. Try the following instead:
1. Click Start > Run > SECPOL.MSC.
2. Once the “Local Security Policy” window opens, under “Security Settings” > Local Policies > Security Options.
3. Scroll down to find “User Account Control: Run all administrators in Admin Approval Mode” and then disable it. Yes -> disable it. Then, click the OK button.
4. Restart your computer.

How to resolve the “The server principal “Domain\LoginName” already exists” Error Msg 15025, Level 16, State 2, Line 1

Today, I have restored a database on a new SQL Server instance from a backup that was extracted by the Windows Admin team. After verifying that all the post restore steps are completed correctly, I have notified the QA team to start their testing. The QA team has called and notified me that the login failed during testing. The QA engineer has shared with me the following:
1. She’s attempting to logon using the account DOMAIN\Liz.
2. She has received the error:

“Cannot open database “DatabaseName” requested by the login. The login failed.
Login failed for user “DOMAIN\Liz”.

After verifying that the login does not exist in the instance and user does not exist in the database, I have attempted to create the login. But, it has failed and reported:

Msg 15025, Level 16, State 2, Line 1
The server principal “DOMAIN\Liz” already exists.

Just to make sure I have not misread the error, I have queried sys.server_principals system table. But, unable to find the login “DOMAIN\Liz”
To resolve this issue, I have:
1. Find the security identification number (SID) using the SUSER_SID() function.
2. Query the sys.server_principals by specifying the SID found in step 1. It has returned “DOMAIN\Elizabeth”. The user has confirmed that her old login name.
3. Drop the login identified.
4. Create the login again and this time it is successful.

 

Implementation steps:

1. Find the security identification number (SID) using the SUSER_SID() function.

SELECT SUSER_SID('DOMAIN\Liz')
-- It has returned 0x010500000000000515000000D114792BA53AB44C8C29BC2F1F505700

2. Query the sys.server_principals by specifying the SID found in step 1. It has returned “DOMAIN\Elizabeth”. The user has confirmed that her old login name.

SELECT *
FROM sys.server_principals
WHERE sid = 0x010500000000000515000000D114792BA53AB44C8C29BC2F1F505700
-- It has returned DOMAIN\Elizabeth

3. Drop the login identified and create a new login.

DROP LOGIN [DOMAIN\Elizabeth]
GO
CREATE LOGIN [DOMAIN\Liz]  FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english]
GO

 

REFERENCES:
SUSER_SID ()
http://technet.microsoft.com/en-us/library/ms179889(v=sql.105).aspx
sys.server_principals
http://msdn.microsoft.com/en-us/library/ms188786(v=sql.105).aspx

Error Description: Length specified in network packet payload did not match number of bytes read; the connection has been closed. Please contact the vendor of the client library. [CLIENT: xxx.xxx.xxx.xxx]

Todays, on one of the SQL Servers from the clients that I work with closely, we have received the Error: 17836, Severity: 20, State: 1. Error Description: Length specified in network packet payload did not match number of bytes read; the connection has been closed. Please contact the vendor of the client library. [CLIENT: xxx.xxx.xxx.xxx]

Error 17836 Severity 29 State 1

Usually, the first step I would take is to do a nslookup of the ip address listed in the end of the error message [CLIENT: xxx.xxx.xxx.xxx] to find out what computer it is connecting from.  Due to my busy schedule today and based on my past experience with this error, I had sent an email to my network team friends (yes, make sure you make friends with the network team) and asked them very nicely if they were doing any port scanning test. I got a reply faster you can say Bingo! My network team friends had acknowledged that they were running port scanning on the servers. The most likely cause is that the port scanning software is sending data packets to SQL Server and SQL Server does not know what to do with it and then it closes the connection.

If the network team is not running any port scanning or testing, it is within your best interest to find out quickly to see who or what is hitting your server on the specified port for any suspicious activities.