SSRS Subscription failure rsProcessingAborted - sql-server

I have subscriptions that are failing to run giving the error:
Failure sending mail: An error has occurred during report processing.Mail will not be resent.
The report runs fine when requested manually through the server so I know the datasource and connection work.
Inside the SSRS database the only information I can get is from the ExecutionLogStorage saying:
rsProcessingAborted
The ExecutionLogStorage table also shows the TimeStart and TimeEnd being 1 second apart, on a report that takes 2+ minutes to run manually. The report has not failed a single time when running manually, only fails through the subscription.
The windows event viewer does contain some errors about a TERADATA extension but they do not coincide with the subscription failures.
The logs located in \Program Files\Microsoft SQL Server\MSRS10_50.Reporting\Reporting Services\LogFiles do not even contain an entry for that subscription during failure at all.
I'm not sure where to go for more information, I need to know why this subscription is failing, we have the workaround of manually running the report and manually emailing it out after converted to excel but that's not a viable solution going forward.

Some other places you could check are:
SSRS Log:
c$\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\LogFiles
You could try enabling verbose logging (level 4) here
C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin\ReportingServicesService.exe.config
Look for this tag:
<switches>
<add name="DefaultTraceSwitch" value="4" />
</switches>
I'm fighting very similar issue but to make it a bit complex, my subscription fails only every other time or so and runs fine sometimes. So far I ruled out:
No. of parallel SSRS sessions
Memory pressure on DB server & Report
Server Kicking off the subscription directly vs remotely(running
the agent job)
Sorry, I do not have a good answer for you but this issue seems to bother more than few people.
Update:
I found out that the Subscription was a created by a windows user who is no longer valid (ID expired). Updating the Subscription owner fixed it.
-- List SSRS users (check to make sure the new Owner exists in this list)
SELECT *
FROM Users
WHERE UserName IN ('DomainName\_SSRSServiceAccount')
-- DFGRYH-DFGRYH--DFGRYH-DFGRYH
-- Identify the subscription whose ownership you would like to edit
SELECT *
FROM Subscriptions
WHERE OwnerID = 'DFGRYH-DFGRYH--DFGRYH-DFGRYH'
AND Description = 'Send e-mail to RichG#DomainName.com'
ORDER BY LastRunTime
,LastStatus
-- Update the Subscription with new Owner, the change should reflect on the SSRS reports
UPDATE Subscriptions
SET OwnerID = 'DFGRYH-DFGRYH--DFGRYH-DFGRYH'
WHERE SubscriptionID = 'B33A78FC-933D-47DB-AB50-43D36B24C0B8'

Related

SSRS 2017 subscriptions stopped working after installing KB4583457

2 weeks ago we installed KB4583457 on SQL Server 2017 Standard (14.0.3294.2). For some reason, it broke something in the system databases of SQL Server and the server became unavailable. We had to uninstall this update to resolve the issue. It helped and everything, except SSRS subscriptions, started working fine again. But SSRS subscriptions behave weird since then. No email has been sent and if we try to trigger any subscription manually (using [Run Now] button), it doesn't work, or to be more precise - it gets stuck in 'Running' state.
I realize something's probably wrong with our instance of SQL Server/SSRS. But I'd really appreciate if someone can suggest an idea or advise what else we can check. Here's what we've checked so far:
Logs of SSRS in Program files - nothing there.
Windows events logs - nothing relevant there.
SQL Configuration Manager - all services (except SQL Server Browser) are up & running.
Reporting Services Configuration Manager - nothing has changed and everything looks OK.
SSRS Web Portal - the reports work as expected, including the export to various formats.
SSRS API - no issues.
The history of SQL Agent jobs created by SSRS subscriptions - all jobs continue to run by schedule. So the history of SQL agent jobs is not consistent with what is displayed on SSRS portal in the 'Last run' column of any subscription.
The owner of all SQL agent jobs linked to SSRS subscriptions is 'NT SERVICE\SQLServerReportingServices', which has db_owner permissions to ReportServer and ResportServerTemp databases.
ReportServer database - we used the script bellow to find any clue that might point us in the right direction. But it doesn't show any useful error messages.
select
c.Name as Report,
s.LastRunTime,
s.SubscriptionID,
s.*
from [ReportServer].[dbo].[Subscriptions] as S
inner join [ReportServer].[dbo].[Catalog] as c
on c.ItemID = s.Report_OID
order by s.LastRunTime desc
If someone has any other ideas, please feel free to share.
Thanks, it turned out the issue was related to the permissions of NT Service\SQLServerReportingServices user. The screenshot below shows what had to be updated - Execute permission on dbo.sp_verify_job_identifiers stored procedure. Hopefully it will save someone hours or even days.
It's important to note we would be able to identify the root problem earlier if we had looked through the Logs of SSRS in Program files folder not only for the current day but also the old ones.
C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\LogFiles

