Send database test E-Mail exception - lock request time out period exceeded - sql-server

I am troubleshooting an error with database mail, and when I went to management->database mail to send a test e mail, I get the following erorr:
An exception occured while executing a Transact-SQL statement or batch.
(Microsoft.SQLServer.ConnectionInfo)
Additional information:
Lock request time out period exceeded
The statement has been terminated (Microsoft SQL Server, Error: 1222)
When I investigate this further by looking at all blocking transactions on msdb, I find one transaction, that has the name "implicit transaction". Is this the one which is blocking? What can I do?

Ok I found out what happened by looking at all transactions (right click -> reports -> all transactions). From there I found that a server user had a locking transaction open. After making him close it, everything went fine.

Related

Connecting to Snowflake with DataGrip fequent timeout errors

When working with Snowflake through DataGrip I often get the following timeout error:
JDBC driver encountered communication error. Message: Exception encountered for HTTP request: Operation timed out.
Usually on a second attempt it will be fine, but I always need to wait for this timeout to occur before I can do anything. If I continue to run queries after getting the initial connection it will be fine, but if I was to leave the application for a few minutes, again when I come back it struggles to re-connect for the next query.
My suspicion is that this occurs when the Snowflake warehouse is suspended. It seems like it is waiting on some acknowledgment that the warehouse has been resumed.
Has anyone else encountered this?

SQL Server Managed Backup for Windows Azure (SSMBackup2WA) stuck waiting for progress update

I have a database running on an azure vm with sql server. The db is in full recovery mode. The backup is configured through the web interface. Database and log backups have been working flawlessly for years. But recently the log backup was interrupted halfway through and the log backup process somehow got stuck. The following event has been logged every 5 minutes since then (reading log with managed_backup.sp_get_backup_diagnostics):
[SSMBackup2WAAdminXevent] Database Name = DB, Database ID = 777, Stage =
VerifyJobOutcome, Error Code = 0, Error Message = Warning, Additional Info = A
progress update hasn't been received from SQL Server in more than 30 minutes
for log backup. SSMBackup2WA will continue to wait.
SSMBackup2WA seem to be stuck waiting for a progress update never being received. This has resulted in no log backups being taken. The database backup have continued running without problem.
I have trouble finding the job/task used by SSMBackup2WA. I understand its not in the usual batch of SQL Server Agent jobs but somehow hidden.
My idea is to somehow cancel the existing job that is stuck in waiting loop but I have not figured out how.
I have tried to "reset" the backup process by turning off the backup and then turning it on again but that did not help.
I have no possibility to restart the sql server (and I don't know if that would help).
So since no one seemed to have an answer to this one I resorted to restarting the SQL-server. And after the restart the transaction log backup started working again!
What is interesting is the following log that appeared in the application event log during the restart. It does seem like there was a thread hanging indefinitely, waiting for an status update that never arrived. The restart seems to have taken care of it by killing this status thread and not restarting it again in the erroneous state it had ended up in.
Log Name: Application
Source: Microsoft SQL Server Automated Backup
Date: 1/15/2022 11:16:20 AM
Event ID: 57007
Task Category: None
Level: Warning
Keywords: Classic
User: N/A
Computer: wn-sqlserver1
Description:
[Warning] AutomatedBackupStatusMonitorError:
System.Exception:
Error in auto-backup status monitor thread --->
Microsoft.SqlServer.Management.IaaSAgentSqlQuery.Contract.IaaSAgentSqlQueryException:
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not
found or was not accessible. Verify that the instance name
is correct and that SQL Server is configured to allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could
not open a connection to SQL Server) --->

Can't get to next stage of Kentico application configuration

I'm trying to get my web application up and running. It uses Kentico. I connected to the admin page which is taking me through the initial database ans site setup. It ran through "Creating database objects". I can see the tables are now in the database. The "Next" button hasn't become active.
This error is in the Creating database objects log:
at CMS.DataEngine.SqlInstallationHelper.ImportDefaultData(IDataConnection connection, String dataFolder, LogMessage log, String defaultErrorMessage)
at CMS.DataProviderSQL.DataConnection.BulkInsert(DataTable sourceData, String targetTable, BulkInsertSettings insertSettings)
at CMS.DataEngine.AbstractDataConnection.HandleError(String queryText, Exception ex)
The statement has been terminated.
Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Caused exception:
BulkInsert to table 'BadWords_Word'
Query:
[DataConnection.HandleError]:
ERROR: An error occurred:
data\badwords_word
objects/proc_personas_reevaluateallcontacts
...
objects/cms_resource
How can I get past this?
Increase the timeout for your connection string in your web.config file to something like 600 then try again.

What is MSSQL exception code for "SHUTDOWN is in progress. Login failed for user ''XXXX''. Only administrators may connect at this time."

I want to know the SQL Exception error code for the above exception. It occurs when there is an unexpected sql cluster service shutdown, and an application tries to access the server.
These are two separate messages: "SHUTDOWN is in progress" (code 6005) and "Login failed for user '%.*ls'. Only administrators may connect at this time.%.*ls" (code 18451). You can determine this by querying sys.messages:
select * from sys.messages
where [text] like '%only administrators%' or [text] like 'SHUTDOWN is in progress%'
and language_id = 1033
Because "SHUTDOWN is in progress" has severity 10, it's merely informational and will not result in an exception. "Login failed" will, however (and the "SHUTDOWN" message will be incorporated into it).
Note that if your server has already shut down, or is in the process of shutting down and its network name is no longer accessible, you can get other errors during the connection attempt that aren't generated by the server. Looking for this error is not a reliable way of detecting a shutdown condition, and you probably shouldn't have special-case logic for it.
ERROR 6005 - Shutdown is in progress
List of errors in this group: http://www.sql-server-helper.com/error-messages/msg-6001-7000.aspx
Likely related to SQL Server cluster

SqlClient.SqlException .Number = 3617 .State = 68

We are receiving this exception from one of our sql select statements. I cannot find error 3617 in the sysmessages table. The .Class is 25. There is no message.
We know we are getting it on Sql server 2005 servers.
I do know that this is large select that joins several tables and uses the CLR to combine and order some data.
What could be causing this error or where I could find out what the error code means?
Take a look at this: Discussion on Microsoft forums, see the answer from the moderator last in the post.
Updated: (added text from forum post):
Error code 3617 is a system attention. A system attention occurs
when the client cancels a running request. This can happen if the
command times out for example. This error is normally not sent to the
client however.
There is a special case where this can occur that you may be hitting.
When you re-use a pooled connection, the first outbound request sends
a special bit flag on the request to tell the server to reset the
connection state prior to executing the request. This bit causes the
server to first clear connection state, then execute the command. If
your SQL Server is under heavy load, and this bit is set, and it takes
a long time to reset the connection state, the client may timeout and
send the system attention. This causes the reset of the connection to
be cancelled and in this case you can see the 3617 sent to the client.
We've recently hardened this code in current release to avoid sending
back this specific error code as the error is spurious in nature
(based on timing you may or may not get this error). In any case, you
can consider this error equivalent to: "A severe error occurred on the
current command. The results, if any, should be discarded. Operation
cancelled by user."
To verify if it is this issue, examine your SQL errorlog for error
like below:
spid51 Task abort was requested while attempting to reuse a session with SPID 51, which has been reset for connection pooling. The session
will be terminated.

Resources