Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Fatal Exception: mapbox::sqlite::Exception unable to open database file #5651

Closed

Description

@MikeKasperlik

We see another crash which happens very frequently in our app. Maybe it's related to #4841 but it has a different stack trace / error message.

Platform: iOS
Mapbox SDK version: 3.2.3 - 3.3.0-rc.1

Fatal Exception: mapbox::sqlite::Exception unable to open database file

Crashed: DefaultFileSource
0  PACEApp                        0x1006fbfa8 CLSProcessRecordAllThreads + 4301553576
1  PACEApp                        0x1006fbfa8 CLSProcessRecordAllThreads + 4301553576
2  PACEApp                        0x1006fc3c8 CLSProcessRecordAllThreads + 4301554632
3  PACEApp                        0x1006ed088 CLSHandler + 4301492360
4  PACEApp                        0x1006fa6bc __CLSExceptionRecord_block_invoke + 4301547196
5  libdispatch.dylib              0x181d2547c _dispatch_client_callout + 16
6  libdispatch.dylib              0x181d30728 _dispatch_barrier_sync_f_invoke + 100
7  PACEApp                        0x1006fa168 CLSExceptionRecord + 4301545832
8  PACEApp                        0x1006f9cec CLSTerminateHandler() + 4301544684
9  libc++abi.dylib                0x181932f44 std::__terminate(void (*)()) + 16
10 libc++abi.dylib                0x181932b10 __cxa_rethrow + 144
11 libobjc.A.dylib                0x181940120 objc_exception_rethrow + 44
12 CoreFoundation                 0x1821b8cf8 CFRunLoopRunSpecific + 552
13 CoreFoundation                 0x1822063a4 CFRunLoopRun + 112
14 Mapbox                         0x10193b6b8 void mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::run<std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>, 0ul, 1ul>(std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) + 156
15 Mapbox                         0x10193b5d8 std::__1::__thread_proxy<std::__1::tuple<mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(mbgl::util::ThreadContext const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&, unsigned long long&&&)::'lambda'()> >(void*, void*) + 136
16 libsystem_pthread.dylib        0x181f3fb28 _pthread_body + 156
17 libsystem_pthread.dylib        0x181f3fa8c _pthread_body + 154
18 libsystem_pthread.dylib        0x181f3d028 thread_start + 4

I can't reproduce it every time, but it happens 100% when the app is in background (according to crashlytics).

I attempted to fix it by setting the cache.db and the containing directory to NSFileProtectionNone - but that didn't do anything.

