Latest Nuget Breaks a Query

21 views
Skip to first unread message

EisenbergEffect

unread,
Jun 20, 2012, 3:18:30 PM6/20/12
to rav...@googlegroups.com
I just updated to the latest Nuget of the client and I'm getting a strange error on a query that has never caused me any problems. The query looks like this:

      public static PostTopic<CharacterOverview> GetPostsForCharacter(this IDocumentSession session, ICharacterRepository characterRepository, string characterId, int? limit, int? offset) {
            var posts = session.Query<Post>()
                .Where(x => x.Sections.Any(y => y.ReferenceId == characterId))
                .OrderByDescending(x => x.CreatedAt)
                .ToLazyPage(limit, offset, "CreatedAt", false);

            var character = characterRepository.GetOverview(characterId);

            return new PostTopic<CharacterOverview> {
                Topic = character.Value,
                Posts = posts.Value
            };
        }

There error details are as follows:

{"Got an error from server, status code: 500\r\n{\r\n  \"Url\": \"/indexes/dynamic/Posts\",\r\n  \"Error\": \"System.InvalidOperationException: Could not understand query: \\r\\n-- line 2 col 9: \\\"in\\\" expected\\r\\n\\r\\n   at Raven.Database.Linq.QueryParsingUtils.GetVariableDeclarationForLinqQuery(String query, Boolean requiresSelectNewAnonymousType) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Linq\\\\QueryParsingUtils.cs:line 84\\r\\n   at Raven.Database.Linq.DynamicViewCompiler.TransformMapDefinitionFromLinqQuerySyntax(String query, String& entityName) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Linq\\\\DynamicViewCompiler.cs:line 442\\r\\n   at Raven.Database.Linq.DynamicViewCompiler.HandleMapFunction(ConstructorDeclaration ctor, String map) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Linq\\\\DynamicViewCompiler.cs:line 132\\r\\n   at Raven.Database.Linq.DynamicViewCompiler.TransformQueryToClass() in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Linq\\\\DynamicViewCompiler.cs:line 97\\r\\n   at Raven.Database.Linq.DynamicViewCompiler.GenerateInstance() in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Linq\\\\DynamicViewCompiler.cs:line 489\\r\\n   at Raven.Database.Storage.IndexDefinitionStorage.AddAndCompileIndex(IndexDefinition indexDefinition) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Storage\\\\IndexDefinitionStorage.cs:line 150\\r\\n   at Raven.Database.Storage.IndexDefinitionStorage.CreateAndPersistIndex(IndexDefinition indexDefinition) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Storage\\\\IndexDefinitionStorage.cs:line 135\\r\\n   at Raven.Database.DocumentDatabase.PutIndex(String name, IndexDefinition definition) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\DocumentDatabase.cs:line 731\\r\\n   at Raven.Database.Queries.DynamicQueryRunner.TouchTemporaryIndex(String temporaryIndexName, String permanentIndexName, Func`1 createDefinition) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Queries\\\\DynamicQueryRunner.cs:line 161\\r\\n   at Raven.Database.Queries.DynamicQueryRunner.GetAppropriateIndexToQuery(String entityName, IndexQuery query, DynamicQueryMapping map) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Queries\\\\DynamicQueryRunner.cs:line 118\\r\\n   at Raven.Database.Queries.DynamicQueryRunner.ExecuteDynamicQuery(String entityName, IndexQuery query) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Queries\\\\DynamicQueryRunner.cs:line 37\\r\\n   at Raven.Database.Queries.DynamicQueryExtensions.ExecuteDynamicQuery(DocumentDatabase self, String entityName, IndexQuery indexQuery) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Queries\\\\DynamicQueryExtensions.cs:line 17\\r\\n   at Raven.Database.Server.Responders.Index.PerformQueryAgainstDynamicIndex(IHttpContext context, String index, IndexQuery indexQuery, Guid& indexEtag) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Server\\\\Responders\\\\Index.cs:line 224\\r\\n   at Raven.Database.Server.Responders.Index.ExecuteQuery(IHttpContext context, String index, Guid& indexEtag) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Server\\\\Responders\\\\Index.cs:line 169\\r\\n   at Raven.Database.Server.Responders.Index.GetIndexQueryRessult(IHttpContext context, String index) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Server\\\\Responders\\\\Index.cs:line 118\\r\\n   at Raven.Database.Server.Responders.Index.OnGet(IHttpContext context, String index) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Server\\\\Responders\\\\Index.cs:line 90\\r\\n   at Raven.Database.Server.Responders.Index.Respond(IHttpContext context) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Server\\\\Responders\\\\Index.cs:line 45\\r\\n   at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Server\\\\HttpServer.cs:line 548\\r\\n   at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx) in c:\\\\Builds\\\\RavenDB-Stable\\\\Raven.Database\\\\Server\\\\HttpServer.cs:line 315\"\r\n}"}

Any help would be much appreciated. I'm releasing in about two weeks...and I can easily delay this particular feature if I have to, but I'd rather not ;)

Oren Eini (Ayende Rahien)

unread,
Jun 20, 2012, 3:22:58 PM6/20/12
to rav...@googlegroups.com
Can you create a failing test for this?

EisenbergEffect

unread,
Jun 20, 2012, 3:30:32 PM6/20/12
to rav...@googlegroups.com
I'm really strapped for time....it's not a big deal for me if I add the feature dependent on this a few weeks after release. If I can get a few minutes, I'll try to put something together, otherwise it might be a few weeks out.

Oren Eini (Ayende Rahien)

unread,
Jun 21, 2012, 1:46:20 AM6/21/12
to rav...@googlegroups.com
Okay, I'll try to see if I can reproduce this, and anyway, I'll add some additional information that would make it easier to work with in the future.

Oren Eini (Ayende Rahien)

unread,
Jun 21, 2012, 6:25:38 AM6/21/12
to rav...@googlegroups.com
Rob,
I added additional error handling there, this should give us better info starting from the next build on what exactly is wrong.
If you have time, please try it there, and see if it gives more information.
Reply all
Reply to author
Forward
0 new messages