Symbol Not found error

Hi,

I have several reports from ERA (and one user has emailed me) to say that my app is crashing when trying to run a specific function of the app. This function stores some data in storage.

The code is:


    function saveToStorage(tileData){
        var tileId = tileData["info"]["id"].toString(); 
        //System.println("Saving Tile Id " + tileId + " to storage.");
        
        try{
            Storage.setValue(tileId, tileData);
        }catch (ex instanceof StorageFullException){
            //System.println("Storage Full");
        }
        catch (ex instanceof UnexpectedTypeException){
           //System.println(ex);
        }
            
        
//        if(AppConstants.DEBUG){
//        }
    }

The error is:

Error Name: Symbol Not Found Error
Occurrences: 11
First Occurrence: 2021-09-23
Last Occurrence: 2021-10-06
Devices:
fēnix® 6 / 6 Solar / 6 Dual Power: 19.20
Forerunner® 245: 7.80
vívoactive® 3: 7.80
Venu® Sq: 2.90
App Versions: 0.0.31
Languages: ces, dut, eng
Backtrace:
MapTileLoader.saveToStorage:170
DownloadRouteMap.onReceiveTile:261

The line in question is:

Storage.setValue(tileId, tileData);

The Forerunner 245 that the user has emailed me about should be running 3.2, and I have run exactly the same code in the simulator using the same input data and it works just fine.

Can anyone suggest where I should be looking to understand why this isn't working for a small number of people in some cases? 

The user who reported it reported that it started happening a few days back (no release of the app) and now affects any route he tries to load, even ones which were previously OK.

I will ask him to run some logging, but can the value of tileId cause this error if, for example, it were null? 

Thanks

David

  • I can't explain the exact error you're seeing here, but...

    The Forerunner 245 that the user has emailed me about should be running 3.2

    ...I'm curious why you mentioned 3.2? Are you calling Storage.setValue() from a background process? If you call it from a foreground process you only need 2.4.

    But if you call it a background process you do need 3.2, and Vivoactive 3 only has support for 3.1, which is interesting because it's in the list of devices in the ERA.

    Although, I would expect you'd see a different error if you try to call Storage.setValue from a background process on api level >= 2.4 and api level < 3.2: an unhandled exception of type Application.ObjectStoreAccessException. (Unfortunately the exception type doesn't appear in ERAs IIRC.)

    but can the value of tileId cause this error if, for example, it were null? 

    No. It really does seem like the problem here is with Storage.setValue(). But you could test your theory by changing the value of tileId locally.

  • Thanks. I've had someone try it locally and they get

    Error: Symbol Not Found Error
    Details: "Could not find symbol 'StorageFullException'"
    Time: 2021-10-08T06:38:13Z
    Part-Number: 006-B3076-00
    Firmware-Version: '7.80'
    Language-Code: dut
    ConnectIQ-Version: 4.0.4
    Filename: Mappily
    Appname: Mappily
    Stack:

    I would guess this could be masking the underlying issue (which might be that the storage could actually be full)

    I have included:

    using Toybox.Lang;

    at the top of the file. I'm missing something obvious, but can't see what it is. Do I need to use 

    catch (ex instanceof Lang.StorageFullException){

    or is there something else going on?

  • See if you can get a listing of the garmin/apps/data folder including the file sizes.  See what's happening with Storage for your app (this is where those files are), as it's not easy to fill that up.

  • Thanks. I've asked.  I'm confused about it throwing a Symbol Not Found error instead of generating the exception and printing it out. Is that something you'd expect?

    The app does save a good amount of data, but I have a menu item which does Storage.clear() and he has run it to no avail.

  • It could be storage is full and tried to throw the exception, and that's when you see the symbol not found.

    How do you manage your storage?  delete old keys, reuse them, or just keep adding new ones?

  • It optimistically tries to save as much map data as possible. Each map section has its own key. It's perfectly possible it's filling storage, but I clear the storage before trying to download a new map and you can Delete All which calls Storage.clear(). O hoped that it would throw a storage full exception and I can simply show that and allow the user to delete the data. 

    The symbol not found error is unexpected. I've removed the specific catch and asked him to run it again. Hopefully that will tell me the error type, whether that's storage full or something else.

  • How big is a map section?  I imagine it will vary by the side of the display and colors.  How many segments would you try to save at one time?  Have you tried to fill Storage in the sim to see what happens?

  • I have saved very large map areas in the sim but it doesn't fill up. I have also been unable to recreate on my own watch.

    Any idea how the limit is reached? Is it a software control per app, or the storage actually running out

  • When you run out of storage, it is the Storage available to your app.  If I recall, it's 80-100k with 8k per key per app.  The old object store is a total of about 8k.

  • The .DAT file on my vivoacitve is 146k and I have no problem. On the user's 245 it's 112k, so those files don't seem to bear direct relation to the space limit.

    I still cannot understand how it can be generating a Symbol Not Found error when trying to throw an exception. This is surely a bug in the SDK. The StorageFullException should be available in that version of the SDK.

    I have sent him a version of my app which prints getErrorMessage() on the exception in the hope that sheds some light on the issue. My previous attempt printed out the exception object toString() which wasn't very enlightening.