Activity

  1. added
    iOS
    on Jul 12, 2016
  2. MikeKasperlik commented on Jul 19, 2016

    @MikeKasperlik
    Author

    Seems to be fixed in 3.3.0.

  3. ampedersen commented on Aug 25, 2016

    @ampedersen

    I am getting this error on Android this morning.

    E/libc++abi: terminating with uncaught exception of type mapbox::sqlite::Exception: unable to open database file

  4. vanshg commented on Aug 26, 2016

    @vanshg

    I also started getting this error on Android. Maybe a 4.2.0-beta.2 bug? @tobrun

  5. tobrun commented on Aug 26, 2016

    @tobrun
    Member
  6. vanshg commented on Aug 26, 2016

    @vanshg

    @tobrun @friedbunny
    If I fresh install my application with 4.2.0-beta.2, I get the crash when I start panning. If I then downgrade back to 4.1.1, I still continue to get the error.

    However, if I fresh install with 4.1.1, the error goes away. If I then upgrade to 4.2.0-beta.2 from 4.1.1, there is no crash.

    So I'm guessing it has something to do with the way 4.2.0 creates the sqlite database

  7. vanshg commented on Aug 26, 2016

    @vanshg

    The Demo app also continuously crashes on every sample (not just new ones). Not sure if related, but could be

  8. friedbunny commented on Aug 26, 2016

    @friedbunny
    Contributor

    @vanshg @drsheman What version of Android are you using and on which devices?

    The database schema did change in 4.2.0-beta.2 (#5796) and trying to use an upgraded database with an older SDK version will not work.

  9. vanshg commented on Aug 26, 2016

    @vanshg

    7.0, Nexus 6P

  10. friedbunny commented on Aug 26, 2016

    @friedbunny
    Contributor

    @vanshg If you could, please post a stack trace of the Android crash from a fresh 4.2.0-beta.2 install.

  11. vanshg commented on Aug 26, 2016

    @vanshg

    Don't seem to be getting the crash anymore from fresh install of 4.2.0. I'll post one if it happens again. However, the Demo app does still keep crashing

  12. friedbunny commented on Aug 29, 2016

    @friedbunny
    Contributor

    The original issue in this thread related to iOS and appears to have been resolved, so let’s move Android discussion to #6193.

  13. friedbunny commented on Sep 5, 2016

    @friedbunny
    Contributor

    Reports of this issue on iOS v3.3.4, so I’m reopening.

  14. devinross commented on Feb 7, 2017

    @devinross

    See this issue from commit 4cff0977a0 on iOS

  15. devinross commented on Mar 10, 2017

    @devinross

    Any movement on this issue?

  16. boundsj commented on Mar 16, 2017

    @boundsj
    Contributor

    It is possible this issue will also be fixed by #8125 that will be in the next Mapbox iOS SDK release (3.5.0). However, there are still no known repro steps here so we will leave this open for now for tracking.

  17. Sealos commented on Aug 14, 2017

    @Sealos

    I'm also seeing this issue on Mapbox 3.6. Can't reproduce locally, however, we've seen plenty of crashes in fabric due to this exception.

    Fatal Exception: mapbox::sqlite::Exception: unable to open database file
    
    #16. Crashed: DefaultFileSource
    0  XXXXXXXX                       0x10039f300 CLSProcessRecordAllThreads (CLSProcess.c:376)
    1  XXXXXXXX                       0x10039f300 CLSProcessRecordAllThreads (CLSProcess.c:376)
    2  XXXXXXXX                       0x10039f1b0 CLSProcessRecordAllThreads (CLSProcess.c:407)
    3  XXXXXXXX                       0x10038fa98 CLSHandler (CLSHandler.m:26)
    4  XXXXXXXX                       0x10039d3a4 __CLSExceptionRecord_block_invoke (CLSException.mm:199)
    5  libdispatch.dylib              0x181bf69a0 _dispatch_client_callout + 16
    6  libdispatch.dylib              0x181c03ee0 _dispatch_barrier_sync_f_invoke + 84
    7  XXXXXXXX                       0x10039ce50 CLSExceptionRecord (CLSException.mm:206)
    8  XXXXXXXX                       0x10039c964 CLSTerminateHandler() (CLSException.mm:265)
    9  libc++abi.dylib                0x18178f5d4 std::__terminate(void (*)()) + 16
    10 libc++abi.dylib                0x18178f1a8 __cxa_rethrow + 144
    11 Mapbox                         0x100ae1d9c mbgl::OfflineDatabase::ensureSchema() + 928
    12 Mapbox                         0x100ae19bc mbgl::OfflineDatabase::OfflineDatabase(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long long) + 88
    13 Mapbox                         0x100ad3834 _hidden#9206_ + 516
    14 Mapbox                         0x100ad3720 void mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::run<std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>, 0ul, 1ul>(std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) + 240
    15 Mapbox                         0x100ad368c std::__1::__thread_proxy<std::__1::tuple<mbgl::util::Thread<mbgl::DefaultFileSource::Impl>::Thread<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long&>(mbgl::util::ThreadContext const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&&&, unsigned long long&&&)::'lambda'()> >(void*, void*) + 92
    16 libsystem_pthread.dylib        0x181e0168c _pthread_body + 240
    17 libsystem_pthread.dylib        0x181e0159c _pthread_body + 282
    18 libsystem_pthread.dylib        0x181dfecb4 thread_start + 4
    
  18. Sealos commented on Oct 6, 2017

    @Sealos

    Any updates on this? This issue is the second and third top crash, reported by Fabric. It occurs to a very small population (~8-14 users) but has over 1500 crashes reported in one week.

    Mapbox is linked Dynamically, and we're using Mapbox 3.6.3.

  19. kkaefer commented on Aug 15, 2018

    @kkaefer
    Member

    Fixed in #12224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashiOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions