Code 0 error when uploading AppStudio apps

372
6
04-18-2018 06:51 PM
PaulHaakma
Regular Contributor

The internet at my house is not great, and I don't think the wifi on my laptop is great either.

Anyway, when at work and hard-wired into the internet via cable, I don't tend to have any issues.

But whenever I try to upload/update an app using AppStudio into ArcGIS Online when at home, I always get several 'Code 0' errors. It happens multiple times. Eventually I get lucky and it succeeds. Usually a bit better if I also plug in via cable to my router, but still dodgy.

So it's obviously a network thing and not an AppStudio bug. But can anyone shed any light on what 'Code 0' means?

I've attached a screenshot of the error message.

(Meanwhile I'm trying to figure out why my internet connection is so crap...)

0 Kudos
6 Replies
MervynLotter
Regular Contributor

I am having the same issue, unfortunately for me I have a bad internet connection both at work and home. I thought there was perhaps a size limit, hence the error, and was going to post a size question to this forum, but seems it may be timeout limitation. 

0 Kudos
SiddeshPillai1
Esri Contributor

Hi Paul,

Code 0 means,

The network is not currently accessible, either because there is currently no network coverage or network access has been explicitly disabled

Best,

Siddesh

0 Kudos
PaulHaakma
Regular Contributor

Cheers Siddesh.

That kind of makes sense, although it seems to be extra sensitive. Not sure what the underlying tech is for ArcGIS Online (or is it a Qt thing), but uploading large items to dropbox, AWS S3, google drive etc all seem to work (might be slow, but they eventually get there), whereas uploading apps via AppStudio often fails.

Also, that error code popped up yesterday when I was at home trying to upload a new app - was weird because it successfully created the app item in AGOL but refused to upload. I thought it was network, but then tried it this morning at work plugged in and still no go. Eventually I created a brand new app and copied my files across and it worked fine. Point being that the issue wasn't the network (I suspect something to do with app info files etc) but I still got a generic Code 0 error.

Anyway, I guess no need for further action, but thought I'd post that in case anyone else interested.

cheers,

-Paul

0 Kudos
MervynLotter
Regular Contributor

I also get the Invalid Taken. Code 498  error message if not the above error. This app is then usually uploaded to my account but it is faulty and does not display in the AppStudio Player. It shows under AppStudio for ArcGIS , but if I try and edit the app from here, it gives me the following warning "Oops! We cannot edit this app due to some errors occurred in the downloading process." I then manually have to delete it and try again. Yet to succeed. 

I am using AppStudio 3.0.9. My app is small but includes a 150mb MMPK. 

0 Kudos
StephenQuan1
Esri Contributor

Hi Paul,

AppStudio attempts to do your entire file upload in a single REST API call.

However, due to the speed of your internet connection, combined with the size of the file, that request will take a significant measurable time. For instance, let's assume you're on a 200kbps connection. The upload would take more than an hour. The ArcGIS Online REST API could terminate the request due to a number of reasons: it didn't receive your file attachment in the time allotted, or it did receive the file, but, it didn't have sufficient time to give you a response.

I would guess that you're triggering the former.

AppStudio has no choice but reflect on the error response we got from ArcGIS Online. If ArcGIS Online believes that it didn't receive your file, then, AppStudio has no choice to echo that fact.

There are a number of solutions to this problem:

 1. if you cannot repair your internet speed (i.e. your app must function in an environment that has poor internet connectivity), then, you can consider using a middleman proxy server that could cache your request. As far as ArcGIS Online is concerned, it will see the request originating from the proxy server, and, we would hope that proxy server is hosted on a fast internet.

 2. we can consider redesign the upload to occur in a multipart upload request, however, each part would be subject to the same REST API thresholds, i.e. they could terminate if any part could not be delivered in a timely manner - some real world scenarios would really help us understand how to tune AppStudio for such scenarios.

You just have to ensure that your proxy server has sufficiently large timeouts to receive your file so that it can relay it.

Hope this makes sense.

Stephen

0 Kudos
PaulHaakma
Regular Contributor

Hi Stephen, thanks for the reply.

Probably the only other comment I'd make is that I have tested an upload/update of the exact same app using a basic web app that does an update item call using the esri javascript api, and it uploaded fine with no timeouts. In other words, the exact same REST API operation was performed, using the same network, and the exact same file, and it worked fine via the browser but consistently fails when using AppStudio itself.

So I can't help but suspect that there is something, probably to do with the Qt networking module, that is less tolerant in the AppStudio application than the browser. (fyi, I tested using AppStudio v3 as well, just in case, and no change with regards to this.)

What would be great is if it were possible to upload/update an AppStudio app using the UI directly in ArcGIS Online itself. Currently I don't think that's possible as it doesn't set all the appropriate keywords, types etc.

cheers,

-Paul

0 Kudos