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

JsonReaderExceptionFailed on SDK 1.14.1 during deserialization (works with 1.13.4) #267

Closed
arramac opened this issue May 24, 2017 · 8 comments

Comments

@arramac
Copy link
Contributor

arramac commented May 24, 2017

Reported on 1.14.1.

This seems to have fixed the original erroring use case (Azure WebJob would fail on first call to database) but I'm seeing a new issue where new logins are failing (Azure Website). I'm debugging and will update this as I know more.. but wanted to put it out quick for anyone else experimenting.

EDIT: I think the original error may be addressed, but I'm seeing errors with JSON serialization through the Azure Website after reading from the database. It seems like the read occurs, but deserialization is failing.

Error parsing boolean value. Path 'queryRanges[0].isMinInclusive', line 1, position 295.
Exception type: Newtonsoft.Json.JsonReaderExceptionFailed method: Newtonsoft.Json.JsonTextReader.ParseTrueProblem Id: Newtonsoft.Json.JsonReaderException at Newtonsoft.Json.JsonTextReader.ParseTrue
I override a few JsonSerializerSettings.. this is unchanged code but in case it's related:

        settings.Formatting = Formatting.Indented;
        settings.NullValueHandling = NullValueHandling.Ignore;

        settings.Converters.Add(new StringEnumConverter());

EDIT 2: Deeper call stack. Note that this is a single partition database that is struggling (multi partition database was fine with v1.14.0)

"Newtonsoft.Json.JsonReaderException: Error parsing boolean value. Path 'queryRanges[0].isMinInclusive', line 1, position 295.
at Newtonsoft.Json.JsonTextReader.ParseTrue()
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonReader.Skip()
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetExtensionData(JsonObjectContract contract, JsonProperty member, JsonReader reader, String memberName, Object o)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Microsoft.Azure.Documents.Query.QueryPartitionProvider.GetPartitionedQueryExecutionInfoInternal(SqlQuerySpec querySpec, PartitionKeyDefinition partitionKeyDefinition, Boolean requireFormattableOrderByQuery, Boolean isContinuationExpected)
at Microsoft.Azure.Documents.Query.DocumentQueryExecutionContextBase.d__0.MoveNext()
EDIT 3: I have reverted back to v1.13.4 of the SDK for now. I'd be happy to work with you guys to look into this issue and/or split it out into a new issue if desired.

@arramac
Copy link
Contributor Author

arramac commented May 24, 2017

@codecadwallader FYI

@codecadwallader
Copy link

Thanks for splitting this out. What other information would you like provided to help isolate?

@zfang
Copy link

zfang commented May 25, 2017

Could you provide the query and your collection partition key path?

@codecadwallader
Copy link

codecadwallader commented May 25, 2017

It seems to happen across any query, a basic example below. This is for a single partition database so there isn't a partition key path defined. I also have a multiple partition database which is behaving correctly.

SELECT TOP 1 * FROM root WHERE ((root[\"Type\"] = \"User\") AND (root[\"Email\"] = \"example@email.com\"))

@zachstronaut
Copy link

@codecadwallader This is happening to me in a local dev environment. Seems to be affecting me on Win 8.1 but not my colleagues on Win 10.

@codecadwallader
Copy link

Interesting, I'm only seeing it when deploying into the Azure cloud, no problems locally (Win 10 as well).

@zachstronaut
Copy link

Update on my situation...

I was getting the queryRanges[0].isMinInclusive error from above. Turns out that once upon a time I had been getting the System.DllNotFoundException: Unable to load DLL 'Microsoft.Azure.Documents.ServiceInterop.dll' error that's discussed here and here and the only solution at the time that worked for me was to copy that DLL to C:\Windows\System32.

I had forgotten that I'd done that, and so when we updated to 1.14.x from whatever we previously were using, that DLL never got replaced, and my project was still grabbing that old DLL. Dropping the new Microsoft.Azure.Documents.ServiceInterop.dll into C:\Windows\System32 and overwriting what was there fixed my queryRanges[0].isMinInclusive error.

But... I didn't want this to happen to me again, so I went back to looking for a fix for the System.DllNotFoundException: Unable to load DLL 'Microsoft.Azure.Documents.ServiceInterop.dll' error. Updating my system PATH env variable to point to a folder with the correct DLL in it did not work. I still got the same DllNotFoundException.

The solution for me ended up being to open IIS and change the DefaultAppPool Identity under Advanced Settings to be me (in this case, VirtualBox\zachstronaut) and now everything works without any file copies being in my System32 and without any PATH changes. Now I don't get either the isMinInclusive error nor the DllNotFoundException error.

Neither of my colleagues are running their IIS this way, and we have no idea what's different between their two configs and mine.

@zfang
Copy link

zfang commented Jun 12, 2017

It seems like this issue is caused by running newer version of SDK but with older version of some DLLs. Please make sure to clean up your project completely and have all the most updated DLLs.

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

No branches or pull requests

5 participants