Need help troubleshooting communications error messages

I am using Communications.makeImageRequest in my WUradar widget. I am getting reports from users where the app fails to download the image. With limited exception, I can not reproduce the errors on my side. The errors are all part of the Communications module since that is the only place I capture the response code and if not 200 or 404, show the error code on the screen. The two users I have had reports from are getting different messages, but apparently every time they run the app. I suspect that there is something going on with their link between GCM to the watch, but I don't know the best way to troubleshoot that. Here are the two scenarios and I am currently trying to troubleshoot. I don't think it is my app because I know of cases for the app running fine on other devices of the same type.

Case 1
Device: Fenix 5
Device FW: 6.00
Phone: iPhone 6s
GCM version: GCM-IOS version not provided.

User reports getting comm error 0, UNKNOWN_ERROR. The user claims the watch is syncing with GCM and see the steps update etc. The watch has been restarted, but still gets error code 0 when trying to run the widget. I have been able to reproduce this on my watch if I turn off mobile data and try to start the widget. My differnce is I am running GCM on android and it is only happening under a very specific scenario and not every time the widget is started.

Case 2
Device: Vivoactive
Device FW: 4.40
Phone: Samsung Galaxy S5 Neo
GCM version: GCM-Android 3.22.1.2

This users is reporting error code -300, NETWORK_REQUEST_TIMED_OUT. I have been unable to reproduce this error and I don't know what to suggest to the user to try to fix the issue. I know the URL with Weather Underground can respond for this area.

Any suggestions for either problem would be appreciated.
  • It just so happens that maybe 30 minutes back I got a contact developer for my WU Weather Widget asking about the -300 error they were getting. It works fine for me.

    The text you mentioned is really what you're seeing. The request timed out. This can happen with any app that does Comm requests. You'll also see -2 if BT drops between the CIQ device and the phone, as well as others.

    The WU website is quite stable, but at times, there can be something flaky going on, either with the internet to their site, or their servers. With my widget, it's been around for a couple years, and you'll see an error like this on occasion. The "0" may be related, but in my case I only get JSON data, so have never had that reported

    Basically, things can go wrong between the device and the phone, and the phone and the server, and you may just need to suggest they try again in 15-30 minutes. It's likely not a bug in your code or CIQ.

    It's just life on the internet. That's why error checking and letting the user know the error is important.
  • Jim,

    Thanks for confirming what I suspected about the network timeout. With a data communications background I know there are a lot of interdependent parts to making sure things work just right.

    Still I wish I had an answer that would get things working for them.

  • I have received another report of someone having and issue similar to case 1 in that they are getting error code 0.

    Device: oregon 750
    Device FW: 3.30
    Phone: iPhone 7 (IOS11)
    GCM version: GCM-IOS waiting to get version.

    I am starting to think that maybe the error code 0 issues might have something to do with IOS 11. Looking at the GCM-IOS forum would imply there are known problems with maintaining connection with devices after upgrading to IOS11.
  • Former Member
    Former Member
    I was able to talk to my Connect Mobile team and they confirmed that there have been some widespread Bluetooth issues with iOS 11 devices. It looks like Garmin is not the only one fighting some of these issues and Apple has some work being done in the iOS11 betas: https://forums.developer.apple.com/message/250262#250262 & https://support.apple.com/en-us/HT208086

    I'll let you know when the mobile team gives me some more info.

    Thanks,
    -Coleman
  • Coleman, thanks for the confirmation of a pattern I was starting to see. I got another error code 0 feedback this morning and have asked for the type of phone. My suspect is they have an iPhone also.
  • Coleman, do you have any ideas on the network time out issue? In doing some further troubleshooting, I have been able to determine with the user that a the phone is able to retrieve the image URL in a web browser, but then the watch going through GCM-android make the request to the same server and URL, it times out.
  • It appears that IOS11 is going to be the bane of my app development. So far 6 of my 7 reported app not working requests have all been on IOS11 devices. They manifest as either a CIQ crash which leave a system error with DETAILS: failed inside handle_image_callback in the CIQ_LOG or they fail with error code 0. My seventh failed install is the network time out issue listed above.

    So far I have had reported 2 app crashes and 4 reported receiving error code 0. All running either IOS11 one either an iPhone 6s or 7. I hope the Connect Mobile team can find a fix.
  • I have been working with a couple of my users who have reported problems. I duplicated my project and created a test build which does not rely on any setting. The only changes to the code I made in the test build was to change the app name reference and the 3 variable which pull from the setting got fixed values. I did a build for the specific devices the users have and sent it to them to side load. In both cases the test app worked flawlessly while the version from the app store would continue to fail with the same message the user initially reported. One of the cases was the user above who was reporting the network timeouts (-300). The other user was experiencing error code 0, -2, -101, and occasional app crashes. I have already compiled all of this into a email and sent it off to Garmin.

    My question for the forum, Could corrupt settings from perhaps a previous version cause the problems I am seeing? I find it kind of unlikely because one of the users reported uninstalling the app and reinstalling it, and it still failed. For those who use the settings feature, has anyone else seen strange behavior between versions?
  • I see "-2" errors at times, and they are kind of a "loss of signal" error. By this I mean, let's say and app is making a comm request, but before the data is returned, the BT connection to the phone is lost. I'll see that if I walk out of BT range from my phone when doing comm.

    -101 indicated that too many requests are queued. If you do multiple requests, do you wait for a response to the first before sending the second, and so on? I think there's a limit of 3 outstanding requests, if I recall.

    I know when I've got an app that does comm, I always check phoneConnected before making the request, and don't rely on just the -104 error. You may want to try that if you're not.
  • Jim,

    Thanks for the thoughts. I believe that I should already have most of those covered, which is why I am confused as to what is going on. I do have the very first check in the app confirm the phone is connected, if not display error. Next I check for position and wait if i don't have one, the last check is to retrieve the image and display it. Since each of those checks are in nested if statements, the app can only make a single image retrieval request once it confirms the phone is connected and a position has been obtained. After a successful retrieval it displays the image. For watch devices, it stops there and waits for timeout or the user to switch the widget. For non watch devices, the timer runs in the background. Once the timer reaches 0, I clear the previous image, request a new one time position and refresh the UI which start the checks and image retrieval all over again.

    Do you think it worth while to put in a cancel all requests before I call the makeImageRequest? If I do and I still get -101, what does that mean?

    I do appreciate all the help you have provided.