Snowflake SSRS ODBC error : No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command

I'm using SSRS (SQL Server reporting services) to display reports, my datasource is Snowflake
I have installed the ODBC snowflake driver and configured it properly
Click here to view the ODBC configuration
I have created a shared datasource on the SSRS server (via Report manager) and put in my own credentials and the connection works fine
Click here to view the connection on the SSRS Server
I'm able to build the SSRS report without any issues, when I run the report, everything works fine, I can publish the report on the server and the report renders perfectly fine on the browser
The issue is when i go back to the report the next day, i'm presented with an error:
An error has occurred during report processing. (rsProcessingAborted)
Query execution failed for dataset
'insert_name_of_my_dataset_here'. (rsErrorExecutingCommand)
ERROR [57P03] No active warehouse selected in the current session.
Select an active warehouse with the 'use warehouse' command.
So, this also means that the following doesn't work neither:
Subscriptions
Cache refresh
Snapshots
The only thing that works is if I open my report in SSRS Report builder, I right-click EACH of my datasets ("each" is very important, it doesn't work if i don't do all of them), I run the queries manually for each of them, and then the "connection" or "session" is "re-activated" and the report runs fine, both locally AND on the server...note i do not have to re-publish the report on the server for it to run
Click here to view screenshots of my process
Steps I have taken to addresss the issue (that didn't yield any resolution):
I have tried putting the "use warehouse WAREHOUSE_NAME;" command before each dataset's SQL script, but Snowflake's API doesn't allow multiple SQL commands to be sent, so I already saw that this functionality was in the development pipeline for Snowflake and found this link: https://github.com/snowflakedb/snowflake-connector-net/issues/33 - this work was started in 2018 and the last update dates from Apr 2019 that says they are starting to address the JDBC driver...no mention for the ODBC driver yet
I have set the snowflake parameter client-session-keep-alive to true (https://docs.snowflake.com/en/sql-reference/parameters.html#client-session-keep-alive), but according to the community portal: A similar "keep alive" parameter is not currently available for the ODBC driver. Instead, you could issue a dummy query every few hours to keep the connection alive. (https://community.snowflake.com/s/article/faq-how-long-can-my-jdbcodbc-connection-remain-idle)
List item
I have tried to create a cache refresh plan or a snapshot schedule that creates a snapshot or caches the report every 3 hours, and it works for the first schedule, but fails with the error for the other ones
The only thing I didn't try is to have snowflake never close the connection and keep the warehouse in the "started" state indefinitely...but this would increase my cost, and i'm pretty sure it won't work since the session would end anyways after 4 hours...
Any assistance is welcome!
Thanks
Specs:
SSRS 2014
Snowflake X-small
ODBC-64 bit driver, installed from the
snowflake driver repository (tested with 32-bit also, but 64-bit is
the one that is visible to SSRS)
I faced the same kind of issue and fixed adding the corresponding role with the data warehouse.
In the data warehouse add role with USAGE.
Could it be related with the data warehouse name (in the ODBC settings)? Is there a typo? COSNUMER_WH or CONSUMER_WH?
I strongly recommend setting default "context" configurations for situations like this, setting default role, warehouse, database, and schema with commands such as this:
ALTER USER xyz SET DEFAULT_WAREHOUSE = 'WH_NAME_HERE' ;
https://docs.snowflake.com/en/sql-reference/sql/alter-user.html

SSRS Report Server - Email on failure?

My company uses SSRS to deliver reports to users, either by email subscriptions or by the user opening the Report Server page in their browser and clicking on the report they want, which then runs it against the db. I call this "Interactive mode".
My users are supposed to tell me when a report fails, so I can go fix it, but most of the time they don't.
So I need to go looking for failed reports. I can already see which email subscription reports have failed using the subscriptions report in SSRS, but I need a way to either generate an email or log a row to a table whenever one of the interactive mode reports fails.
I can't see anything obvious in Visual Studio that would allow me to do this, has anyone come up with a solution for this before?
By default SSRS maintains the subscriptions and errors info within Report server database.
Subscriptions is catalog info table of all subscriptions in Report Server
SubscriptionHistory maintains the extended details of the error.
Using following script, you can monitor the last status of all subscriptions at one place, rather than going through SSRS web interface. also, you could develop your own script based on this:
select c.ItemID as ReportItemID,
c.Name as ReportName,
c.Path as ReportLocation,
s.Description as SubscriptionTitle,
EventType,
LastRunTime,
LastStatus,
CreationDate
from Subscriptions as s
join Catalog as c on s.Report_OID = c.ItemID
Where LastStatus like '%failed%'
or LastStatus like '%Error%'
and (NOT LastStatus like '%0 Errors.')
GO
It turns out there's a very helpful table in the ReportServer database named "ExecutionLog" which has exactly these details.

SSRS Can not update subscriptions

Our SSRS server was recently moved to a new server. The database was copied over and everything is working fine.
However, I can no longer update any existing subscriptions. Creating new subscriptions works fine but when I try to update a subscription which existed before the change over I get the following error:
An internal error occurred on the report server. See the error for more details. (rsInternalError)
When I check the logs I can not see anything for the time of the update. When I look in the subscriptions table though, the modified date is the time of the update.
I am the owner of the report and my userId is the same as the old server.
Has something been missed when the server was changed?
Do I have to recreate subscriptions manually?
This error was caused by an error with the user permissions for sysadmin.
Adding “NT AUTHORITY\NETWORK SERVICE” as sysadmin in the SQL server instance resolved the issues.

SSRS Query execution failed for dataset

Have just deployed my Project on to my reporting Server.
I have multiple datasets which are referencing views which exist on the db on that server.
When I try to go into any report part I am getting this message:
An error has occurred during report processing. (rsProcessingAborted)
Query execution failed for dataset 'dataset1'. (rsErrorExecutingCommand)
For more information about this error navigate to the report server on the local server machine, or enable remote errors
Can anyone help?
I enabled remote errors to pinpoint the problem.
I identified that a column in a particular dataset (one of my views) was throwing an error.
So using a tool "SQL Delta", I compared the development version of the database with the live version on the reporting server. I noticed that one of the views had an extra column on the development server, that was not on the live version of the db.
SQL Delta generated the script I needed to run to update the view on my live db.
I ran this script, re-ran the report, everything worked.
I encountered a similar error message. I was able to fix it without enabling remote errors.
In Report Builder 3.0, when I used the Run button to run the report, an error alert appeared, saying
An error has occurred during report processing. (rsProcessingAborted)
[OK] [Details...]
Pressing the details button gave me a text box where I saw this text:
For more information about this error navigate to the report server
on the local server machine, or enable remote errors
----------------------------
Query execution failed for dataset 'DataSet1'. (rsErrorExecutingCommand)
I was confused and frustrated, because my report did not have a dataset named 'DataSet1'. I even opened the .rdl file in a text editor to be sure. After a while, I noticed that there was more text in the text box below what I could read. The full error message was:
For more information about this error navigate to the report server
on the local server machine, or enable remote errors
----------------------------
Query execution failed for dataset 'DataSet1'. (rsErrorExecutingCommand)
----------------------------
The execution failed for the shared data set 'CustomerDetailsDataSet'.
(rsDataSetExecutionError)
----------------------------
An error has occurred during report processing. (rsProcessingAborted)
I did have a shared dataset named 'CustomerDetailsDataSet'. I opened the query (which was a full SQL query entered in text mode) in SQL Server Management Studio, and ran it there. I got error messages which clearly pointed to a certain table, where a column I had been using had been renamed and changed.
From that point, it was straightforward to modify my query so that it worked with the new column, then paste that modification into the shared dataset 'CustomerDetailsDataSet', and then nudge the report in Report Builder to recognise the change to the shared dataset.
After this fix, my reports no longer triggered this error.
Like many others here, I had the same error. In my case it was because the execute permission was denied on a stored procedure it used. It was resolved when the user associated with the data source was given that permission.
I experienced the same issue, it was related to security not being granted to part of the tables. review your user has access to the databases/ tables/views/functions etc used by the report.
The solution for me came from GShenanigan:
You'll need to check out your log files on the SSRS server for more detail. They'll be somewhere like: "C:\Program Files (x86)\Microsoft SQL Server\MSRS10_50.DEV\Reporting Services\LogFiles\"
I was able to find a permissions problem on a database table referenced by the view that was not the same one as the where the view was. I had been focused on permissions on the view's database so this helped pinpoint where the error was.
I just dealt with this same issue. Make sure your query lists the full source name, using no shortcuts. Visual Studio can recognize the shortcuts, but your reporting services application may not be able to recognize which tables your data should be coming from. Hope that helps.
I had the similar issue showing the error
For more information about this error navigate to the report server on
the local server machine, or enable remote errors Query execution
failed for dataset 'PrintInvoice'.
Solution:
1) The error may be with the dataset in some cases, you can always check if the dataset is populating the exact data you are expecting by going to the dataset properties and choosing 'Query Designer' and try 'Run', If you can successfully able to pull the fields you are expecting, then you can be sure that there isn't any problem with the dataset, which takes us to next solution.
2) Even though the error message says "Query Failed Execution for the dataset", another probable chances are with the datasource connection, make sure you have connected to the correct datasource that has the tables you need and you have permissions to access that datasource.
In my situation, I created a new SSRS report and new stored procedure for the dataset. I forgot to add the stored procedure to the database role that had permission to execute it. Once I added the permissions to SQL database role with EXECUTE, all was fine!
The error message encountered by the user was "An error occurred during client rendering. An error has occurred during report processing (rsProcessingAborted). Query execution failed for dataset "DataSet1'. (rsErrorExecutingCommand) For more information..."
Very grateful I found this great post. As for my case, the user executing the stored procedure did not have EXECUTE permissions. The solution was to grant EXECUTE permissions for the user within the stored procedure by adding below code to the end of the stored procedure.
GRANT EXECUTE ON dbo.StoredProcNameHere TO UsernameRunningreports
GO
I also had a very similar issue with a very similar error message. My issue was that the database could not be connected to. In our case, we have mirrored databases and the connection string did not specify the Failover Partner. So when the database couldn't connect, it never went to the mirror and was throwing this error. Once I specified the Failover Partner in the connection string for my datasource, it resolved the issue.
BIGHAP: A SIMPLE WORK AROUND FOR THIS ISSUE.
I ran into the same problem when working with SharePoint lists as the DataSource, and read the blogs above which were very helpful. I had made changes in both the DataSource and Data object names and query fields in Visual Studio and the query worked in visual Studio. I was able to deploy the report to SharePoint but when I tried to open it I received the same error.
I guessed that the issue was that I needed to redeploy both the DataSource and the DataSet to SharePoint so that that changes in the rendering tools were all synced.
I redeployed the DataSource, DataSet and the Report to sharePoint and it worked.
As one of the blogs stated, although visual studio allowed the changes I made in the dataset and datasource, if you have not set visual studio to automatically redeploy datasource and dataset when you deploy the report(which can be dangerous, because this can affect other reports which share these objects) this error can occur.
So, of course the fix is that in this case you have to redeploy datasource, dataset and Report to resolve the issue.
I was also facing the same issue - I checked below things to fix this issue,
If you have recently changed pointing database-name in data-source
then first check that all the store procedures for that report exist
on changed database.
If there are multiple sub reports on main report then make sure each
report individually running perfectly.
Also check security panel - user must have access to the databases/
tables/views/functions for that report.
Sometimes, we also need to check dataset1 - store procedure. As if you are trying to show the report with user1 and if this user doesn't have the access(rights) of provided (dataset1 database) database then it will throw the same error as above so must check the user have access of dbreader in SQL Server.
Also, if that store procedure contains some other database (Database2) like
Select * from XYZ inner join Database2..Table1 on ... where...
Then user must have the access of this database too.
Note: you can check log files on this path for more details,
C:\Program Files\Microsoft SQL Server\MSRS11.SQLEXPRESS\Reporting Services
I got same error but this worked and solved my problem
If report is connected to Analysis server then give required permission to the user (who is accessing reporting server to view the the reports) in your model of analysis server.
To do this add user in roles of model or cube and deploy the model to your analysis server.
Using SSRS, Report Builder 3.0, MSSQL 2008 and query to an Oracle 11G database,
I found that the oracle stored procedure ran well, produced consistent results with no errors. When I tried bringing the data into SSRS, I got the error as listed in OP's query. I found that the data loaded and displayed only if I removed the parameters (not a good idea).
On Further examination, I found that under dataset properties>parameters I had set the start date to parameterName P_Start and parameter Value to #P_Start.
Adding the Parameter value as [#P_Start] cleared the problem, and the data loads well, with parameters in place.
This problem was caused by an orphaned SQL Login. I ran my favorite sp_fixusers script and the error was resolved. The suggestion above to look at the logs was a good one...and it led me to my answer.
This might be the permission issue for your view or store procedure
In addition to the above answers, it could be due to a missing SQL stored-procedure or SQL function. For example, this could be due to the function not migrating from a non-prod region to the production (prod) region.
Removing all comments from the Select Query fixed this for me. My dataset was working in the Preview but when I went to Design/Query Designer and and tried the query there I was getting ORA-01006;bind variable does not exist. After removing all comments from the select it worked.

Resources