Word automation service issues - iis

I have issue with word Automation service. Permissions on DB which is hosted on SQL server are ok. There are no timeouts and errors on DB, verbose shows only this kind of log:
Database 'WordAutomation_01_SADB01':
Connecting with connection string 'Data Source=XXXXXX;
Initial Catalog=WordAutomation_01_SADB01;
Integrated Security=True;
Enlist=False;
Connect Timeout=15'
App 'Word Automation Service 01': GetJobStatus complete: 00000000-0000-10a8-8031-1ce281d9f091; time = 518.00 ms
Proxy 'Word Automation Service 01 Proxy': GetJobStatus 00000000-0000-10a8-8031-1ce281d9f091 complete; time=15.00 ms
I have got 2 env~ PROD and PREPROD. It works on PROD but unfortunately not on preprod.
Any ideas where I should search issues?

Related

Azure SQL unavailable to Web App intermittently

I have a webapp running in Azure. It uses a Azure MSSQL database set to Standard S0: 10 DTUs performance. The backend is written in dot net core 3.1. The app works fine when I visit it.
Checking my logs I found a few of these, they happen weeks apart at odd times.
Microsoft.Data.SqlClient.SqlException (0x80131904): 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: TCP Provider, error: 35 - An internal exception was caught)
This error has me wondering if some random user is unable to access the site because the SQL server won't respond.
Any suggestions as to what this might be about?
Or suggestions as to what I should try doing?
Update 1: As a response to comment regarding retry. I actually have implemented retry on the connection (.net core entity framework) using this code.
services.AddDbContext<ApplicationDbContext>(
options =>
{
options.UseSqlServer(connectionString, sqlOptions =>
{
sqlOptions.EnableRetryOnFailure(
maxRetryCount: 10,
maxRetryDelay: TimeSpan.FromSeconds(10),
errorNumbersToAdd: null
);
});
options.EnableSensitiveDataLogging(true);
},
ServiceLifetime.Transient
);

Azure - 'There was an error while initializing App Service app for blahblahapp' 'Error connecting to SQL server (SQL error code 40532)'

I'm following a tutorial for setting up easy tables in Azure but I'm getting 'There was an error while initializing App Service app for 'blahblahapp'. 'Error connecting to SQL server (SQL error code 40532)'.
My connection string is:
Data Source=tcp:blahblahapp.database.windows.net,1433;Initial Catalog=blahblahapp_db;User ID=myemail#email.com;Password=blahblahpassword.
I've had a similar problem before while following another tutorial where my sql connection credentials were copied from the connection string given by Azure and pasted into a visualstudio c# program but it came up with errors and would not connect using the username myemail#email.com instead of the username given which was the same myemail#email.com I had to put myemail#email.com#database.azurewebsites.net so I'm thinking this could be the problem.
Or is it????
This problem is happening in the Azure console but how do I edit the connection string given by azure so that it is myemail#email.com#database.azurewebsites.net?

Error 19 - Physical connection error

A transport-level error has occurred when receiving results from the server. (provider: Session Provider, error: 19 - Physical connection is not usable) - occurs intermittently, using hybrid connector to connect to on-premise database from Azure API
I try connecting to SQL database in on-premise sever from app service resource (Web API). Configured classic hybrid connection end point to on-premise db.
Root Cause :
In SQL database, there is a property 'Auto Close' in Options tab, which is set to TRUE by default.
When Azure Service(API) establishes connection to SQL server. Azure tries to maintain the same connection pool and try to reuse and reconnect to it.
As we have set 'Auto Close as TRUE', the SQL database clears the existing connection after sometime. Whereas Azure tries to reconnect with the earlier connection which has already been cleared by SQL database. This results in 'Physical Connection is not usable - error 19'.
SOLUTION:
In SQL db, go to database properties. Navigate to 'OPTIONS' page and expand automatic tab and set 'AUTO CLOSE' property as 'FALSE'.
Make sure you restart Azure app and your database server to ensure no old connections are used.
PROBLEM SOLVED.
NOTE : This is one of the reason (which happened to me).
Another useful method to get rid of this error is to use RETRY LOGIC of Entity Framework 1.1.0
services.AddDbContext<DbContext>(options => options.UseSqlServer('yourconnectionstring',
sqlServerOptionsAction: sqlOptions =>
{
sqlOptions.EnableRetryOnFailure(
maxRetryCount: 5,
maxRetryDelay: TimeSpan.FromSeconds(30),
errorNumbersToAdd: new List<int>() { 19 });
}));
In Retry logic, error 19 is not included. So you have to pass the error code 19 to set retry logic for error code 19.
It seems you need to add a retry logic to your Web API as explained here. The "Physical connection is not usable" error may be caused by transient errors as explained on this Microsoft documentation.
"Transient fault errors typically manifest as one of the following error messages from your client programs:+
•Database on server is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID of
•Database on server is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID of . (Microsoft SQL Server, Error: 40613)
•An existing connection was forcibly closed by the remote host.
•System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: Session Provider, error: 19 - Physical connection is not usable)
•An connection attempt to a secondary database failed because the database is in the process of reconfguration and it is busy applying new pages while in the middle of an active transation on the primary database."

Azure CLI: 'azure sql db show' returning `HTTP Error 503. The service is unavailable`

In Azure CLI I was trying azure sql db to manage databases:
azure sql db create server1 db1 - works fine, creates the database
azure sql db show server1 db1 - fails with
Service Unavailable
Service Unavailable
HTTP Error 503. The service is unavailable.
azure sql db delete server1 db1 - fails with
Service Unavailable
Service Unavailable
HTTP Error 503. The service is unavailable.
I tried with intentionally mistaken server name, the result is as expected:
info: Executing command sql db show
Administrator password: *************
+ Getting SQL server databases
error: getaddrinfo ENOTFOUND <wrong server>.database.windows.net <wrong server>.database.windows.net:443
error: Error information has been recorded to .azure\azure.err
error: sql db show command failed
I wonder what would be the cause of 503. The service is unavailable error. Ideas?
I've encountered the same problem.
Apparently it's a known issue on the Azure CLI and they plan to fix it soon when they will rewrite the CLI.
https://github.com/Azure/azure-xplat-cli/issues/2090
As a work around you can try the Azure Power Shell commands.

Azure Connection String Failing

I have a dev system connecting to an Azure database. Works fine. When I deploy the system to an Azure WebApp, I get sql connection error "The server was not found or was not accessible."
Some more information:
In App Services > GreenStore > Settings > Application Settings I have filled in the connection strings as follows:
DefaultConnection Server=tcp:gserver.database.windows.net,1433;
Data Source=gserver.database.windows.net;
Initial Catalog=GDB;Persist Security Info=False;
User ID=xxx#xxxxserver;Password=xxxxxxx;Pooling=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=10
SQL Server
StoreDBEntities
metadata=res://*/Models.StoreModels.csdl|res://*/Models.StoreModels.ssdl|res://*/Models.StoreModels.msl;
Server=tcp:gserver.database.windows.net,1433;
Data Source="gserver.database.windows.net;
Initial Catalog=GDB;Persist Security Info=False;
User ID=xxx#xxxxserver;Password=xxxxxxx;Pooling=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=10;"
Custom
Is there a mistake in the connection strings which I entered in App Services > GreenStore > Settings > Application Settings or is another issue. I can connect from my dev machine using the above connections strings in web.config versions.

Resources