Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safelyRenameFile [ERRO] when updating yaml using 4.9.8 yq docker image #890

Closed
vldpro opened this issue Jul 14, 2021 · 1 comment
Closed
Labels

Comments

@vldpro
Copy link

vldpro commented Jul 14, 2021

Describe the bug
Seems like the same as #884

Version of yq: 4.9.8
Operating system: linux
Installed via: docker

Input Yaml
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
data1.yml:

images:
  - name: img1
    newName: img1-1
    newTag: 2
  - name: img2
    newName: img2-1
    newTag: 2
  - name: img3
    newName: img3-1
    newTag: 2

Command
The command you ran:

docker run --rm -v "${PWD}":/workdir mikefarah/yq:4.9.8 e ".images.[].newTag = \"abc\"" -i data1.yml

Actual behavior

Bash error

14:59:32 safelyRenameFile [ERRO] Failed copying from /tmp/temp054283769 to data1.yml
14:59:32 safelyRenameFile [ERRO] open data1.yml: permission denied

Expected behavior

images:
  - name: img1
    newName: img1-1
    newTag: abc
  - name: img2
    newName: img2-1
    newTag: abc
  - name: img3
    newName: img3-1
    newTag: abc

Additional context

There is strange behavior. If I run it on localhost, there no error (tested with 4.9.6, 4.9.7, and 4.9.8) but if I run it on GitHub actions, the problem occurs with 4.9.7 and 4.9.8 docker images.

@mikefarah
Copy link
Owner

Ok I think I've solved this issue - the yq docker image no longer runs as root (#860) and from I can tell, GitHub actions run as user 1001. I've updated the yq's GitHub action to run as 1001 and that fixed them problem for me, let me know how you got with 4.10.0

sylvainbx added a commit to sleede/fab-manager that referenced this issue Nov 16, 2021
yq has updated its docker image to prevent running as root so we need to provide the current user id when running the image

More info: mikefarah/yq#890
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants