Upgrading to Build 700 caused error "Nullable object must have a value"

113 views
Skip to first unread message

LinusK

unread,
Mar 15, 2012, 5:35:21 AM3/15/12
to rav...@googlegroups.com
I just upgraded to build 700 on my dev machine and got this error when the studio is accessing the database.

{
  • Url: "/indexes/Raven/DocumentsByEntityName?query=Tag%253ATags&start=0&pageSize=0&aggregation=None",
  • Error: "System.InvalidOperationException: Nullable object must have a value. at System.Nullable`1.get_Value() at Raven.Storage.Esent.StorageActions.DocumentStorageActions.IndexLastUpdatedAt(String name) in c:\Builds\RavenDB-Stable\Raven.Storage.Esent\StorageActions\Staleness.cs:line 132 at Raven.Database.DocumentDatabase.<>c__DisplayClass7f.<Query>b__77(IStorageActionsAccessor actions) in c:\Builds\RavenDB-Stable\Raven.Database\DocumentDatabase.cs:line 740 at Raven.Storage.Esent.TransactionalStorage.ExecuteBatch(Action`1 action) in c:\Builds\RavenDB-Stable\Raven.Storage.Esent\TransactionalStorage.cs:line 378 at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action) in c:\Builds\RavenDB-Stable\Raven.Storage.Esent\TransactionalStorage.cs:line 339 at Raven.Database.DocumentDatabase.Query(String index, IndexQuery query) in c:\Builds\RavenDB-Stable\Raven.Database\DocumentDatabase.cs:line 730 at Raven.Database.Server.Responders.Index.PerformQueryAgainstExistingIndex(IHttpContext context, String index, IndexQuery indexQuery, Guid& indexEtag) in c:\Builds\RavenDB-Stable\Raven.Database\Server\Responders\Index.cs:line 174 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 160 at Raven.Database.Server.Responders.Index.GetIndexQueryRessult(IHttpContext context, String index) in c:\Builds\RavenDB-Stable\Raven.Database\Server\Responders\Index.cs:line 116 at Raven.Database.Server.Responders.Index.OnGet(IHttpContext context, String index) in c:\Builds\RavenDB-Stable\Raven.Database\Server\Responders\Index.cs:line 88 at Raven.Database.Server.Responders.Index.Respond(IHttpContext context) in c:\Builds\RavenDB-Stable\Raven.Database\Server\Responders\Index.cs:line 43 at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx) in c:\Builds\RavenDB-Stable\Raven.Database\Server\HttpServer.cs:line 534 at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx) in c:\Builds\RavenDB-Stable\Raven.Database\Server\HttpServer.cs:line 309"
}

My Tag class looks like this:

    public class Tag
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }

        public override string ToString()
        {
            return this.GetPublicPropertiesAsString();
        }
    }

Is it a bug or did I do something wrong?

Fitzchak Yitzchaki

unread,
Mar 15, 2012, 6:00:11 AM3/15/12
to rav...@googlegroups.com
Can you write a failing test?
This is a passing one:

public class LinusK : RavenTest
{
	
public class Tag
	{
		public string Id { getset; }
		public string Name { getset; }
		public string Description { getset
; }
	}
 
	[Fact]
	public void CanQuery()
	{
		using (var store = NewDocumentStore())
		using (var session = store.OpenSession())
		{
			session.Store(new Tag {Name = "tag"});
			session.SaveChanges();
 
			var tags = session.Query<Tag>()
				.Customize(x => x.WaitForNonStaleResultsAsOfNow())
				.ToList();
 
			Assert.Equal(1, tags.Count);
		}	
	}
}

LinusK

unread,
Mar 15, 2012, 6:02:12 AM3/15/12
to rav...@googlegroups.com
And having the same problem with unstable build 709.

Fitzchak Yitzchaki

unread,
Mar 15, 2012, 6:03:15 AM3/15/12
to rav...@googlegroups.com
Please open an issue about this here: http://issues.hibernatingrhinos.com/issues with the failing test.

LinusK

unread,
Mar 15, 2012, 6:19:01 AM3/15/12
to rav...@googlegroups.com
I actually don't see the how the test will help. Because the error occurred directly after the upgrade when the Studio accessed the server.

When I run your test on an in-memory store it succeeds. When I run it against regular store I get the same error as stated before:

System.InvalidOperationException: Nullable object must have a value.
   at System.Nullable`1.get_Value()
   at Raven.Storage.Esent.StorageActions.DocumentStorageActions.IndexLastUpdatedAt(String name) in c:\Builds\RavenDB-Unstable\Raven.Storage.Esent\StorageActions\Staleness.cs:line 132
   at Raven.Database.DocumentDatabase.<>c__DisplayClass82.<Query>b__78(IStorageActionsAccessor actions) in c:\Builds\RavenDB-Unstable\Raven.Database\DocumentDatabase.cs:line 751
   at Raven.Storage.Esent.TransactionalStorage.ExecuteBatch(Action`1 action) in c:\Builds\RavenDB-Unstable\Raven.Storage.Esent\TransactionalStorage.cs:line 378
   at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action) in c:\Builds\RavenDB-Unstable\Raven.Storage.Esent\TransactionalStorage.cs:line 339
   at Raven.Database.DocumentDatabase.Query(String index, IndexQuery query) in c:\Builds\RavenDB-Unstable\Raven.Database\DocumentDatabase.cs:line 739
   at Raven.Database.Queries.DynamicQueryRunner.ExecuteActualQuery(IndexQuery query, DynamicQueryMapping map, Tuple`2 touchTemporaryIndexResult, String realQuery) in c:\Builds\RavenDB-Unstable\Raven.Database\Queries\DynamicQueryRunner.cs:line 81
   at Raven.Database.Queries.DynamicQueryRunner.ExecuteDynamicQuery(String entityName, IndexQuery query) in c:\Builds\RavenDB-Unstable\Raven.Database\Queries\DynamicQueryRunner.cs:line 48
   at Raven.Database.Queries.DynamicQueryExtensions.ExecuteDynamicQuery(DocumentDatabase self, String entityName, IndexQuery indexQuery) in c:\Builds\RavenDB-Unstable\Raven.Database\Queries\DynamicQueryExtensions.cs:line 17
   at Raven.Database.Server.Responders.Index.PerformQueryAgainstDynamicIndex(IHttpContext context, String index, IndexQuery indexQuery, Guid& indexEtag) in c:\Builds\RavenDB-Unstable\Raven.Database\Server\Responders\Index.cs:line 224
   at Raven.Database.Server.Responders.Index.ExecuteQuery(IHttpContext context, String index, Guid& indexEtag) in c:\Builds\RavenDB-Unstable\Raven.Database\Server\Responders\Index.cs:line 169
   at Raven.Database.Server.Responders.Index.GetIndexQueryRessult(IHttpContext context, String index) in c:\Builds\RavenDB-Unstable\Raven.Database\Server\Responders\Index.cs:line 118
   at Raven.Database.Server.Responders.Index.OnGet(IHttpContext context, String index) in c:\Builds\RavenDB-Unstable\Raven.Database\Server\Responders\Index.cs:line 90
   at Raven.Database.Server.Responders.Index.Respond(IHttpContext context) in c:\Builds\RavenDB-Unstable\Raven.Database\Server\Responders\Index.cs:line 45
   at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx) in c:\Builds\RavenDB-Unstable\Raven.Database\Server\HttpServer.cs:line 543
   at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx) in c:\Builds\RavenDB-Unstable\Raven.Database\Server\HttpServer.cs:line 313
at Raven.Client.Connection.HttpJsonRequest.HanldeErrors(WebException e)
at Raven.Client.Connection.HttpJsonRequest.ReadStringInternal(Func`1 getResponse)
at Raven.Client.Connection.HttpJsonRequest.ReadResponseString()
at Raven.Client.Connection.HttpJsonRequest.ReadResponseJson()
at Raven.Client.Connection.ServerClient.DirectQuery(String index, IndexQuery query, String operationUrl, String[] includes)
at Raven.Client.Connection.ServerClient.<>c__DisplayClass37.<Query>b__36(String u)
at Raven.Client.Connection.ServerClient.TryOperation[T](Func`2 operation, String operationUrl, Boolean avoidThrowing, T& result)
at Raven.Client.Connection.ServerClient.ExecuteWithReplication[T](String method, Func`2 operation)
at Raven.Client.Connection.ServerClient.Query(String index, IndexQuery query, String[] includes)
at Raven.Client.Document.AbstractDocumentQuery`2.ExecuteActualQuery()
at Raven.Client.Document.AbstractDocumentQuery`2.InitSync()
at Raven.Client.Document.AbstractDocumentQuery`2.get_QueryResult()
at Raven.Client.Linq.RavenQueryProviderProcessor`1.ExecuteQuery[TProjection]()
at Raven.Client.Linq.RavenQueryProviderProcessor`1.Execute(Expression expression)
at Raven.Client.Linq.DynamicRavenQueryProvider`1.Execute(Expression expression)
at Raven.Client.Linq.DynamicRavenQueryProvider`1.System.Linq.IQueryProvider.Execute(Expression expression)
at Raven.Client.Linq.RavenQueryInspector`1.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
LinusK.cs(31,0): at Tests.LinusK.CanQuery()



Den torsdagen den 15:e mars 2012 kl. 11:03:15 UTC+1 skrev Fitzchak Yitzchaki:
Please open an issue about this here: http://issues.hibernatingrhinos.com/issues with the failing test.

Oren Eini (Ayende Rahien)

unread,
Mar 15, 2012, 6:20:43 AM3/15/12
to rav...@googlegroups.com
Is this against a NEW store, or against an existing store that was upgraded from an older build?

LinusK

unread,
Mar 15, 2012, 6:21:52 AM3/15/12
to rav...@googlegroups.com
It's from an upgraded store.

Oren Eini (Ayende Rahien)

unread,
Mar 15, 2012, 7:28:47 AM3/15/12
to rav...@googlegroups.com
Hm...
Okay, I think that I fixed this issue, please test this again with the next build.

Linus Kvarnhammar

unread,
Mar 15, 2012, 7:50:57 AM3/15/12
to rav...@googlegroups.com
Ok, when can I expect it?

Oren Eini (Ayende Rahien)

unread,
Mar 15, 2012, 7:55:42 AM3/15/12
to rav...@googlegroups.com
A few hours, at most.

Linus Kvarnhammar

unread,
Mar 15, 2012, 9:46:58 AM3/15/12
to rav...@googlegroups.com
That seemed to fix it. Thanks!

But the studio is broken. Crashes hard at load time.

/Linus

Oren Eini (Ayende Rahien)

unread,
Mar 15, 2012, 10:15:46 AM3/15/12
to rav...@googlegroups.com
Yeah, unstable is as as unstale as the name suggest.
We try to do better though, and we will have a better build soo

Linus Kvarnhammar

unread,
Mar 15, 2012, 10:19:44 AM3/15/12
to rav...@googlegroups.com
Maybe you could introduce voting on builds - like R# EAP. Could be a good idea both for Stable and Unstable builds. 

And when I'm at it would also like to suggest better release notes - so that I know if I should upgrade or not.

Oren Eini (Ayende Rahien)

unread,
Mar 15, 2012, 10:25:37 AM3/15/12
to rav...@googlegroups.com
Working on both things, yes

Dave Baird

unread,
Mar 28, 2012, 5:54:34 PM3/28/12
to rav...@googlegroups.com
When is the next stable build coming out that has this fix included?  We need to upgrade Raven in a production environment to fix a separate issue and when we went to 701 this cropped up.
Thanks,
Dave B

Itamar Syn-Hershko

unread,
Mar 28, 2012, 6:11:15 PM3/28/12
to rav...@googlegroups.com
Hopefully tomorrow
Reply all
Reply to author
Forward
0 new messages