# Sync\_Error script not called for unauthorized device

**URL:** <https://hub.mender.io/t/sync-error-script-not-called-for-unauthorized-device/5722>\
**Category:** General Discussions\
**Tags:** state-scripts\
**Created:** [March 29, 2023, 1:45pm UTC](https://hub.mender.io/t/sync-error-script-not-called-for-unauthorized-device/5722 "2023-03-29T13:45:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rhen](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Rhen](https://hub.mender.io/u/Rhen)\
**Post date:** [March 29, 2023, 1:45pm UTC](https://hub.mender.io/t/sync-error-script-not-called-for-unauthorized-device/5722/1 "2023-03-29T13:45:57Z")

</div>

Hi there,  
in our project we would like to track the outcome of the sync state.  
We noticed, that for an unauthorized device, the Sync\_Error\_XX scripts are not called.  
Is this intended?  
The failed authorization attempt is logged as a error neverless we are unable to hook onto this event.

These are the relevant entries in the logs:  
time=“2023-03-20T19:37:30Z” level=info msg=“State transition: authorize-wait [Idle] → authorize [Sync]” …  
time=“2023-03-20T19:37:30Z” level=debug msg="Making an authorization request () to server …  
time=“2023-03-20T19:37:31Z” level=debug msg="Got response: &{401 Unauthorized 401 …  
time=“2023-03-20T19:37:31Z” level=error msg=“Authorize failed: transient error: authorization request failed: transient error: authorization request failed: (request\_id: ): authentication request rejected server error message: dev auth: unauthorized”  
time=“2023-03-20T19:37:31Z” level=info msg=“State transition: authorize [Sync] → authorize-wait [Idle]”

---

<div class="post-metadata">

**Author:** ![Rhen](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Rhen](https://hub.mender.io/u/Rhen)\
**Post date:** [May 16, 2023, 8:33am UTC](https://hub.mender.io/t/sync-error-script-not-called-for-unauthorized-device/5722/2 "2023-05-16T08:33:38Z")

</div>

Fyi, i tested with mender client:  
3.1.0 runtime: go1.17.6

I can try to update to a newer version, if it helps
