Is there a way to solve "failed to download asset with key" errors with expo update?

I had problems getting eas update to work when I set a custom runtime version (i.e. as "1"). But they do work when I set to {policy: "nativeVersion"}. Is there a way for end-users like me to debug why eas update is failing to download an asset? Is it possible that this depends on whether the device is connected with WIFI vs cell data maybe?

03-03 16:43:02.580 32217 12747 D SoLoader: libimagepipeline.so not found on /data/data/com.tuev.verifae/lib-main
03-03 16:43:02.580   454   454 D LightBarController:  updateStatus numStacks=1
03-03 16:43:02.581 32217 12747 D SoLoader: libimagepipeline.so found on /data/app/~~MYIkC-BIgODWT6KMedbSAg==/com.tuev.verifae-SAm2LCHfn6TQh8H903_rNA==/lib/arm64
03-03 16:43:02.581 32217 12747 D SoLoader: Not resolving dependencies for libimagepipeline.so
03-03 16:43:02.582 32217 12747 D SoLoader: Loaded: libimagepipeline.so
03-03 16:43:02.638 32217 12717 E om.tuev.verifa: Invalid ID 0x00000000.
03-03 16:43:02.640 32217 12717 E om.tuev.verifa: Invalid ID 0x00000000.
03-03 16:43:02.656 32217 12717 W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.swmansion.rnscreens.ScreensShadowNode
03-03 16:43:02.665 32217 32217 E unknown:FabricViewStateManager: setState called without a StateWrapper
03-03 16:43:03.045   973 20013 I vendor.qti.bluetooth@1.0-ibs_handler: DeviceSleep: TX Awake, Sending SLEEP_IND
03-03 16:43:03.045   973 20013 D vendor.qti.bluetooth@1.0-ibs_handler: SerialClockVote: vote for UART CLK OFF
03-03 16:43:03.180 32217 12752 E Loader  : Failed to download asset with key 8241aaf8af51e5b35508b92871819698
03-03 16:43:03.180 32217 12752 E Loader  : java.lang.Exception: Network request failed: error code: 1020
03-03 16:43:03.180 32217 12752 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadFileToPath$1.onResponse(FileDownloader.kt:67)
03-03 16:43:03.180 32217 12752 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadData$1.onResponse(FileDownloader.kt:351)
03-03 16:43:03.180 32217 12752 E Loader  : 	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
03-03 16:43:03.180 32217 12752 E Loader  : 	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
03-03 16:43:03.180 32217 12752 E Loader  : 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
03-03 16:43:03.180 32217 12752 E Loader  : 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
03-03 16:43:03.180 32217 12752 E Loader  : 	at java.lang.Thread.run(Thread.java:923)
03-03 16:43:03.183 32217 12760 E Loader  : Failed to download asset with key c79c3606a1cf168006ad3979763c7e0c
03-03 16:43:03.183 32217 12760 E Loader  : java.lang.Exception: Network request failed: error code: 1020
03-03 16:43:03.183 32217 12760 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadFileToPath$1.onResponse(FileDownloader.kt:67)
03-03 16:43:03.183 32217 12760 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadData$1.onResponse(FileDownloader.kt:351)
03-03 16:43:03.183 32217 12760 E Loader  : 	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
03-03 16:43:03.183 32217 12760 E Loader  : 	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
03-03 16:43:03.183 32217 12760 E Loader  : 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
03-03 16:43:03.183 32217 12760 E Loader  : 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
03-03 16:43:03.183 32217 12760 E Loader  : 	at java.lang.Thread.run(Thread.java:923)
03-03 16:43:03.183 32217 12761 E Loader  : Failed to download asset with key 35ba0eaec5a4f5ed12ca16fabeae451d
03-03 16:43:03.183 32217 12761 E Loader  : java.lang.Exception: Network request failed: error code: 1020
03-03 16:43:03.183 32217 12761 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadFileToPath$1.onResponse(FileDownloader.kt:67)
03-03 16:43:03.183 32217 12761 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadData$1.onResponse(FileDownloader.kt:351)
03-03 16:43:03.183 32217 12761 E Loader  : 	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
03-03 16:43:03.183 32217 12761 E Loader  : 	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
03-03 16:43:03.183 32217 12761 E Loader  : 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
03-03 16:43:03.183 32217 12761 E Loader  : 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
03-03 16:43:03.183 32217 12761 E Loader  : 	at java.lang.Thread.run(Thread.java:923)
03-03 16:43:03.183 32217 12759 E Loader  : Failed to download asset with key 376d6a4c7f622917c39feb23671ef71d
03-03 16:43:03.183 32217 12759 E Loader  : java.lang.Exception: Network request failed: error code: 1020
03-03 16:43:03.183 32217 12759 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadFileToPath$1.onResponse(FileDownloader.kt:67)
03-03 16:43:03.183 32217 12759 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadData$1.onResponse(FileDownloader.kt:351)
03-03 16:43:03.183 32217 12759 E Loader  : 	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
03-03 16:43:03.183 32217 12759 E Loader  : 	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
03-03 16:43:03.183 32217 12759 E Loader  : 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
03-03 16:43:03.183 32217 12759 E Loader  : 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
03-03 16:43:03.183 32217 12759 E Loader  : 	at java.lang.Thread.run(Thread.java:923)
03-03 16:43:03.185 32217 12758 E Loader  : Failed to download asset with key 778ffc9fe8773a878e9c30a6304784de
03-03 16:43:03.185 32217 12758 E Loader  : java.lang.Exception: Network request failed: error code: 1020
03-03 16:43:03.185 32217 12758 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadFileToPath$1.onResponse(FileDownloader.kt:67)
03-03 16:43:03.185 32217 12758 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadData$1.onResponse(FileDownloader.kt:351)
03-03 16:43:03.185 32217 12758 E Loader  : 	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
03-03 16:43:03.185 32217 12758 E Loader  : 	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
03-03 16:43:03.185 32217 12758 E Loader  : 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
03-03 16:43:03.185 32217 12758 E Loader  : 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
03-03 16:43:03.185 32217 12758 E Loader  : 	at java.lang.Thread.run(Thread.java:923)
03-03 16:43:03.205 32217 12758 E Loader  : Failed to load all assets
03-03 16:43:03.205 32217 12758 E Loader  : java.lang.Exception: Failed to load all assets
03-03 16:43:03.205 32217 12758 E Loader  : 	at expo.modules.updates.loader.Loader.handleAssetDownloadCompleted(Loader.kt:295)
03-03 16:43:03.205 32217 12758 E Loader  : 	at expo.modules.updates.loader.Loader.access$handleAssetDownloadCompleted(Loader.kt:18)
03-03 16:43:03.205 32217 12758 E Loader  : 	at expo.modules.updates.loader.Loader$downloadAllAssets$1.onFailure(Loader.kt:233)
03-03 16:43:03.205 32217 12758 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadAsset$1.onFailure(FileDownloader.kt:318)
03-03 16:43:03.205 32217 12758 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadFileToPath$1.onResponse(FileDownloader.kt:66)
03-03 16:43:03.205 32217 12758 E Loader  : 	at expo.modules.updates.loader.FileDownloader$downloadData$1.onResponse(FileDownloader.kt:351)
03-03 16:43:03.205 32217 12758 E Loader  : 	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
03-03 16:43:03.205 32217 12758 E Loader  : 	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
03-03 16:43:03.205 32217 12758 E Loader  : 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
03-03 16:43:03.205 32217 12758 E Loader  : 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
03-03 16:43:03.205 32217 12758 E Loader  : 	at java.lang.Thread.run(Thread.java:923)

