Delta apply fail with "xdelta3: target window checksum mismatch: XD3_INVALID_INPUT"

Does the checksum from $MENDER_ARTIFACT_FROM match what is on you device? Because the delta is applied using the rootfs partition on you device, while the Mender Artifact is used to generate the patch.

E.g run the following if the currently active part is /dev/sda2:

sha256 /dev/sda2

Compare above to the content of $MENDER_ARTIFACT_FROM