# Returning 1 in Download\_Enter not mark the update as failed

**URL:** <https://hub.mender.io/t/returning-1-in-download-enter-not-mark-the-update-as-failed/2166>\
**Category:** General Discussions\
**Created:** [July 8, 2020, 3:32pm UTC](https://hub.mender.io/t/returning-1-in-download-enter-not-mark-the-update-as-failed/2166 "2020-07-08T15:32:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimant](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@dimant](https://hub.mender.io/u/dimant)\
**Post date:** [July 8, 2020, 3:32pm UTC](https://hub.mender.io/t/returning-1-in-download-enter-not-mark-the-update-as-failed/2166/1 "2020-07-08T15:32:29Z")

</div>

Hi all,  
I’m facing an issue: In the Download\_Enter state, i’m trying to check the version of the update before to proceed to the download.

This is a little sketch of the code in the Download\_Enter  
if ! is\_installable “$AUTOMA\_STATE”   
“$ACTUAL\_VERSION” “$ACTUAL\_OS\_VERSION”   
“$NEW\_VERSION” “$NEW\_OS\_VERSION”;  
then  
loginfo “[$AUTOMA\_STATE][UPDATE INCOMPATIBLE][FAIL]”  
exit 1  
fi

If i return 1 (exit 1) in this state (Download\_Enter), the update is not marked as failed on the server, the client continue to try to download the same artifact, and on the server i can see the progress bar of the Download\_Enter state.  
Is this my fail? It’s not possible to fail in this state?

Thanks for the help

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [July 9, 2020, 6:41am UTC](https://hub.mender.io/t/returning-1-in-download-enter-not-mark-the-update-as-failed/2166/2 "2020-07-09T06:41:08Z")

</div>

Technically the update starts when the Download state is entered. Since `Download_Enter` is before the Download state, the update has not actually started at this point. So although it may not be completely obvious, this is the expected behavior.

I believe it is not possible to fail before the Download state with a state script, but you can fail inside the Download state with an Update Module.
