Hi,
I’m trying to use mender-artifact cp and cat commands using jenkins. The cat commands work fine but the cp command fails to execute. Here is output from the jenkins machine.
//mender-convert
ls
bbb-convert-stage-2.sh
convert-stage-3.sh
convert-stage-4.sh
convert-stage-5.sh
device-image-shell
docker-build
docker-entrypoint.sh
Dockerfile
docker-mender-convert
files
input
LICENSE
LIC_FILES_CHKSUM.sha256
mender-artifact
mender-convert
mender-convert-functions.sh
output
qemux86_64-convert-stage-2.sh
README.md
rpi-convert-stage-2.sh
rpi-convert-stage-5.sh
ukey-update-artifact.sh
00:00:00.012 + sudo ./ukey-update-artifact.sh
no artifact or sdimage provided
Contents of ukey-update-artifact.sh
./mender-artifact cat output/.mender:/etc/fstab –> This works ./mender-artifact cp input/mender.conf output/.mender:/etc/fstab –> This fails -ERROR -(no artifact or sdimage provided) ./mender-artifact rm output/:/etc/fstab --> This works
NOTE: When i manually run this script it works perfectly but it fails on jenkins
Hi, we stumbled across this issue ourselves just last week actually. The problem is that the scripts are fed through stdin on the machine, and mender-artifact (faulty), decides to read from stdin, instead of the two files which are listed on the command line.
The PR with the fix can be found here: https://github.com/mendersoftware/mender-artifact/pull/215. Please note that the implementation now (with this PR), requires the use of ‘-’ explicitly, in order to read from stdin.
But please note that this workaround won’t work after this is fixed. Normally we don’t change behavior in minor releases, but I think we will make an exception here, due to the very confusing nature of this.
Can you please tell which file should i use with cat. For example I need to copy a file fstab with address input/fstab to the mender artifact in location etc/fstab.
Hii everyone I am facing another issue. While I copy the files with the above-mentioned solution; I am getting permission issue with my files. I m modifying the mender-device-identity file with Jenkins and copying it inside the .mender file.
Original mender-device-identity permissions : -rwxr-xr-x
After deploying mender update to a Raspberry Pi3: -rw-----
I tried changing the permission using the commamd: ./mender-artifact install -m 777 input/mender-device-identity $file.mender:/usr/share/mender/identity/mender-device-identity
But it came up with the same error as it was throwing in cp command
Hi @Shrulabh, I don’t see anything wrong with your command at first sight.
Have you tried this command locally?
And are you sure that $file resolves to a filename, without the .mender extension?
Hii @oleorhagen yes the $file resolves a filename and the command works locally. But the issue is that it fails in Jenkins build; with the error No artifact or sdimg provided