Failed to download image due to 'connect ECONNREFUSED /var/run/balena-engine.sock'

I had tried with and without delta updates - same issue. It would abort the downloads with the ECONNREFUSED message after about 6 minutes. I just went and quickly picked up a UHS-I card, and the problem has been solved! Works like a charm.

Since I tried with two separate slower (class 4) cards previously, and received the same error message with each of them, I am assuming the card speed is the issue. And I know the slower cards worked fine (still do) with smaller images.

My guess: slower cards work with smaller images because there is sufficient memory to buffer the writes when the write speed is less than the download speed. But the combination of larger images and slower cards doesn’t work, because the buffer exhausts the device memory before the download is complete. This would also explain the mysterious 6 minute timing of the error; that would be how long it takes for the write buffer runs out.