SQL Prompt cannot access SSMS snippets folder in Azure Data studio

RajivYanamandraRajivYanamandra Posts: 1 New member
edited June 17, 2020 8:14PM in SQL Prompt


Installed the SQL Prompt v0.2.2  in the Azure Data studio. I have set the path of the SSMS snippets folder in the settings as well. But when SQL prompt tries to access the folder it fails throwing a "Failed to import snippets from SSMS: Error: Access to the path denied". I have given the full control permission to everyone. It should be having access to the folder. 
Does anyone else has had this issue?



Answers

  • Hi @RajivYanamandra

    Sorry you're having trouble with our ADS extension. This issue isn't something we've seen before. Could you try moving the snippets to a different location and seeing if the extension can access them there? This should tell us whether it's a general issue or specific to the location you're trying to use.

    Thanks,
    Tom
    Software Engineer for SQL Prompt
    Redgate Software
  • DeeTronDeeTron Posts: 3 New member
    In case it helps....

    I do not have SQL Prompt for SSMS installed, only the ADS version (v0.2.2).  I get a similar error at launch of ADS:

    Failed to import snippets from SSMS: Error: The JSON value could not be converted to System.String. Path: $['JOIN Schemas_Tables_Columns Template'].prefix | LineNumber: 3 | BytePositionInLine: 24.

    I do NOT believe I've done and mods to the extension's setting other than for formatting.  In the settings panel (i.e. the GUI, and NOT looking at or editing the JSON directly) the three displayed settings are such:

    <div>Sql Prompt: Active Style = DSD SQL Style</div><div><br></div><div>Sql Prompt: Ads Snippets File = Default</div><div><br></div><div>Sql Prompt: Ssms Snippets folder = Default</div>

    Sorry if this muddies the issue the original poster raised, but I thought they might be related.

  • MarkCMarkC Posts: 1 New member
    I am getting the same error message.  Attached is the full details of the error message.
  • KNPKNP Posts: 1 New member
    I have a similar issue.

    Failed to import snippets from SSMS: Error: '<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.

    I've tried removing all of the snippets from the folder and just putting one simple snippet back in but no luck. 

    Any ideas?

  • dbablerdbabler Posts: 2 New member
    I am having the same issue it happens mostly, but not always, when I have to run Azure Data Studio in Administrative Mode (which I usually have to). 
    Failed to import snippets from SSMS: Error: Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
     ---> System.Text.Json.JsonException: The JSON value could not be converted to System.String. Path: $.CheckComments.body | LineNumber: 3 | BytePositionInLine: 65.
       at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
       at System.Text.Json.JsonPropertyInfo.Read(JsonTokenType tokenType, ReadStack& state, Utf8JsonReader& reader)
       at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
       at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader)
       at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
       at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
       at RedGate.SqlPrompt.SnippetConverter.Ads.AdsSnippetSerializer.Deserialize(Stream stream) in D:\BuildAgentB\work\dc5fefc0dc183d00\SnippetConverter\Ads\AdsSnippetSerializer.cs:line 47
       at RedGate.SqlPrompt.SnippetConverter.Ads.AdsSnippets.Load(String snippetsFile) in D:\BuildAgentB\work\dc5fefc0dc183d00\SnippetConverter\Ads\AdsSnippets.cs:line 17
       at RedGate.SqlPrompt.SnippetConverter.SsmsToAdsSnippetConverter.Convert(String ssmsSnippetsFolder, String adsSnippetsFile) in D:\BuildAgentB\work\dc5fefc0dc183d00\SnippetConverter\SsmsToAdsSnippetConverter.cs:line 25
       at RedGate.SqlPrompt.SnippetConverter.Program.Run(Logger logger, Options options) in D:\BuildAgentB\work\dc5fefc0dc183d00\SnippetConverter\Program.cs:line 79
       at RedGate.SqlPrompt.SnippetConverter.Program.<>c__DisplayClass1_0.<Main>b__0(Options options) in D:\BuildAgentB\work\dc5fefc0dc183d00\SnippetConverter\Program.cs:line 34
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Delegate.DynamicInvoke(Object[] args)
       at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
       at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<<UseVersionOption>b__1>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseTypoCorrections>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext() 


  • dbablerdbabler Posts: 2 New member
    TomW said:
    Hi @RajivYanamandra

    Sorry you're having trouble with our ADS extension. This issue isn't something we've seen before. Could you try moving the snippets to a different location and seeing if the extension can access them there? This should tell us whether it's a general issue or specific to the location you're trying to use.

    Thanks,
    Tom
    Hey Tom I just wanted to make sure you saw that others are having this issue.  I posted screenshots above.  Is there any update on this?
  • Any Update on this?
  • Hi @DaveBabler, @RajivYanamandra and others,

    We've released a new version of our ADS extension (0.2.9) which addresses issues with importing snippets.  Could you please update and check if issues you reported are now fixed for you?

    Many thanks
    Mel 
    Technical Lead
    Redgate
  • DaveBablerDaveBabler Posts: 2 New member
    Hi @DaveBabler, @RajivYanamandra and others,

    We've released a new version of our ADS extension (0.2.9) which addresses issues with importing snippets.  Could you please update and check if issues you reported are now fixed for you?

    Many thanks
    Mel 
    Unfortunately, I am still experiencing this issue.

  • gezageza Posts: 1 New member
    Same issue (v0.2.11). In my ADS (v1.40.0) it prompts on every start of the program. It points to a drive D, but I don't have a drive D.

  • dwainewdwainew Posts: 59 Bronze 4
    Hi @DaveBabler, @RajivYanamandra and others,

    We've released a new version of our ADS extension (0.2.9) which addresses issues with importing snippets.  Could you please update and check if issues you reported are now fixed for you?

    Many thanks
    Mel 
    Unfortunately, I am still experiencing this issue.


    I'm glad someone showed a screenshot of the settings....

    I was getting the same error, but then noticed the extension uses a FILE, while SSMS uses multiple files in a FOLDER.

    Adding snippets.json to the end of your Ads snippets file path should do the trick...
Sign In or Register to comment.