realm / realm-swift

Realm is a mobile database: a replacement for Core Data & SQLite
https://realm.io
Apache License 2.0
16.32k stars 2.15k forks source link

Getting Crash - RLMException Database has an unsupported version (9) and cannot be upgraded #8684

Open aalivp opened 2 months ago

aalivp commented 2 months ago

How frequently does the bug occur?

-- select --

Description

after updating realam version from 10.7.6 to 10.49.2, our app users (not all) are getting crash is logged in our system as

boost::detail::function::function_obj_invoker2<boost::algorithm::detail::token_finderF<boost::algorithm::detail::pred_orF<boost::algorithm::detail::is_classifiedF, boost::algorithm::detail::pred_andF<boost::algorithm::detail::is_classifiedF, boost::algorithm::detail::pred_notF<boost::algorithm::detail::is_any_ofF > > > >, boost::iterator_range<std::1::wrap_iter<char const> >, std::1::wrap_iter<char const>, std::1::wrap_iter<char const> >::invoke(boost::detail::function::function_buffer&, std::1::wrap_iter<char const>, std::1::wrap_iter<char const*>) SIGABRT: Database has an unsupported version (9) and cannot be upgraded

Stacktrace & log output

CoreFoundation
0x00000001a77b5000 + 540448
libobjc.A.dylib
0x000000019f6d4000 + 90136
AppName
boost::detail::function::function_obj_invoker2<boost::algorithm::detail::token_finderF<boost::algorithm::detail::pred_orF<boost::algorithm::detail::is_classifiedF, boost::algorithm::detail::pred_andF<boost::algorithm::detail::is_classifiedF, boost::algorithm::detail::pred_notF<boost::algorithm::detail::is_any_ofF<char> > > > >, boost::iterator_range<std::__1::__wrap_iter<char const*> >, std::__1::__wrap_iter<char const*>, std::__1::__wrap_iter<char const*> >::invoke(boost::detail::function::function_buffer&, std::__1::__wrap_iter<char const*>, std::__1::__wrap_iter<char const*>)
AppName
boost::detail::function::function_obj_invoker2<boost::algorithm::detail::token_finderF<boost::algorithm::detail::pred_orF<boost::algorithm::detail::is_classifiedF, boost::algorithm::detail::pred_andF<boost::algorithm::detail::is_classifiedF, boost::algorithm::detail::pred_notF<boost::algorithm::detail::is_any_ofF<char> > > > >, boost::iterator_range<std::__1::__wrap_iter<char const*> >, std::__1::__wrap_iter<char const*>, std::__1::__wrap_iter<char const*> >::invoke(boost::detail::function::function_buffer&, std::__1::__wrap_iter<char const*>, std::__1::__wrap_iter<char const*>)
AppName
boost::detail::function::function_obj_invoker2<boost::algorithm::detail::token_finderF<boost::algorithm::detail::pred_orF<boost::algorithm::detail::is_classifiedF, boost::algorithm::detail::pred_andF<boost::algorithm::detail::is_classifiedF, boost::algorithm::detail::pred_notF<boost::algorithm::detail::is_any_ofF<char> > > > >, boost::iterator_range<std::__1::__wrap_iter<char const*> >, std::__1::__wrap_iter<char const*>, std::__1::__wrap_iter<char const*> >::invoke(boost::detail::function::function_buffer&, std::__1::__wrap_iter<char const*>, std::__1::__wrap_iter<char const*>)
AppName
boost::detail::function::function_obj_invoker2<boost::algorithm::detail::token_finderF<boost::algorithm::detail::pred_orF<boost::algorithm::detail::is_classifiedF, boost::algorithm::detail::pred_andF<boost::algorithm::detail::is_classifiedF, boost::algorithm::detail::pred_notF<boost::algorithm::detail::is_any_ofF<char> > > > >, boost::iterator_range<std::__1::__wrap_iter<char const*> >, std::__1::__wrap_iter<char const*>, std::__1::__wrap_iter<char const*> >::invoke(boost::detail::function::function_buffer&, std::__1::__wrap_iter<char const*>, std::__1::__wrap_iter<char const*>)
AppName
boost::detail::function::function_obj_invoker2<boost::algorithm::detail::token_finderF<boost::algorithm::detail::pred_orF<boost::algorithm::detail::is_classifiedF, boost::algorithm::detail::pred_andF<boost::algorithm::detail::is_classifiedF, boost::algorithm::detail::pred_notF<boost::algorithm::detail::is_any_ofF<char> > > > >, boost::iterator_range<std::__1::__wrap_iter<char const*> >, std::__1::__wrap_iter<char const*>, std::__1::__wrap_iter<char const*> >::invoke(boost::detail::function::function_buffer&, std::__1::__wrap_iter<char const*>, std::__1::__wrap_iter<char const*>)
AppName
_mh_execute_header
AppName
_mh_execute_header
libdispatch.dylib
0x00000001af6da000 + 8508

Can you reproduce the bug?

No

Reproduction Steps

No response

Version

10.49.2

What Atlas Services are you using?

Local Database only

Are you using encryption?

-- select --

Platform OS and version(s)

ios 15.x, 16.x, 17.x ios 18, ipadOS 1.x, ipadOS 16.x, ipadOS17.x

Build environment

Xcode version: Xcode 15 Dependency manager and version: Cocoapods

sync-by-unito[bot] commented 2 months ago

➤ PM Bot commented:

Jira ticket: RCOCOA-2431

aalivp commented 1 month ago

Really appreciate your quick support on this. Thanks

BlueCobold commented 1 day ago

According to https://github.com/realm/realm-core/blob/master/CHANGELOG.md, the current Realm File Format needs to be at least 10 to upgrade your file to the current one. Is it possible you or your users have not updated Realm for quite a while? Because in this case, the old file format is no longer supported. I personally think old versions should NEVER be unsupported anymore, because you never know when your users updated your app the last time. But there we are. These users would need to receive a realm-version which does allow them to upgrade their database to an intermediate version first before using the latest Realm version. However, this is a serious technical issue as you cannot use multiple realm version in your app and you cannot roll out a lower version app to those of your users who already received the upgrade and which had a successful migration to the new file format. The only other solution I see is that users will have to contact you, submit their file and you upgrade it on your end in multiple steps towards the final version. Which - I know - is a real pain and should not be required.