# \`version\` of state-scripts in /etc/mender

**URL:** https://hub.mender.io/t/version-of-state-scripts-in-etc-mender/894
**Category:** General Discussions
**Created:** [August 7, 2019, 11:05am UTC](https://hub.mender.io/t/version-of-state-scripts-in-etc-mender/894 "2019-08-07T11:05:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ster](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ster/32/282_2.png) [@ster](https://hub.mender.io/u/ster)
#### Post date: [August 7, 2019, 11:05am UTC](https://hub.mender.io/t/version-of-state-scripts-in-etc-mender/894/1 "2019-08-07T11:05:23Z")

</div>

Trying to use state-scripts for Sync state, I was catching this error:

`level=error msg="transient error: error calling enter script for (error) authorize state: error running enter state script(s) for Sync state: statescript: The version read from the version file in the statescript directory does not match the versions supported by the client, please make sure the file is present and formatted correctly (supported: [2 3]; actual: 0)." module=state`

Digging into the code of `mender/statescript/executor.go`, I found that it expects `version` file to be present in `/etc/mender/scripts` directory, however, no information about it is present in the [documentation](https://docs.mender.io/2.0/artifacts/state-scripts). I created `version` file manually in `3` inside and it worked.

I understand this file is probably getting greated while using yocto process when you provide state scripts, but I used `mender-convert` and it wasn’t there.

---

<div class="post-metadata">

### Author: ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)
#### Post date: [August 7, 2019, 12:51pm UTC](https://hub.mender.io/t/version-of-state-scripts-in-etc-mender/894/2 "2019-08-07T12:51:52Z")

</div>

> [@ster](#):
>
> Digging into the code of `mender/statescript/executor.go` , I found that it expects `version` file to be present in `/etc/mender/scripts` directory, however, no information about it is present in the [documentation](https://docs.mender.io/2.0/artifacts/state-scripts). I created `version` file manually in `3` inside and it worked.

Confirmed, I can not find any reference to this file in our docs. I will look in to adding something somewhere.

> I understand this file is probably getting greated while using yocto process when you provide state scripts, but I used `mender-convert` and it wasn’t there.

`mender-convert` should add this file,

> <https://github.com/mendersoftware/mender-convert/pull/107>
>
> This file needs to be present for state-scripts to work as the format
> version w…ill be validated using the information provided in this file
> and the version in the Mender Artifact.
> 
> "3" means that it will only accept state-scripts created using
> Mender Artifact version 3.
> 
> Changelog: Title
> 
> Signed-off-by: Mirza Krak \<mirza.krak@northern.tech\>
