Press "Enter" to skip to content

Category: Error Handling

Accessing Home Assistant’s InfluxDB Instance from R

Martin Stingl looks for some data:

I’m running a HomeAssistant instance at home. I’ve configured it to log data into an InfluxDB database, so I can retrieve historical data for analysis later on. In default mode HomeAssistant would aggregate historical data for storage reasons.

So now I want to access the InfluxDB database from R to perform custom analyses. HomeAssistant is still using InfluxDB version 1. To connect to InfluxDB from R, I thought I can use the influxdbr package. But I got some errors because this package seems to be outdated.

Read on for the error message and how Martin was able to get around this. H/T R-Bloggers.

Leave a Comment

DACPAC Deployment Misleading Entra ID Error

Koen Verbeeck troubleshoots an issue:

While deploying a DACPAC (from a SQL Server Data Tools Database Project) through Azure Devops, I got the following error message:

The user attempting to perform this operation does not have permission as it is currently logged in as a member of an Azure Active Directory (AAD) group but does not have an associated database user account. A user account is necessary when creating an object to assign ownership of that object. To resolve this error, either create an Azure AD user from external provider, or alter the AAD group to assign the DEFAULT_SCHEMA as dbo, then rerun the statement.

Read on to see what happened in Koen’s case. This is an example of a generic error message hiding relevant information from us.

Leave a Comment

An Error with Log Shipping in an Contained Availability Group

Rich Benner diagnoses an issue:

We’ve recently come up across a fun little bug with log shipping in contained availability groups. A cursory Google search did not bring up any useful posts for troubleshooting, so here we are. If you’re here for the bug, feel free to scroll to the bottom of this post. For the rest of you, however, let’s add a little context to this scenario before getting to the meat of the situation.

Click through for the issue, as well as how Rich was able to resolve the problem.

Comments closed

“The Parameter is Incorrect” with Copy-DBACredential

Jack Corbett diagnoses a problem:

I was working with a client to do an upgrade/migration from SQL Server 2016 to SQL Server 2022, and this client assigns non-default ports to SQL Server.  As part of the process, I had to create a credential on one node and needed it on the other node, so I went to the handy Copy-DBACredential dbatools cmdlet, but it didn’t work.

Read on for the troubleshooting process and the ultimate issue.

Comments closed

Tracking Failed SSRS Subscriptions

Svetlana Golovko wants a report of failing reports:

We would like to get notifications if any SSRS report subscriptions fail. This feature was working great until it wasn’t. The scheduled SSRS subscription in the SQL Server Agent job didn’t fail and we were not aware of any failures. In some cases, a partial data driven subscription failed.

Moreover, after some testing we realized that the SQL Server Agent job won’t fail for the Standard subscriptions (that are available in SQL Server Standard Edition) either.

Read on to see what happens when a report subscription delivery fails and how you can get details on the failure.

Comments closed

Error Handling in Powershell with ErrorAction

Patrick Gruenauer decides to continue:

Error handling is an important part of scripting and automation, and PowerShell provides robust tools for managing errors efficiently. One of the key features for error management in PowerShell is the ErrorAction parameter. This blog post will dive into the ErrorAction parameter, explaining its usage and providing practical examples to illustrate its usage.

Read on to see the five available options and a pair of examples.

Comments closed

Error Handling in PySpark Jobs

Ram Ghadiyaram adds some error handling logic:

In PySpark, processing massive datasets across distributed clusters is powerful but comes with challenges. A single bad record, missing file, or network glitch can crash an entire job, wasting compute resources and leaving you with stack traces that have many lines. 

Spark’s lazy evaluation, where transformations don’t execute until an action is triggered, makes errors harder to catch early, and debugging them can feel like very, very difficult.

Read on for five patterns that can help with error handling in PySpark.

Comments closed

Set MAXDOP in Azure SQL DB

Brent Ozar has a public service announcement:

In Azure SQL DB, you set max degrees of parallelism at the database level. You right-click on the database, go into properties, and set the MAXDOP number.

I say “you” because it really is “you” – this is on you, bucko. Microsoft’s magical self-tuning database doesn’t do this for you.

And where this backfires, badly, is that Azure SQL DB has much, much lower caps on the maximum number of worker threads your database can consume before it gets cut off. 

Click through to see what kind of error message you get and just how low these limits are.

Comments closed

Finding Rows with Errors in Power Query

Gilbert Quevauvilliers goes around looking for trouble:

In the past when there has been an error when loading data into the semantic model, there can be times when clicking on the View errors can either take a very long time to show those errors. Or in some cases it never shows you the error.

In this blog post I am going to show you an alternative way to quickly find the errors.

The column quality data preview option is absolutely worth keeping on at all times.

Comments closed

RAISERROR vs THROW

Andy Brownsword looks at the two ways to bubble up an error in SQL Server:

I don’t use RAISERROR often – I usually forget which severity code to use. After looking at a sprinkling of them recently I decided it was time for a refresher, so come along for the ride.

If you check out the online documentation it states that “New applications should use THROW instead”. It also sounds like its used to raise ‘RROR’s (whatever they are?). Neither are quite the whole story though. Let’s get into it.

My general rule of thumb is that I tend to use THROW most of the time, but RAISERROR in loops so that I can print out how far along in the process something is, as there is no WITH NOWAIT equivalent to THROW. Andy mentions using THROW; without additional parameters, and that’s very helpful when you want to maintain the original error message rather than wrapping your own around it. It’s not quite as useful as a re-throw in a language like C#, where you keep stack trace information, but helps with troubleshooting.

As for not doubling the letter if it is the last letter of the first word and first letter of the second word (raise error or help protect), it was the fashion at the time, like wearing a yellow onion on your belt. I suppose the intent was to prevent typos or make it look slightly better, but I’ve never been a fan.

Comments closed