question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception thrown: Cannot cast EmptyPage to ExtendPage

See original GitHub issue

This crash occured when attempting to insert a document on LiteDB 2.0 (latest version). I didn’t have a PDB available at that time but I do now so I’ll post a proper stacktrace and maybe provide a repro next time the program crashes.

 System.InvalidCastException: Unable to cast object of type 'LiteDB.EmptyPage' to type 'LiteDB.ExtendPage'.
   at LiteDB.PageService.GetPage[T](UInt32 pageID, Boolean setDirty)
   at LiteDB.PageService.<GetSeqPages>d__5`1.MoveNext()
   at LiteDB.DataService.ReadExtendData(UInt32 extendPageID)
   at LiteDB.DbEngine.<Find>d__9.MoveNext()
   at LiteDB.LiteCollection`1.<Find>d__34.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()

/cc @mbdavid

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mbdavidcommented, Oct 31, 2016

I was waiting an OK from someone who has this error. I will release v2.0.3 in nuget before v3 (plans to release v3 only in december)

0reactions
mbdavidcommented, Apr 6, 2017

Hi @hardknoxni69a, could you open new issue about this and point me on your code where are you using litedb?

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - InvalidCastException: Unable To Cast Objects of type [ ...
So a invalid cast exception is thrown. If it didn't throw an invalid cast exception, then we could try to do something like...
Read more >
Convert\move a page to news (blog post) and news to a page
GeneralUtil threw exception java.lang.ClassCastException: com.atlassian.confluence.pages.Page cannot be cast to com.atlassian.confluence.pages.
Read more >
django cms Documentation
django CMS is a modern web publishing platform built with Django, the web application framework “for perfectionists with deadlines”.
Read more >
Cognos - Guidelines for memory and other settings
Cognos - Guidelines for memory and other settings · Maximum memory for Webspere Liberty: For Cognos 10: 1.5 GB is sufficient in most...
Read more >
https://www.drupal.org/files/issues/revert-a-coupl...
+ * + * @throws \Exception + */ + protected static function ... + } + else { + throw new \Exception("Can't determine...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found