0
votes

I am attempting to get the console to successful operate with an Azure-Cosmosdb graph database. To be clear, I am using :

:remote connect tinkerpop.server conf/remote-secure-Collection1.yaml

I get the connection:

Configured undefined.graphs.azure.com/52.173.137.146:443

but then error out on execution of the query. Access denied per this message:

"Gremlin websocket client failed to provide valid SASL authorization information.\t@: at GraphService.GremlinSession.d

attempted to follow the online help from both tinkerpop and azure, could not find where I have the configuration wrong. Any help would be appreciated. Full error text below.

Unexpected end-of-input: was expecting closing quote for a string value at [Source: {"requestId":"2febb36e-b214-44f1-a811-f9a2afea324e","status":{"code":401,"attributes":{},"message":"Gremlin websocket client failed to provide valid SASL authorization information.\t@: at GraphService.GremlinSession.d__10.MoveNext()\r --- End of stack trace from previous location where exception was thrown ---\r at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r at GraphService.GremlinSession.d__8.MoveNext()\r --- End of stack trace from previous location where exception was thrown ---\r at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r at GraphService.GremlinClientHandler.d__14.MoveNext()\t--->

Access to Graph database denided.\t@: at GraphService.GraphConnectionFactory.CreateGraphConnection(String documentDBAccountUri, String documentDBAccountKey, String documentDBDatabaseName, String documentDBCollectionName)\r at GraphService.GraphConnectionFactory.GetGraphConnection(String documentDBAccountUri, String documentDBAccountKey, String documentDBDatabaseName, String documentDBCollectionName)\r at GraphService.GraphConnectionFactory.GetConnectionFromAuthMessage(String user, String password)\r at GraphService.GremlinSession.CheckSaslAuthorization(String challangeResponse)\r at GraphService.GremlinSession.d__10.MoveNext()\t--->

One or more errors occurred.\t@: at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)\r at GraphService.GraphConnectionFactory.CreateGraphConnection(String documentDBAccountUri, String documentDBAccountKey, String documentDBDatabaseName, String documentDBCollectionName)\t--->

An error occurred while sending the request.\t@: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r at Microsoft.Azure.Documents.Client.GatewayServiceConfigurationReader.d__0.MoveNext()\r --- End of stack trace from previous location where exception was thrown ---\r at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r at Microsoft.Azure.Documents.Routing.GlobalEndpointManager.d__0.MoveNext()\r --- End of stack trace from previous location where exception was thrown ---\r at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r at Microsoft.Azure.Documents.Client.GatewayServiceConfigurationReader.d__b.MoveNext()\r --- End of stack trace from previous location where exception was thrown ---\r at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r at Microsoft.Azure.Documents.Client.DocumentClient.d__35d.MoveNext()\r --- End of stack trace from previous location where exception was thrown ---\r at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r at Microsoft.Azure.Documents.Client.DocumentClient.d__29.MoveNext()\r --- End of stack trace from previous location where exception was thrown ---\r at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Tas; line: 1, column: 8193] Type ':help' or ':h' for help.

1
Please describe more precisely what you are doing and format the exception according to SO guidelines - Mikhail Shilkov
Sorry for the formatting issues, my first time using SO, so please point me to relevant guidelines. Happy to adjust. - George Neal

1 Answers

3
votes

I was having a similar issue with the same error when trying to open Gremlin console to Azure Cosmos db. There are a couple of things that you need to look at in the remote-secure.yaml file that you are setting up to connect to your Azure Cosmos Db:

  1. For hosts entry - Make sure your entry for 'hosts' is correct, looks like you have undefined.graphs.azure.com. I would recheck the azure portal and make sure this is correct. You can find this value on the Cosmos Db overview page, it is under Gremlin URI.

  2. The username entry - Should be in the format /dbs/'your database name'/colls/'your collection name'. So for my example if you go to Data Explorer, the db name is the 'graphdb' database name value and the collection name is the 'Glossary' collection value so my username in the yaml file is /dbs/graphdb/colls/Glossary. The database name is not necesarily the host name, this is where i went wrong. enter image description here

  3. For Password entry - password is your Primary Key on the keys page. Make sure you copied it right.