1
votes

Edit: It works on iOS, the problem is therefore limited to Android.

I just found out, that in my Meteor production app, Hot Code Push is broken. I don't know when it started to occur, but here are the facts (in no particular order):

  • When I upload new binaries to Google Play/iOS App Store a new version is downloaded by all devices
  • When I update the server only, the Android App does not update, even when manually forcing a window.location.reload() in the app.
  • After the server update, in the browser the app reloads as it should be (to the new version)
  • https://myapp.com/__cordova/manifest.json is served as it should be
  • I am using mup 1.3.5 on the server
  • In development mode (on localhost) Hot Code Push works perfectly
  • When using git checkout on an older commit and building the app locally via meteor run android-device --mobile-server https://myapp.com I can see the following console output:

                Download failure
     com.meteor.webapp.WebAppException: Error downloading asset manifest
        at com.meteor.webapp.AssetBundleManager$1.onFailure(AssetBundleManager.java:97)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:140)
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
     Caused by: java.net.ProtocolException: Expected ':status' header not present
        at okhttp3.internal.http.Http2xStream.readHttp2HeadersList(Http2xStream.java:266)
        at okhttp3.internal.http.Http2xStream.readResponseHeaders(Http2xStream.java:149)
        at okhttp3.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:723)
        at okhttp3.internal.http.HttpEngine.access$200(HttpEngine.java:81)
        at okhttp3.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:708)
        at okhttp3.internal.http.HttpEngine.readResponse(HttpEngine.java:563)
        at okhttp3.RealCall.getResponse(RealCall.java:241)
        at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:198)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:160)
        at okhttp3.RealCall.access$100(RealCall.java:30)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:127)
        ... 4 more
     Download failure
     com.meteor.webapp.WebAppException: Error downloading asset manifest
        at com.meteor.webapp.AssetBundleManager$1.onFailure(AssetBundleManager.java:97)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:140)
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
     Caused by: java.net.ProtocolException: Expected ':status' header not present
        at okhttp3.internal.http.Http2xStream.readHttp2HeadersList(Http2xStream.java:266)
        at okhttp3.internal.http.Http2xStream.readResponseHeaders(Http2xStream.java:149)
        at okhttp3.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:723)
        at okhttp3.internal.http.HttpEngine.access$200(HttpEngine.java:81)
        at okhttp3.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:708)
        at okhttp3.internal.http.HttpEngine.readResponse(HttpEngine.java:563)
        at okhttp3.RealCall.getResponse(RealCall.java:241)
        at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:198)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:160)
        at okhttp3.RealCall.access$100(RealCall.java:30)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:127)
        ... 4 more
      "Error: Error downloading asset manifest", source: http://localhost:12128/packages/webapp.js?hash=e448c6ebb2384292f7c97e676471a51951a04169 (71)
    

This suggests that some kind of :status header is missing for the asset manifest. How can I fix this?

1
have you tried updating Retrofit and Okhttp3user6113352
Have you checked Cordova plugins versions between your current mobile app and the new version you are trying to serve through Hot Code Push? Meteor purposely blocks it if versions mismatch.ghybs
There have been no package or Cordova plugin changes since the last App Store updateTaxel
@Taxel, I am having the exact same issue. Just today I traced back the problem from changes I made to our kubernetes nginx-controller version. In version 0.8.3 Android has no issues in fetching the manifest. In versions 0.9 > 0.10.2, I get com.meteor.webapp.WebAppException: Error downloading asset manifest caused by java.net.ProtocolException: Expected ':status' header not present. I am now testing new versions of the controller and figuring out the difference in 0.8.3 and 0.9.x to understand why this is happening. In case I find a resolution I will post it online.Kwuite

1 Answers

0
votes

I had this exact same problem with the same console error logs. Using Meteor 1.6.1 and mup 1.4.3. In the end I fixed it by upgrading the cordova-plugin-meteor-webapp with:

meteor add cordova:[email protected]

and then redeploying. Then hot code push worked on Android!

Edit: To give more background - I think the problem is caused by a problem with okhttp and HTTP/2 on certain version of nginx. See this question. The updated cordova-plugin-meteor-webapp plugin uses a newer version of okhttp.