Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error upon calling ExecuteNextAsync in Azure App Services #394

Open
lpunderscore opened this issue Dec 5, 2017 · 4 comments
Open

Error upon calling ExecuteNextAsync in Azure App Services #394

lpunderscore opened this issue Dec 5, 2017 · 4 comments
Assignees
Labels

Comments

@lpunderscore
Copy link

Create a simple vertex query:

 var vertexQuery = ((DocumentClient)_client).CreateGremlinQuery<Vertex>(docCollection,
                    $"g.V('{memberId}')" +
                    $".outE('posts')" +
                    $".inV()");

 while (vertexQuery.HasMoreResults)
                {
                    foreach (var result in await vertexQuery.ExecuteNextAsync<Vertex>())  //crashes on this line in azure app service
                    {
                        benefits.Add(await _groupservice.GetBenefitAsync(groupId, new Guid(result.Id.ToString())));
                    }
                }

it crashes on executenextassync when running in azure app service but runs fine locally using the same data connections.

The exception in application insights is:

An unhandled exception has occurred: Unexpected character encountered while parsing value: }. Path '[0].properties.Modified[0].value', line 1, position 714.

@olivertowers
Copy link
Member

Can you provide the following information:

  • Version of Microsoft.Azure.Graphs
  • Version of Newtonsoft.Json
  • Stack trace for the error if available.

It seems unusual that it would work locally but fail when running remotely.

Are there any differences in the web.config between what is published and what is local?

@lpunderscore
Copy link
Author

.net core 2.0 backend (webapi) with angular 5 front end.

Microsoft.Azure.Graphs 0.3.1-preview
Newtonsoft.Json 10.0.3
An unhandled exception has occurred: Unexpected character encountered while parsing value: }. Path '[0].properties.Modified[0].value', line 1, position 493.

happens when this line is executed:

 var planVertex = (await ((DocumentClient)_client).CreateGremlinQuery<Vertex>(docCollection,
                   $"g.V('{edges.FirstOrDefault().InVertexId.ToString()}')" +
                   $".outE('plan')" +
                   $".inV()").ExecuteNextAsync<Vertex>()).FirstOrDefault();

running in release mode locally works fine. I should also point out that when running locally or in azure, the same connections are used (cosmosdb, storage etc..) the only difference is the environment. Other gremlin queries run just fine in azure, but some just don't work.

web.config is the same, appsettings pretty much the same except for this setting which is not there locally? WEBSITE_NODE_DEFAULT_VERSION but I don't think this should affect the .net core environment.

this has happened before apparantly: #259

it looks very similar to what i'm experiencing.

@olivertowers
Copy link
Member

I haven't had an opportunity to setup a repro, but here are some things you can try in the interim:

  • Upgrade Microsoft.Azure.DocumentDB package to latest version (1.19.1 as of today)
  • Downgrade Newtonsoft.Json to 9.0.1.

@kartang
Copy link

kartang commented May 2, 2018

@olivertowers We are running into a similar issue both locally and when published. We did not notice any such exceptions before, but the issues started to repro as soon as we updated the documentdb version from 1.13.2 to 1.22.0. Please let me know if we are missing anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants