Patch upgrade failed. ‘Error:574 CONFIG statement cannot be used inside a user transaction.’

This article is contributed. See the original author and article here.

 


Customer failed to apply patch. SQL Service cannot start. They received below errors in SQL Error logs.


 


2020-11-24 20:09:21.59 spid5s      Configuration option ‘show advanced options’ changed from 1 to 1. Run the RECONFIGURE statement to install.
2020-11-24 20:09:21.59 spid5s      Error: 574, Severity: 16, State: 0.


2020-11-24 20:09:21.59 spid5s      CONFIG statement cannot be used inside a user transaction.


2020-11-24 20:09:21.59 spid5s      Error: 912, Severity: 21, State: 2.


2020-11-24 20:09:21.59 spid5s      Script level upgrade for database ‘master’ failed because upgrade step ‘msdb110_upgrade.sql’ encountered error 574, state 0, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the ‘master’ database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.


2020-11-24 20:09:21.60 spid5s      Error: 3417, Severity: 21, State: 3.


2020-11-24 20:09:21.60 spid5s      Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.


2020-11-24 20:09:21.60 spid5s      SQL Server shutdown has been initiated


 


Just before ‘Error: 574’, I noticed ‘show advanced options’ in SQL Error log. I suppose it failed in ‘sp_configure’ scripts. I made below test to reproduce this error.


Open a new query window. Run begin tran first, then run sp_configure query. We can reproduce the same error.


 


begin tran


 


sp_configure ‘show advanced options’,1


go


reconfigure


go


 


According to the test, we felt sure that there was an uncommitted transaction when running ‘msdb110_upgrade.sql’. But where has it come from ? I read SQL Error logs again and found below information:


 


2020-11-24 20:09:19.52 spid5s      Granting login access’DomainUserA’ to msdb database…


2020-11-24 20:09:19.55 spid5s      A problem was encountered granting access to MSDB database for login ‘(null)’. Make sure this login is provisioned with SQLServer and rerun sqlagent_msdb_upgrade.sql


2020-11-24 20:09:19.80 spid5s      Granting login access’DomainUserB’ to msdb database…


2020-11-24 20:09:19.80 spid5s      A problem was encountered granting access to MSDB database for login ‘(null)’. Make sure this login is provisioned with SQLServer and rerun sqlagent_msdb_upgrade.sql


 


Even though, there are no error code, but those information indicates ‘msdb110_upgrade.sql’ encountered an issue before Error: 574. According to ‘msdb110_upgrade.sql’ scripts, I found below part


——————————————————————————–
–wals thru all non sysadmin job owners
DECLARE job_nonsysadmin_owners_cursor CURSOR LOCAL FOR
SELECT DISTINCT j.owner_sid FROM sysjobs j
FOR READ ONLY


OPEN job_nonsysadmin_owners_cursor
FETCH NEXT FROM job_nonsysadmin_owners_cursor INTO @owner_sid
WHILE (@@fetch_status = 0)
BEGIN
SELECT @owner_name = SUSER_SNAME(@owner_sid)
IF @owner_name IS NOT NULL
BEGIN
–is job owner member of sysadmin role?
BEGIN TRY
EXECUTE AS LOGIN=@owner_name — impersonate
SELECT @is_sysadmin = ISNULL(IS_SRVROLEMEMBER(‘sysadmin’),0) — check role membership
REVERT — revert back
END TRY
BEGIN CATCH
SET @is_sysadmin = 0
END CATCH

IF @is_sysadmin = 0
BEGIN
–add job_owner to the SQLAgentUserRole msdb role in order to permit the job owner to handle his jobs
–has this login a user in msdb?
IF NOT EXISTS(SELECT * FROM sys.database_principals WHERE (sid = @owner_sid) OR (LOWER(name collate SQL_Latin1_General_CP1_CS_AS) = LOWER(@owner_name collate SQL_Latin1_General_CP1_CS_AS)))
BEGIN
PRINT ”
PRINT ‘Granting login access”’ + @owner_name + ”’ to msdb database…’
BEGIN TRY
EXEC sp_grantdbaccess @loginame = @owner_name
END TRY
BEGIN CATCH
RAISERROR(‘A problem was encountered granting access to MSDB database for login ”%s”. Make sure this login is provisioned with SQLServer and rerun sqlagent_msdb_upgrade.sql ‘, 10, 127) WITH LOG
END CATCH
END


PRINT ”
PRINT ‘Adding user ”’ + @owner_name + ”’ to SQLAgentUserRole msdb role…’
BEGIN TRY
EXEC sp_addrolemember @rolename = ‘SQLAgentUserRole’, @membername = @owner_name
END TRY
BEGIN CATCH
RAISERROR(‘A problem was encountered adding user ”%s” to SQLAgentUserRole. Make sure this is a valid user in MSDB database and rerun sqlagent_msdb_upgrade.sql ‘, 10, 127) WITH LOG
END CATCH
END
END
FETCH NEXT FROM job_nonsysadmin_owners_cursor INTO @owner_sid
END
DEALLOCATE job_nonsysadmin_owners_cursor


 


It seems this scripts will find out non sysadmin Agent job owners. Grant msdb access to those job owner accounts. However, ‘DomainUserA’ and ‘DomainUserB’ were not logins of this SQL instance. But they are still job owners. This is the reason above ‘try…catch’ block throw out below messages:


2020-11-24 20:09:19.55 spid5s      A problem was encountered granting access to MSDB database for login ‘(null)’. Make sure this login is provisioned with SQLServer and rerun sqlagent_msdb_upgrade.sql


I consulted below official document. ‘try…catch’ block may cause an uncommitted transaction.