I looked into the error code provided (1020) and the top Google results suggest this indicates a firewall issue? Does Expo use Cloudflare in its stack somewhere?

I am running into the same issue and filed a bug report on it in the EAS repo. I am running a bare app, so all of the runtime versions for my app must be custom. This was working up until yesterday. Hopefully this issue gets resolved soon, because it definitely should not be happening.

Hi, we’re looking into this right now. This is indeed Cloudflare’s firewall. Valid expo-updates usage shouldn’t encounter this. Thank you for your patience during the EAS Update preview.

This issue has been resolved as of 10 minutes or so ago. The root cause was that a credential shared between the EAS Update server and the CDN were encoded differently. This caused apps not to get valid asset download URLs.

The impact on production apps is that they wouldn’t have been able to get new updates and would have loaded their last successfully downloaded update. We designed the expo-updates library this way since connections can fail for all sorts of reasons like unreliable internet in a subway tunnel or whenever a device has 0-1 bars of signal in general, or in this case when the global CDN doesn’t serve an asset. Obviously high availability is better and enterprise SLAs for EAS Update will be a feature when the service comes out of preview so that the main source of network failures will be mobile internet connections and not EAS.

Thanks for a snappy and professional response and for the root cause explanation @ide. I can confirm the updates are working nicely now.

We were actually discussing our company’s internal policy for preferred encoding last week. What did your team settle on? We’re probably gonna go with URL-safe base64.

What are you looking to encode? base64url is useful for encoding short byte strings that might be sent in URLs. Modern versions of Node also have built-in support for base64url, which is nice. Plain Base64 is very popular and widely compatible. Ascii85 is denser.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.