# Downloading fail loop

**URL:** <https://forums.balena.io/t/downloading-fail-loop/522>\
**Category:** Product support\
**Created:** [January 20, 2017, 10:18am UTC](https://forums.balena.io/t/downloading-fail-loop/522 "2017-01-20T10:18:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![keithejc](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/keithejc/32/141_2.png) [@keithejc](https://forums.balena.io/u/keithejc)\
**Post date:** [January 20, 2017, 10:18am UTC](https://forums.balena.io/t/downloading-fail-loop/522/1 "2017-01-20T10:18:18Z")

</div>

I have a problem downloading an image.

Running on a Beaglebone Black Resin OS 1.24.0

This is what happened when i started:

`19.01.17 16:58:53 [+0000] Starting application 'registry.resin.io/loggerbox/998985246fc4d39114484efe4115afafa0dfaa8c' 19.01.17 16:58:54 [+0000] Application is already running 'registry.resin.io/loggerbox/998985246fc4d39114484efe4115afafa0dfaa8c' 19.01.17 16:58:57 [+0000] Downloading application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' 19.01.17 17:09:36 [+0000] Failed to download application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' due to 'Error pulling image (latest) from registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc, failed to register layer: ApplyLayer flate: corrupt input before offset 56661767 stdout: {"layerSize":147275709} stderr: ' 19.01.17 17:09:41 [+0000] Downloading application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' 19.01.17 17:16:53 [+0000] Failed to download application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' due to 'Error pulling image (latest) from registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc, failed to register layer: ApplyLayer exit status 1 stdout: stderr: unexpected EOF' 19.01.17 17:16:54 [+0000] Downloading application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' 19.01.17 17:09:36 [+0000] Failed to download application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' due to 'Error pulling image (latest) from registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc, failed to register layer: ApplyLayer flate: corrupt input before offset 56661767 stdout: {"layerSize":147275709} stderr: ' 19.01.17 17:09:41 [+0000] Downloading application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' 19.01.17 17:16:53 [+0000] Failed to download application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' due to 'Error pulling image (latest) from registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc, failed to register layer: ApplyLayer exit status 1 stdout: stderr: unexpected EOF' 19.01.17 17:16:54 [+0000] Downloading application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' 19.01.17 17:24:06 [+0000] Downloading application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc'`

then by this morning it’s doing this

`20.01.17 10:11:23 [+0000] Downloading application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' 20.01.17 10:12:49 [+0000] Failed to download application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' due to 'Error pulling image (latest) from registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc, open /var/lib/docker/tmp/GetImageBlob491910678: read-only file system' 20.01.17 10:12:51 [+0000] Error applying device configuration: Error: update "deviceConfig" set "targetValues" = '{}' - SQLITE_READONLY: attempt to write a readonly database 20.01.17 10:12:51 [+0000] Downloading application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' 20.01.17 10:14:18 [+0000] Failed to download application 'registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc' due to 'Error pulling image (latest) from registry.resin.io/loggerbox/1d13e377e983b158f3d5bc7dd391ab5b55c41adc, open /var/lib/docker/tmp/GetImageBlob474350563: read-only file system' 20.01.17 10:14:19 [+0000] Error applying device configuration: Error: update "deviceConfig" set "targetValues" = '{}' - SQLITE_READONLY: attempt to write a readonly database`

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [January 20, 2017, 12:39pm UTC](https://forums.balena.io/t/downloading-fail-loop/522/2 "2017-01-20T12:39:34Z")

</div>

That seems like a file system corruption, taking a look!

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [January 20, 2017, 1:36pm UTC](https://forums.balena.io/t/downloading-fail-loop/522/3 "2017-01-20T13:36:04Z")

</div>

@keithejc it wasn’t a corruption (just the symptoms are similar), rather that the file system seem to have run out of space. It seemed that it has updated fine in the end, though,

It’s a BTRFS issue as Docker + BTRFS uses quite a bit more space for metadata for all data too. Looks like the other devices in your application are also near similar state as this was, and might require some attention in the near future.

By the way, are Binary Delta Updates enabled on the device? That might help with the download and space issues (basically needs adding `RESIN_SUPERVISOR_DELTA` equal to `1` to the Fleet or Device configuration):

> **[Delta updates - Balena Documentation](https://www.balena.io/docs/learn/deploy/delta/)**
>
> How binary delta updates work on balena, and how to enable it for your applications

UPDATE: no, not quite fixed on the next update, checking it a bit.

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [January 20, 2017, 1:57pm UTC](https://forums.balena.io/t/downloading-fail-loop/522/4 "2017-01-20T13:57:00Z")

</div>

So, have run a fix routine on the device, and it seems to be working again, but it’s on the edge, just enough space to _maybe_ run the update correctly (but very little free space left). Could you let us know if deltas are enabled for this device or application?

---

<div class="post-metadata">

**Author:** ![keithejc](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/keithejc/32/141_2.png) [@keithejc](https://forums.balena.io/u/keithejc)\
**Post date:** [January 20, 2017, 4:40pm UTC](https://forums.balena.io/t/downloading-fail-loop/522/5 "2017-01-20T16:40:31Z")

</div>

Thanks. Deltas were not enabled. I have enabled it now.

Yeah, the internal mmc is not very large on the BBB. Would give us more leeway if we could boot from the external sdcard, but looks like we’re going now.

Thanks for your help
