microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.59k stars 909 forks source link

Job update failed #15263

Open PanJanKowalski opened 3 years ago

PanJanKowalski commented 3 years ago

Issue Type: Bug

Deleting job using extension SQL Server Agent gives an error:

Job update failed 'Microsoft.SqlServer.Management.Smo.FailedOperationException: Attempt to retrieve data for object failed for Server 'XXXXXXXXXXXXXXXXXXXXXXXXXX'. ---> Microsoft.SqlServer.Management.Smo.SmoException: Invalid Urn filter on server level: filter must be empty, or server attribute must be equal with the true server name. at Microsoft.SqlServer.Management.Smo.Server.CheckValidUrnServerLevel(XPathExpressionBlock xb) at Microsoft.SqlServer.Management.Smo.Server.GetSmoObjectRec(Urn urn) at Microsoft.SqlServer.Management.Smo.Server.GetSmoObjectRec(Urn urn) at Microsoft.SqlServer.Management.Smo.Server.GetSmoObjectRec(Urn urn) at Microsoft.SqlServer.Management.Smo.Server.GetSmoObject(Urn urn) --- End of inner exception stack trace --- at Microsoft.SqlServer.Management.Smo.Server.GetSmoObject(Urn urn) at Microsoft.SqlTools.ServiceLayer.Agent.JobData.get_Job() in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Agent\Jobs\JobData.cs:line 689 at Microsoft.SqlTools.ServiceLayer.Agent.JobData.CheckAndLoadGeneralData() in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Agent\Jobs\JobData.cs:line 763 at Microsoft.SqlTools.ServiceLayer.Agent.JobData..ctor(CDataContainer data, AgentJobInfo jobInfo, ConfigAction configAction) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Agent\Jobs\JobData.cs:line 639 at Microsoft.SqlTools.ServiceLayer.Agent.AgentService.CreateJobData(String ownerUri, String jobName, CDataContainer& dataContainer, JobData& jobData, ConfigAction configAction, AgentJobInfo jobInfo) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Agent\AgentService.cs:line 1185 at Microsoft.SqlTools.ServiceLayer.Agent.AgentService.<>c__DisplayClass40_0.<b__0>d.MoveNext() in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Agent\AgentService.cs:line 918'

Deleting job with sp works fine

USE msdb;  
GO  

EXEC sp_delete_job  
    @job_name = N'test';  
GO

Extension SQL Server Agent v0.48.0 Azure Data Studio version: azuredatastudio 1.28.0 (13e362762762e5cb76a5c8afd2bc650f48c2d3d8, 2021-04-15T00:24:15.710Z) OS version: Windows_NT x64 10.0.19042

jonathbil commented 2 years ago

Any update on that bug, without a fix we need to continue using SMSS instead of Azure Data Studio

abist commented 2 years ago

@jonathbil, I'll take a look into this for our next release!