Mender statescript version file

Hi,

I’m trying to use a Download_Leave_x state script to copy network configuration into the new rootfs.
But when uploading a new image (via standalone mode), I get the following error:

time="2020-03-20T15:46:27Z" level=error msg="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=main

The need for this version file is not documented in https://docs.mender.io/2.3/artifacts/state-scripts
How does this file need to look like? Is there anything else that is not documented?

P.S. I’m not using Yocto, we have our own Debian based tooling…

Thanks!

I think this means that the file “/etc/mender/scripts/version” file does not exist. It should have a single character with the current version (2) in it. I know it used to not work if there were any newlines so if you create it without that it would be best.

Yeah, I now found that digging through the code.
But it seems that version 3 is the current version… although I could not find what the differences are.
Also newlines seem to be accepted/supported now…

There are no differences. The version was bumped because it follows the Artifact format version of the .mender files. However, for state scripts, nothing changed in the new revision.