How to interpret the CIQ_LOG.BAK`?

I recently got contacted by a user who experiences that my app crashes. I asked if he could send me the log files and I got a CIQ_LOG.BAK file from his device. Opening this in a text editor, I can see some logs related to my app. But the log is not as complete as the example on https://developer.garmin.com/connect-iq/core-topics/debugging/ 

In the Garmin example, there is for instance information about what file that caused the error, and what line in the file. I only have a pc-stack (see below). Can I build an app that produces more useful logs?

My entire log looks like this (two entries for my app, and one entry for spotify):

---
Error: System Error
Details: 'Failed invoking <symbol>'
Time: 2024-10-05T09:12:53Z
Part-Number: 006-B4315-00
Firmware-Version: '20.29'
Language-Code: dut
ConnectIQ-Version: 5.0.1
Store-Id: 80f06d38-3cd1-4463-b097-902ef1925533
Store-Version: 19
Filename: E7IJ5658
Appname: Hektors RefWatch
Stack:
- pc: 0x1000624a
- pc: 0x10005340
- pc: 0x100062f7
- pc: 0x100031ec
---
Error: System Error
Details: 'Failed invoking <symbol>'
Time: 2024-10-05T09:13:23Z
Part-Number: 006-B4315-00
Firmware-Version: '20.29'
Language-Code: dut
ConnectIQ-Version: 5.0.1
Store-Id: 80f06d38-3cd1-4463-b097-902ef1925533
Store-Version: 19
Filename: E7IJ5658
Appname: Hektors RefWatch
Stack:
- pc: 0x1000624a
- pc: 0x10005340
- pc: 0x100062f7
- pc: 0x100031ec
---
Error: System Error
Details: 'Failed invoking <symbol>'
Time: 2024-10-05T09:13:51Z
Part-Number: 006-B4315-00
Firmware-Version: '20.29'
Language-Code: dut
ConnectIQ-Version: 5.0.1
Store-Id: 30c6c876-ba43-4cbb-b4c7-03583a7cb66b
Store-Version: 64
Filename: E7II3701
Appname: Spotify
Stack:
- pc: 0x1000e822
- pc: 0x100091b8

  • When you see the ciq_log.bak, that means it's been synced and should show in the ERA reports for your apps.  When in ERA, the pc: values are translated into a friendly stack trace.  But with the file, you can do the translation yourself.

    See https://forums.garmin.com/developer/connect-iq/f/discussion/231129/so-you-have-a-ciq_log-file-but-all-you-see-is-pc-without-a-friendly-stack-trace---what-to-do

  • Thank you for your response jim!

    I looked into the thread you posted. Never tried ERA before but I got i going and added my user. I can see that my app is there, but there doesn't seem to be any errors of any kind. Hence no stack trace... Maybe it needs a day or two to synchronize, the error inte the log happened this morning.

    But I tried following the pc trace and debugging the hex values manually with the debug.xml in the .iq file (I'm learning so much here!) and I found the trace in my code. The thing that puzzles me is that the trace is related to the start of my application. The user reported a crash after the app has been in use for more than 40 minutes, so it should not be related to the start. Or am I looking at the wrong log file perhaps?

    The log file says this:

    ---
    Error: System Error
    Details: 'Failed invoking <symbol>'
    Time: 2024-10-05T09:12:53Z
    Part-Number: 006-B4315-00
    Firmware-Version: '20.29'
    Language-Code: dut
    ConnectIQ-Version: 5.0.1
    Store-Id: 80f06d38-3cd1-4463-b097-902ef1925533
    Store-Version: 19
    Filename: E7IJ5658
    Appname: Hektors RefWatch
    Stack: 
      - pc: 0x1000624a
      - pc: 0x10005340
      - pc: 0x100062f7
      - pc: 0x100031ec
    ---

    If I follow the trace the first hexnumber corresponds to this line in my function updateState().

    App.Storage.setValue("game_state", state);

    This function is called a lot of times but the second hexvalue in the stack says that it's called from within my other function initValues(). initValues() is called two times in my code but the third value in the stack tells me that it comes from the initialize() function in my main delegate.

    The last value in the stack corresponds to decimal 268448236. In my debug.xml i see this:

    ...HektorsSoccerRefApp.mc" id="85" lineNum="23" parent="globals/HektorsSoccerRefApp" pc="268448201" symbol="getInitialView"/>
    ...HektorsSoccerRefApp.mc" id="86" lineNum="8" parent="globals/HektorsSoccerRefApp" pc="268448239" symbol="initialize"/>

    I don't know how I should interpret "between line 23 and line 8" in the file. Anyhow, what happens in the getInitialView is this:

        // Return the initial view of your application here
        function getInitialView(){
            _view = new HektorsSoccerRefView();
            return [ _view, new HektorsSoccerRefDelegate() ]; // THIS IS LINE 23 IN MY CODE
        }

    So I can't find a crash related to the scenario the user described. I have never heard of anyone else having this issue either. I had about 500 download (before garmin rounded number of downloads to 100+ and 1000+...not annoying at all...). And never got the complaint about this type of crash. 

    Any ideas where I could continue the troubleshooting?

  • The user that had the crash has to sync the device with Garmin connect. You should be able to see the report in ERA viewer a minute later

  • It becomes a .bak after it's synced.  It's so the same file isn't repeatedly synced.  But if a new version was uploaded to the store, you don't see ERA reports for the version that generated the CIQ_LOG file.

    This is why you want to check ERA before you publish an update to an app, and also why you may not want to upload a new version for a fairly minor thing, but batch your fixes after checking ERA..  When you do an update, all current ERA reports are gone.

    Let's say you had a bug in version 1 of an app, you fixed it and uploaded version 2.  Those ERA reports from Version 1 are now meaningless.

    But let's say there was a bug in version 1 that you didn't fix in version 2 -  You'll see those ERAs for version 2, and the ERA reports from version 1 are again meaningless, as it's for an older version of the code.  You'd use the ERA  reports for version 2.

    Another thing to note, is you may not hear from many users that have a crash,  They'll just move on to another app.

    Also, in ERA, you may see a number of reports for the same crash, where things like the device and language are the same,  That could be the same user that keeps trying to get the app to work,  Different devices or languages are a way that you can see it's actually multiple users

  • Yes, that issue seems like its related to what my user is experiencing. Will follow that thread.

  • Hm. I added my developer in ERA, and I can see that it fetches my app because in Settings -> Manage apps, it finds my application. But I don't see any reports at all. I would have expected there to be some reports. I haven't updated my app since 13th of September so that shouldn't be an issue.

    I have tried starting ERA both from Visual Studio Code and the .jar file in the sdk folder, but I can't see any reports. Strange.

  • Nevermind, a classic case of PEBKAC (Problem Exist Between Keyboard And Chair). Now I see the reports in ERA, and I can see in total 28 crashes. All related to Storage.setValue()...