SQL Server Agent - BCryptDecrypt failed - sql-server

I'm using SQL Server 2016 and in the SQL Server Agent event log, I have thousands of error's with the following message:
Date 26/12/2019 3:47:06 PM
Log SQL Server Agent (Current - 16/12/2019 4:28:00 PM)
Message
[442] BCryptDecrypt failed (-1073741762).
I can't find anything that relates to this error and there doesn't seem to be anything wrong that I can see except for the message - does anyone know what it is and how I could potentially fix it?
Thank you

I found the issue.
We use to use managed backups to Azure blob for our DB's - we canned this method for our on prem servers and went another path - however when we swapped over we didn't disable managed backups on the server and we deleted our storage account within Azure. This in return was throwing these weird errors up.
You can't disable managed backup's on your DB's if your storage account in Azure is gone - i had to recreate the storage account with the same naming convention and recreate the blob - update the SAS key in your credentials - then you can disable managed backups.
Hope this helps others.

Related

Excel connection to database, problem when shared in One Drive

Not sure if this is the correct forum but here goes. Very new to databases so apologies ahead of time if I don't provide enough info.
I have a Microsoft SQL Server Database created with Microsoft SQL Server Management Studio 18, I connected Excel to it to analyse the data and saved that workbook in a shared One Drive folder. Works fine on my computer but the other users cannot refresh the data from the database. I've exhausted all my online search options to figure out how to fix this. I don't know if the database is on a cloud server or if that matters.
Error message is; [Datasource.Error] Microsoft SQL: 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; SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
The database does allow for remote connections, I checked that.
I'm comfortable with Excel but I'm new to databases, only worked with Access in the past. Anyone know of the "best" way to have a database we can all (4 users currently) connect to while also connecting Excel to it.
I don't understand the pricing plans for Azure, AWS etc. plus they seem to be way more than what I need.
Doesn't have to be a free option but a set monthly fee with no surprises would work if a server is the issue. It's a relatively small amount of data, currently maybe 100 rows, 24 columns.
The option I last came across was Godaddy web hosting had a database option, don't if this is a good option or not. I signed up for Elephantsql but I haven't figured out how to use that to host the database, creating one in elephant itself seems to use only code rather than the way I created the database in Microsoft.
Thanks in advance for any help, going to go close my 25 google search tabs now.....
Kevin
do you realy need an SQL-Server for dataset auf 100 rows and 24 columns?
I would try do store the date in a shared Excel-File in Onedrive an connect to this.
Best regards
Chris
EDIT
If you want to connect to Private-OneDrive File you should use a WEB-Connector instead of a "File"-Connector.
Your Source should be like this:
=Excel.Workbook(Web.Contents("https://onedrive.live.com/download?resid=AAAXXXXAAA&authkey=BBBXXXXBBB&em=CCCXXXXCCC&app=Excel"), null, true)
You have to replace the AAAXXXXAAAA; BBBXXXXBBB and CCCXXXXCCC with informations from the embedded-link of your XLSX-File:
1) open OneDrive in WEB
2) Select you file and right-click
3) click "embedded"
4) in the right pane you find the embedded-link
5) find there the resid; authkey and em
OneDrive GetEmbeddedLink

Azure Serverless SQL Serverless Database

I Created SQL Server Database in Azure which is serverless and tried to access it using my SQL Server Management Studio in my local but I couldn't get it work.
It always gives me this message:
I tried to whitelist also my IP in Azure but still I get the same result.
Is there a possible way to make it connect?
Is the database currently online or paused?
I'll repeat the text from #David Browne's link:
If a serverless database is paused, then the first login will resume the database and return an error stating that the database is unavailable with error code 40613. Once the database is resumed, the login must be retried to establish connectivity. Database clients with connection retry logic should not need to be modified.
So;
Assuming the database is paused, this is normal operation
Please read docs
You need to retry after the database starts OR manually pre-start it using the Powershell provided in the link below
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-serverless#connectivity
And yes, you also need to whitelist your IP address as you have already done.
Obviously this flavour of SQL is unsuitable for some types of applications - there is more information in the link - I suggest you read the whole thing.

Snapshot agent not starting SQL Server error 15404 error code 0x54b

I have run into this issue and I am stuck with it for hours. I have 2 databases one which is publisher and distributor and second which is subscriber I am going to use them as snapshot replication. Installation went without issues but when I look in Replication monitor publication status is ok but a subscription is "uninitialized subscription".
I checked sqlagent errorlog and I get same error
Error: 15404, Could not obtain information about Windows NT group/user'MicrosoftAccount\MyEmail', error code 0x54b.
[SQLSTATE 42000] (ConnIsLoginSysAdmin).
This really boggles me since I am being logged to the database through windows authentication but I am being seen as ADMINRG-XXXXXX\YYYYY.
In my security properties on "Specify the domain or machine account under which Distribution/Snapshot Agent will run" I have set it on Run under SQL Server Agent service account, but when I tried using windows account either ADMINRG-XXXXX\YYYYY or MicrosoftAccount\MyEmail It puked out error 3930 which I also couldn't manage to fix.
I also looked in generated scripts when I was installing publication and subscriptions, they both have parameters #job_login and #job_password set to null could this be source of issue?
If anyone is curious how I fixed it.I looked up in generated scripts at #job_login and #job_password I used my Microsoft account that is connected to my Windows account.Snapshot agent is starting up now, everything works fine. Homever I still get same error in logs tho it doesn't affect anything.

Merge replication unintialized subcription is expired or does not exist

I am trying to set up a merge replication using web synchronization between a publishing SQL Server 2012 standard and subscribing SQL Server 2012 Express. After following the instructions provided at Technet, I am stuck on this:
Source: Merge Process(Web Sync Server)
Number: -2147200985
Message: The subscription to publication 'MyMergePublication' has expired or does not exist.
I already verified that SSL certification are good, that I can browse to the publishing machine's URL https:\\mycomputer\replisapi.dll and get the expected output. I already verified that snapshot was set up and I took a giant hammer & use an administrator account to run the pool identity which is really bad security-wise but wanted to validate that it was not security that was tripping me up.
To further the mystery, when I try and fail to sync, the publisher acknowledges that a new subscriber has been registered, but it cannot get the snapshot at all and thus subscriber database is still empty.
On the replication monitor, there are no failed synchronization history, or any errors; all it has to say is that the subscriber is uninitialized, and no more.
Turning up the verbosity of the merge agent, I saw some sql being executed and tried replicating the sql and i found this was failing with same error:
{call sys.sp_MSgetreplicainfo(?,?,?,?,?,?,?,90)}
I called it with only the 3 mandatory parameters supplied and it would fail. That is despite the prior call sp_helpmergepublication does return a row for that publication. Oddly, the content of sp_helpmergepublication does not match what I configured for the subscription (e.g. it says web url is null when viewing the properties correctly shows the web url being set). Not sure that is significant.
The content of sp_MSgetreplicainfo contains a call to another system sprocs that I cannot run for some reason (says not found) so I'm not sure what is actually going on here.
Any clues would be greatly appreciated.

How to debug SQL Server 2014 Managed Backup to Azure?

I'm hoping to configure and use SQL Server 2014's Managed Backup to Azure feature. I've tested a manual backup to URL T-SQL query, and it worked. But, the backups created by the managed backup to Azure feature are failing to finish.
The managed backup process leaves a bunch of 0 byte backup files on Azure storage, and they're all locked (active leases) because of the failed backup process. I'm trying to figure out what the issue is. My SQL Server 2014 edition is the Web edition, which apparently does not support compression. The SQL Server Management Studio dialog for configuring the managed backup to Azure feature does not provide any options for compression, though. So, perhaps it's trying to compress the backup file and failing? I don't know how to see what's actually being tried by SQL Server while it does its automated backup to Azure, though. Anybody have any ideas there?
I'm seeing the following errors in the event log ...
Date 10/1/2014 3:10:39 PM
Log SQL Server (Current - 10/1/2014 2:42:00 PM)
Source Backup
Message
BACKUP failed to complete the command BACKUP LOG CaseLaw. Check the backup application log for detailed messages.
Date 10/1/2014 3:12:01 PM
Log SQL Server (Current - 10/1/2014 2:42:00 PM)
Source spid71
Message
Error: 18210, Severity: 16, State: 1.
Date 10/1/2014 3:12:01 PM
Log SQL Server (Current - 10/1/2014 2:42:00 PM)
Source spid71
Message
BackupVirtualDeviceFile::DetermineFileSize: SetPosition(0,EOF) failure on backup device 'https://caselaw.blob.core.windows.net/sqldb01-mssqlserver/CaseLaw_d68e6c91feba4f7f891a66cb86fcce8d_20141001151038-05.log'. Operating system error Backup to URL received an exception from the remote endpoint. Exception Message: The remote server returned an error: (409) Conflict..
I can't read the full 409 error message, so I've got no idea what the actual 409 error is. According to MSDN, there are multiple possible 409 responses.
I have been struggling with this issue for several days. I tried a manual scheduled task that runs my T-SQL query, which works, but I can't have it automatically clean itself up after X days, using that method. Any ideas? Thanks!
This is indeed related to COMPRESSION being set on the backup command that gets called by the Managed Backup process.
Enabling debug messages pointed me to the stored procedure getting called: [msdb].[smart_admin].[sp_do_backup]. If you look inside this stored procedure you will see "COMPRESSION" hard coded into the various backup commands that it issues.
A find and replace for "COMPRESSION" to "NO_COMPRESSION" should fix your issue.
Note this only need apply to SQL 2014 Web Edition, as other versions support compression, and this shouldn't even come up.

Resources