https://docs.microsoft.com/en-us/sql/t-sql/language-elements/try-catch-transact-sql?view=sql-server-ver15


Uncommittable Transactions and XACT_STATE


If an error generated in a TRY block causes the state of the current transaction to be invalidated, the transaction is classified as an uncommittable transaction. An error that ordinarily ends a transaction outside a TRY block causes a transaction to enter an uncommittable state when the error occurs inside a TRY block.


Now we found root cause. Customer removed ‘DomainUserA’ and ‘DomainUserB’ from job owners. Patch upgrade was successful.


 

The November 27th Weekly Roundup is Posted!

This article is contributed. See the original author and article here.

News this week includes:


 


Remember it all with Microsoft To Do and Samsung Reminder


 


Democratizing IoT with IoT Plug and Play and New Pricing for Azure IoT Central


 


Azure Databricks activities now support Managed Identity authentication


 


Zarbaliyev Ilgar is our member of the week and a fantastic contributor in the Excel community.


 


View the Weekly Roundup for Nov 23-27th in Sway and attached PDF document.


 


https://sway.office.com/s/cus00s7DJx0jK584/embed

Fortinet FortiOS System File Leak

This article is contributed. See the original author and article here.

Original release date: November 27, 2020

The Cybersecurity and Infrastructure Security Agency (CISA) is aware of the possible exposure of passwords on Fortinet devices that are vulnerable to CVE 2018-13379. Exploitation of this vulnerability may allow an unauthenticated attacker to access FortiOS system files. Potentially affected devices may be located in the United States.

Fortinet has released a security advisory to highlight mitigation of this vulnerability. CISA encourages users and administrators to review the advisory and apply the necessary updates immediately. Additionally, CISA recommends Fortinet users conduct a thorough review of logs on any connected networks to detect any additional threat actor activity.

This product is provided subject to this Notification and this Privacy & Use policy.

Global AI Student Conference 12 December 2020

Global AI Student Conference 12 December 2020

This article is contributed. See the original author and article here.



 







bannerAIStudent.png


Global AI Student Conference


Join us on Saturday 12th of December 2020 from 09:00 till 17:00 GMT+00:00 Europe/London


Join the Global AI Student Conference for students by students and learn all about AI.


 


Learn more about the sessions and content which will be covered.




 


What is AI, and Why We Care


In this session, we will give a brief overview of the area of Artificial Intelligence and Machine Learning as whole, and talk about why it is important for every student to learn the basics of AI/ML. …


Read more ›



 







Introduction to Machine Learning and an overview of popular algorithms.


This session would be meant for both beginners and intermediate level students in the field of machine learning. In this session, I would be introducing the basic idea of Machine learning, an overview …


Read more ›



 






How to protect the oceans with AI and Open Source?


Surfrider Foundation Europe NGO has become a reference in the fight for the protection of the ocean. Unexpectedly, this fight starts in the rivers. During this session, we’ll see how a group of …


Read more ›



 






PySpark : Combining Machine Learning & Big Data


With the ever increasing flow of data, comes the industry focus on how to use those data for driving business & insights; but what about the size of the data these days, we have to deal with ? The …


Read more ›



 






Help! I can’t find what I need.


We live in a world full of unstructured data, with data that is not easy to search in. Video/Audio/Images/PDF/… This talk will explain you how you can manage this documents and give your users the …


Read more ›



 






The current state and future of AI?


In this roundtable, we get together with AI researchers and evangelists to discuss the current successes of AI as a field, and look into the nearest future. …


Read more ›



 






Build a quiz generator from your notes


A demonstration on how to create a quiz generator which takes the pictures of your notes and put through the Azure Cognitive Services OCR we get the text, which we put through a jupyter notebook which …


Read more ›



 






Talk and Demo on Sound Identification and Classification with Tensorflow and Librosa


I aspire to conduct an interactive and implementation based workshop on the less explored format of data in Deep Learning i.e. The sounds. I would start the session with general information and …


Read more ›



 






Learning AI/ML: Is University the best place to do it?


With many teaching resources available online, including reputable Machine Learning courses like the one on Coursera, people might be tempted to think that they can learn AI/ML by themselves, and they …


Read more ›



 






My Story, the Story AI Tells; Bias & Privacy


With the new world of AI, there are ethical considerations with implementation. We have been thrust quickly and deeply in this new world in 2020. There are ethical implications with bias that need to …


Read more ›



 






Teaching your Models to play fair


It is very important to ensure fairness while building an AI system which can scale to a large number of users. Thus, I plan to first talk about how fairness is important while building AI apps. I …


Read more ›



 






Real Time Object Detection With TensorFlow


In this session, I will discuss about my project “Sign language detection with TensorFlow”. I started this project with an idea to develop an application to bridge the gap that might help people who …


Read more ›



 






Anyone can AI with Azure Custom Vision


In this talk, we’ll cover the basics of Azure’s Custom Vision service. We’ll begin with a low-code example and then transition to discussing and implementing some use cases that are changing the world …


Read more ›



 






How to Build Successful Career in AI/ML


In this roundtable, we will hear different opinions on what would be the best way to build a career in data science. From taking part in Kaggle competitions to Hackathons, there are many paths that ca …


Read more ›



 





Drupal Releases Security Updates

This article is contributed. See the original author and article here.

Original release date: November 27, 2020

Drupal has released security updates to address vulnerabilities in Drupal 7, 8.8 and earlier, 8.9, and 9.0. An attacker could exploit this vulnerability to take control of an affected system.

The Cybersecurity and Infrastructure Security Agency (CISA) encourages users and administrators to review Drupal Advisory SA-CORE-2020-013 and apply the necessary updates.

This product is provided subject to this Notification and this Privacy & Use policy.