Error Messages (Windows Azure SQL Database)
This topic contains information about errors that can occur only when using Microsoft Windows Azure SQL Database. The topic also describes how the SQL Database throttling mechanism works and how to decode the reason codes returned by error code 40501.
-
General Errors
-
Database Copy Errors
-
Connection-Loss Errors
-
Federation Errors
-
SQL Database Throttling and Decoding Error Codes
General Errors
The following table lists all the general errors in ascending order.
| Error number | Severity | Description | ||
|---|---|---|---|---|
|
40014 |
16 |
Multiple databases cannot be used in the same transaction. |
||
|
40054 |
16 |
Tables without a clustered index are not supported in this version of SQL Server. Create a clustered index and try again. |
||
|
40133 |
15 |
This operation is not supported in this version of SQL Server. |
||
|
40506 |
16 |
Specified SID is invalid for this version of SQL Server. |
||
|
40507 |
16 |
'%.*ls' cannot be invoked with parameters in this version of SQL Server. |
||
|
40508 |
16 |
USE statement is not supported to switch between databases. Use a new connection to connect to a different database. |
||
|
40510 |
16 |
Statement '%.*ls' is not supported in this version of SQL Server |
||
|
40511 |
16 |
Built-in function '%.*ls' is not supported in this version of SQL Server. |
||
|
40512 |
16 |
Deprecated feature '%ls' is not supported in this version of SQL Server. |
||
|
40513 |
16 |
Server variable '%.*ls' is not supported in this version of SQL Server. |
||
|
40514 |
16 |
'%ls' is not supported in this version of SQL Server. |
||
|
40515 |
16 |
Reference to database and/or server name in '%.*ls' is not supported in this version of SQL Server. |
||
|
40516 |
16 |
Global temp objects are not supported in this version of SQL Server. |
||
|
40517 |
16 |
Keyword or statement option '%.*ls' is not supported in this version of SQL Server. |
||
|
40518 |
16 |
DBCC command '%.*ls' is not supported in this version of SQL Server. |
||
|
40520 |
16 |
Securable class '%S_MSG' not supported in this version of SQL Server. |
||
|
40521 |
16 |
Securable class '%S_MSG' not supported in the server scope in this version of SQL Server. |
||
|
40522 |
16 |
Database principal '%.*ls' type is not supported in this version of SQL Server. |
||
|
40523 |
16 |
Implicit user '%.*ls' creation is not supported in this version of SQL Server. Explicitly create the user before using it. |
||
|
40524 |
16 |
Data type '%.*ls' is not supported in this version of SQL Server. |
||
|
40525 |
16 |
WITH '%.ls' is not supported in this version of SQL Server. |
||
|
40526 |
16 |
'%.*ls' rowset provider not supported in this version of SQL Server. |
||
|
40527 |
16 |
Linked servers are not supported in this version of SQL Server. |
||
|
40528 |
16 |
Users cannot be mapped to certificates, asymmetric keys, or Windows logins in this version of SQL Server. |
||
|
40529 |
16 |
Built-in function '%.*ls' in impersonation context is not supported in this version of SQL Server. |
||
|
40532 |
11 |
Cannot open server "%.*ls" requested by the login. The login failed. |
||
|
40553 |
16 |
The session has been terminated because of excessive memory usage. Try modifying your query to process fewer rows.
|
||
|
40604 |
16 |
Could not |
||
|
40606 |
16 |
Attaching databases is not supported in this version of SQL Server. |
||
|
40607 |
16 |
Windows logins are not supported in this version of SQL Server. |
||
|
40611 |
16 |
Servers can have at most 128 firewall rules defined. |
||
|
40615 |
16 |
Cannot open server '{0}' requested by the login. Client with IP address '{1}' is not allowed to access the server. To enable access, use the SQL Database Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. |
||
|
40627 |
|
Operation on server '{0}' and database '{1}' is in progress. Please wait a few minutes before trying again. |
||
|
40636 |
16 |
Cannot use a reserved database name '%.*ls' in this operation. |
Database Copy Errors
The following table covers the various errors that you can encounter while copying a database in SQL Database. For more information, see Copying Databases in Windows Azure SQL Database.
| Error number | Severity | Description |
|---|---|---|
|
40635 |
16 |
Client with IP address '%.*ls' is temporarily disabled. |
|
40637 |
16 |
Create database copy is currently disabled. |
|
40561 |
16 |
Database copy failed. Either the source or target database does not exist. |
|
40562 |
16 |
Database copy failed. The source database has been dropped. |
|
40563 |
16 |
Database copy failed. The target database has been dropped. |
|
40564 |
16 |
Database copy failed due to an internal error. Please drop target database and try again. |
|
40565 |
16 |
Database copy failed. No more than 1 concurrent database copy from the same source is allowed. Please drop target database and try again later. |
|
40566 |
16 |
Database copy failed due to an internal error. Please drop target database and try again. |
|
40567 |
16 |
Database copy failed due to an internal error. Please drop target database and try again. |
|
40568 |
16 |
Database copy failed. Source database has become unavailable. Please drop target database and try again. |
|
40569 |
16 |
Database copy failed. Target database has become unavailable. Please drop target database and try again. |
|
40570 |
16 |
Database copy failed due to an internal error. Please drop target database and try again later. |
|
40571 |
16 |
Database copy failed due to an internal error. Please drop target database and try again later. |
Connection-Loss Errors
The following table covers the connection-loss errors that you can encounter while working with Windows Azure SQL Database. For more information, see General Guidelines and Limitations (Windows Azure SQL Database).
| Error number | Severity | Description | ||
|---|---|---|---|---|
|
10928 |
20 |
Resource ID: %d. The %s limit for the database is %d and has been reached. For more information, seehttp://go.microsoft.com/fwlink/?LinkId=267637. The Resource ID indicates the resource that has reached the limit. For worker threads the Resource ID = 1. For sessions the Resource ID = 2. |
||
|
10929 |
20 |
Resource ID: %d. The %s minimum guarantee is %d, maximum limit is %d and the current usage for the database is %d. However, the server is currently too busy to support requests greater than %d for this database. For more information, see http://go.microsoft.com/fwlink/?LinkId=267637. Otherwise, please try again later. The Resource ID indicates the resource that has reached the limit. For worker threads, the Resource ID = 1. For sessions, the Resource ID = 2. |
||
|
40197 |
17 |
The service has encountered an error processing your request. Please try again. Error code %d. You will receive this error, when the service is down due to software or hardware upgrades, hardware failures, or any other failover problems. The error code (%d) embedded within the message of error 40197 provides additional information about the kind of failure or failover that occurred. Some examples of the error codes embedded within the message of error 40197 are 40020, 40143, 40166, and 40540. Reconnecting to your SQL Database server will automatically connect you to a healthy copy of your database. Your application must catch error 40197, log the embedded error code (%d) within the message for troubleshooting, and try reconnecting to SQL Database until the resources are available, and your connection is established again. |
||
|
40501 |
20 |
The service is currently busy. Retry the request after 10 seconds. Incident ID: %ls. Code: %d.
|
||
|
40544 |
20 |
The database has reached its size quota. Partition or delete data, drop indexes, or consult the documentation for possible resolutions. Incident ID: %ls. Code: %d. |
||
|
40545 |
20 |
The service is experiencing a problem that is currently under investigation. Incident ID: %ls. Code: %d. |
||
|
40549 |
16 |
Session is terminated because you have a long-running transaction. Try shortening your transaction. |
||
|
40550 |
16 |
The session has been terminated because it has acquired too many locks. Try reading or modifying fewer rows in a single transaction.
|
||
|
40551 |
16 |
The session has been terminated because of excessive TEMPDB usage. Try modifying your query to reduce the temporary table space usage.
|
||
|
40552 |
16 |
The session has been terminated because of excessive transaction log space usage. Try modifying fewer rows in a single transaction.
|
||
|
40553 |
16 |
The session has been terminated because of excessive memory usage. Try modifying your query to process fewer rows.
|
||
|
40613 |
17 |
Database '%.*ls' on server '%.*ls' is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID of '%.*ls'. |
Federation Errors
The following table covers the errors that you can encounter while working with federations. For more information, see Managing Database Federations (Windows Azure SQL Database).
| Error number | Severity | Description | Mitigation |
|---|---|---|---|
|
266 |
16 |
<statement> statement not allowed within multi-statement transaction |
Check that trancount is 0 on the connection before issuing the statement |
|
2072 |
16 |
Database '%.*ls' does not exist |
Check sys.databases for the database state before issuing USE FEDERATION |
|
2209 |
16 |
%s Syntax error near ‘%ls’ |
FEDERATED ON can only be used when creating tables in federation members. |
|
2714 |
16 |
There is already an object named ‘%.*ls’ in the database |
Federation name already exists |
|
10054, 10053 |
20 |
A transport-level error has occurred when receiving results from the server. An established connection was aborted by the software in your host machine |
Implement retry logic in your application |
|
40530 |
15 |
<statement> needs to be the only statement in the batch |
Ensure that no other statements are in the batch |
|
40604 |
16 |
Could not CREATE DATABASE because it would exceed the quota of the server |
Expand the server db count quota |
|
45000 |
16 |
<statement> operation failed. Specified federation name <federation_name> is not valid |
Federation_name does not comply with federation name rules or is not a valid identifier |
|
45001 |
16 |
<statement> operation failed. Specified federation name does not exist |
Federation name does not exist |
|
45002 |
16 |
<statement> operation failed. Specified federation key name <distribution_name> is not valid |
Non-existent or invalid federation key |
|
45004 |
16 |
<statement> operation failed. Specified value is not valid for federation key <distribution_name> and federation <federation_name> |
USE FEDERATION:Use a boundary value that is in the domain of the federation key data type, or that is not NULL. ALTER FEDERATION SPLIT: Use a valid value in the domain of the federation key that is not already an existing split point ALTER FEDERATION DROP: Use a valid value in the domain of the federation key that is already a split point |
|
45005 |
16 |
<statement> cannot be run while another federation operation is in progress on federation <federation_name> and member with id <member_id> |
Wait for the concurrent operation to finish |
|
45006 |
16 |
<statement> operations failed. Foreign key relationships in reference tables referencing federated tables are not allowed in federation members |
Unsupported |
|
45007 |
16 |
<statement> operation failed. Foreign key relationships between federate tables must include the federation key column(s). |
Unsupported |
|
45008 |
16 |
<statement> operation failed. Federation key data type does not match the column data type |
Unsupported |
|
45009 |
16 |
<statement> operation failed. The operation is not supported on filtering connections |
Unsupported |
|
45010 |
16 |
<statement> operation failed. Federation key cannot be updated |
Unsupported |
|
45011 |
16 |
<statement> operation failed. Federation key schema cannot be updated |
Unsupported |
|
45012 |
16 |
Value specified for the federation key is not valid |
Value must be in the range that the connection is addressing. If filtered, the federation key value specified. If unfiltered, the range covered by the federation member |
|
45013 |
16 |
The SID already exists under a different user name |
The SID for a user in a federation member is copied from the SID of the same user account in the federation root. Under certain conditions, the SID may already be in use. |
|
45014 |
16 |
%ls is not supported on %ls |
Unsupported operation |
|
45022 |
16 |
<statement> operation failed. Specified boundary value already exists for federation key <distribution_name> and federation <federation_name> |
Specify a value that is already a boundary value |
|
45023 |
16 |
<statement> operation failed. Specified boundary value does not exists for federation key <distribution_name> and federation <federation_name> |
Specify a value that is not already a boundary value |
SQL Database Throttling and Decoding Error Codes
SQL Database provides a large-scale multi-tenant database service on shared resources from thousands of physical machines. Each physical machine can service many databases. When there are enough resources on a machine, all the databases located on the machine can take full advantage of the available resources. However, if resources run low, SQL Database selectively terminates the database sessions using excessive resources to provide a stable system and prevent sessions from monopolizing all the resources. SQL Database employs a built-in load-balancing technology to ensure the optimal usage of the physical servers in the data centers so that throttling could be minimized across all the machines. In addition, SQL Database employs a built-in throttling mechanism to protect the resources on a given machine, preventing any one database from starving the rest of the tenants on a given machine (or endangering the server itself).
Throttling immediately prevents the overuse of resources on a machine by any one tenant, and is intended to minimize the impact of usage spikes. There are two types of throttling: soft throttling and hard throttling. Soft throttling kicks in when machine resources such as, CPU, IO, storage, and worker threads exceed predefined safety thresholds despite the load balancer’s best efforts. SQL Database selects a subset of the databases consuming the most resources and throttles their activities. Not all the databases on the machine undergo throttling, just the ones using the most of the resources. This means those neighboring databases are protected from excessive usage from their neighbors. Usage below the predefined threshold indicates that there are plenty of resources for all the databases on the server. Hard throttling happens when the machine is out of resources, for example storage space. With hard throttling, no more new connections are allowed to the databases hosted on the machine until resources are freed up. SQL Database returns error messages for new connection attempts indicating the resource that has been exceeded.
Starting with SQL Database July 2011 release, the following error messages are enhanced to include a throttling incident ID:
-
40501: The service is currently busy. Retry the request after 10 seconds. Incident ID: %ls. Code: %d.
-
40544: The database has reached its size quota. Partition or delete data, drop indexes, or consult the documentation for possible resolutions. Incident ID: %ls. Code: %d.
-
40545: The service is experiencing a problem that is currently under investigation. Incident ID: %ls. Code: %d.
Beginning in late 2012, soft throttling on worker threads is changing. Over the next few months, soft throttling will eventually be replaced by worker thread governance. In the meantime, users may see requests failing due throttling on worker threads (error 40501) or worker thread governance (errors 10928 and 10929). The retry logic in your application should be modified to handle these errors. For more information, see http://go.microsoft.com/fwlink/?LinkId=267637.
Understanding Throttling Incident IDs
The throttling incident ID is a GUID value that uniquely identifies a throttling incident. If you get an error message including Incident ID: %ls, take a note of this incident ID and contact the Microsoft Customer Support for further investigation. Microsoft Customer Support will use this incident ID to retrieve more information related to your throttling incident. The incident ID can be used to get the following information:
-
The starting time of the throttling incident.
-
The type of throttling (soft throttling vs. hard throttling).
-
The resource type (for example, CPU) due to which the throttling incident is hit.
-
What was the user running when this throttling incident happened?
After learning the underlying root cause from Support, you can make appropriate changes in your application.
Decoding Reason Codes
This section describes how to decode the reason codes that are returned by error code 40501 "The service is currently busy. Retry the request after 10 seconds. Code: %d.". The reason code (Code: %d) is a decimal number that contains the throttling mode and the exceeded resource type(s). The throttling mode enumerates the rejected statement types. The resource type specifies the exceeded resources. Throttling can happen on multiple resource types concurrently, such as CPU and IO.
The following diagram demonstrates how to decode the reason codes.
To obtain the throttling mode, apply modulo 4 to the reason code. The modulo operation returns the remainder of one number divided by another. To obtain the throttling type and resource type, divide the reason code by 256 as shown in step 1. Then, convert the quotient of the result to its binary equivalent as shown in steps 2 and 3. The diagram lists all the throttling types and resource types. Compare your throttling type with the resource type bits as shown in the diagram.
The following table provides a list of the throttling modes.
| Throttling mode code | Description | Rejected statement types | Statements that can still be processed |
|---|---|---|---|
|
0 |
No throttling |
None |
All |
|
1 |
Reject Update / Insert |
INSERT, UPDATE, CREATE TABLE | INDEX |
DELETE, DROP TABLE | INDEX, TRUNCATE |
|
2 |
Reject All writes |
INSERT, UPDATE, DELETE, CREATE, DROP |
SELECT |
|
3 |
Reject All |
All |
None |
As an example, use 131075 as a reason code. To obtain the throttling mode, apply modulo 4 to the reason code. 131075 % 4 = 3. The result 3 means the throttling mode is "Reject All".
To obtain the throttling type and resource type, divide the reason code by 256. Then, convert the quotient of the result to its binary equivalent. 131075 / 256 = 512 (decimal) and 512 (decimal) = 10 00 00 00 00 (binary). This means the database was throttled due to CPU (Resource Type 4) and Hard Throttling (10).
See Also
Note