Mender-Artifact cp commands fail on jenkins

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.


  • ls
  • device-image-shell
  • docker-build
  • Dockerfile
  • docker-mender-convert
  • files
  • input
  • mender-artifact
  • mender-convert
  • output

00:00:00.012 + sudo ./

no artifact or sdimage provided

Contents of

./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: Please note that the implementation now (with this PR), requires the use of ‘-’ explicitly, in order to read from stdin.

As a temporary workaround, you can reshape your command to:

./mender-artifact cp output/.mender:/etc/fstab < input/mender.conf

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.

The following error comes after making the changes.
got 1 arguments, wants two

I guess cp command is taking the whole command as one argument.

My command: ./mender-artifact cp ‘output/xyz.mender:/etc/fstab’ < 'input/fstab’

try cat file | mender-artifact cp artifact.mender:/path/in/update

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.

cat input/fstab | mender-artifact cp artifact.mender:/etc/fstab

Thank you soo much the command now works as expected…!!!
The cp command now works and changes the .mender file