0

knife solo prepare failed. It seems that there is no permission to create install.sh.

Warning: Failed to create the file install.sh: Permission denied
bash: install.sh: No such file or directory

How do you solve it?

$ knife solo prepare -VV <nodename>

DEBUG:           /bin/sh -c "             if command -v curl >/dev/null 2>&1; then               curl -L -o 'install.sh' 'https://www.opscode.com/chef/install.sh';             else               wget -O 'install.sh' 'https://www.opscode.com/chef/install.sh';             fi;           "
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0DEBUG:           /bin/sh -c "             if command -v curl >/dev/null 2>&1; then               curl -L -o 'install.sh' 'https://www.opscode.com/chef/install.sh';             else               wget -O 'install.sh' 'https://www.opscode.com/chef/install.sh';             fi;           "
 stdout: Warning: Failed to create the file install.sh: Permission denied

Warning: Failed to create the file install.sh: Permission denied
DEBUG:           /bin/sh -c "             if command -v curl >/dev/null 2>&1; then               curl -L -o 'install.sh' 'https://www.opscode.com/chef/install.sh';             else               wget -O 'install.sh' 'https://www.opscode.com/chef/install.sh';             fi;           "
 51 23110   51 11925    0     0  18535      0  0:00:01 --:--:--  0:00:01 18517

 51 23110   51 11925    0     0  18535      0  0:00:01 --:--:--  0:00:01 18517
DEBUG:           /bin/sh -c "             if command -v curl >/dev/null 2>&1; then               curl -L -o 'install.sh' 'https://www.opscode.com/chef/install.sh';             else               wget -O 'install.sh' 'https://www.opscode.com/chef/install.sh';             fi;           "
 stdout: curl: (23) Failed writing body (0 != 11925)

curl: (23) Failed writing body (0 != 11925)
DEBUG: Initial command sudo bash install.sh  -v 13.12.14
DEBUG: Running processed command sudo -p 'knife sudo password: ' bash install.sh  -v 13.12.14
DEBUG: sudo -p 'knife sudo password: ' bash install.sh  -v 13.12.14 stdout: bash: install.sh: No such file or directory

bash: install.sh: No such file or directory

Chef version is 13.12.14.

堀越貴斗
  • 1
  • 1
  • 3
  • The user you're under on this node has no rights to write in the current directory, as the message said: "Permission denied"... – Tensibai Jul 15 '19 at 13:51

1 Answers1

0

The owner of the chef executor's HOME directory on the remote host was incorrect.

It solved by executing the following command.

$ ssh <nodename> sudo chown <user> /home/<user>

堀越貴斗
  • 1
  • 1
  • 3