1

I'm running RavenDB 3.0 as a Windows Service on my machine. There's a collection in the database with 610 documents, and whenever I query it to get them all

_session.Query<StockKeepingUnit>().Take(1024).ToList();    

I get the following error:

"After parsing a value an unexpected character was encountered: B. Path 'Results[342].ManufacturerDescription'."

"exceptionType":"Raven.Imports.Newtonsoft.Json.JsonReaderException"

And the following stack trace:

"stackTrace":"   at 

Raven.Imports.Newtonsoft.Json.JsonTextReader.ParsePostValue() in c:\\Builds\\RavenDB-Stable-3.0\\Imports\\Newtonsoft.Json\\Src\\Newtonsoft.Json\\JsonTextReader.cs:line 762
   at Raven.Imports.Newtonsoft.Json.JsonTextReader.ReadInternal() in c:\\Builds\\RavenDB-Stable-3.0\\Imports\\Newtonsoft.Json\\Src\\Newtonsoft.Json\\JsonTextReader.cs:line 392
   at Raven.Imports.Newtonsoft.Json.JsonTextReader.Read() in c:\\Builds\\RavenDB-Stable-3.0\\Imports\\Newtonsoft.Json\\Src\\Newtonsoft.Json\\JsonTextReader.cs:line 304
   at Raven.Json.Linq.RavenJObject.Load(JsonReader reader) in c:\\Builds\\RavenDB-Stable-3.0\\Raven.Abstractions\\Json\\Linq\\RavenJObject.cs:line 251
   at Raven.Json.Linq.RavenJArray.Load(JsonReader reader) in c:\\Builds\\RavenDB-Stable-3.0\\Raven.Abstractions\\Json\\Linq\\RavenJArray.cs:line 139
   at Raven.Json.Linq.RavenJObject.Load(JsonReader reader) in c:\\Builds\\RavenDB-Stable-3.0\\Raven.Abstractions\\Json\\Linq\\RavenJObject.cs:line 225
   at Raven.Json.Linq.RavenJToken.ReadFrom(JsonReader reader) in c:\\Builds\\RavenDB-Stable-3.0\\Raven.Abstractions\\Json\\Linq\\RavenJToken.cs:line 171
   at Raven.Json.Linq.RavenJToken.Load(JsonReader reader) in c:\\Builds\\RavenDB-Stable-3.0\\Raven.Abstractions\\Json\\Linq\\RavenJToken.cs:line 262
   at Raven.Json.Linq.RavenJToken.TryLoad(Stream stream) in c:\\Builds\\RavenDB-Stable-3.0\\Raven.Abstractions\\Json\\Linq\\RavenJToken.cs:line 238
   at Raven.Client.Connection.HttpJsonRequest.<ReadJsonInternalAsync>d__48.MoveNext() in c:\\Builds\\RavenDB-Stable-3.0\\Raven.Client.Lightweight\\Connection\\Implementation\\HttpJsonRequest.cs:line 459

When I try the same query on the live database, hosted on Azure, the query succeeds. The local database is a direct import from the one on Azure, so no differences there.

What's interesting is that if I delete the whole database and re-import it, the error remains the the "unexpected character" and the property where it's found change:

    "After parsing a value an unexpected character was encountered: v. Path 'Results[342].OriginalRetailPrice'."

I'm at a loss as to where to even begin. Any ideas?

svick
  • 236,525
  • 50
  • 385
  • 514
Sergi Papaseit
  • 15,999
  • 16
  • 67
  • 101
  • Are you using some custom json serializers? – Jens Pettersson Jan 21 '15 at 14:11
  • Nope. Straight from the latest RavenDB NuGet package (3.0) And if that were the case I assume I'd get the same error on the Azure website. – Sergi Papaseit Jan 21 '15 at 14:34
  • Just wondering if you're initializing the DocumentStore differently on your local machine than the code running in production. I've done that a couple of times when setting up small lab projects against a production copy of the db. When I forget to set the same custom json serializers and tries to query a document that used a type that needed this serializer I got the same error you're describing. If not that, maybe some encoding problem? – Jens Pettersson Jan 21 '15 at 17:57
  • When I say that it works with the Azure database, I mean that I actually point the solution on my local machine to the RavenDB Azure database. That is to say, the only thing I change is the connection string on the `web.config`. So, both scenarios are as similar as they could be. Encoding? Reginal options? No idea. I've tried both English UK and Dutch locales but it makes no difference. – Sergi Papaseit Jan 21 '15 at 18:05

0 Answers0