Error when executing code of __staged_file type #173

Closed
opened 2021-11-20 15:20:44 +00:00 by ungleich-gitea · 1 comment

Created by: carlosotgz

Hello @asteven. I get this output when I execute the following command:

control% cdist config -v 136.243.197.186 INFO: cdist: version 3.1.13-69-g36d6ffb root@136.243.197.186's password: INFO: 136.243.197.186: Running global explorers INFO: 136.243.197.186: Running initial manifest /tmp/tmpacxtbhrf/conf/manifest/init INFO: 136.243.197.186: Running manifest and explorers for __consul/ INFO: 136.243.197.186: Running manifest and explorers for __staged_file/usr/local/bin/consul INFO: 136.243.197.186: Generating code for __staged_file/usr/local/bin/consul INFO: 136.243.197.186: Executing code for __staged_file/usr/local/bin/consul mkdir: cannot create directory ‘/var/tmp/cdist’: Permission denied ERROR: 136.243.197.186: Command failed: /bin/sh -e /tmp/tmpacxtbhrf/object/__staged_file/usr/local/bin/consul/.cdist-8tc9mqm6/code-loca l INFO: cdist: Total processing time for 1 host(s): 11.568004369735718 ERROR: cdist: Failed to configure the following hosts: 136.243.197.186

My init file contains only "__consul --version 0.6.0"

The problem is that it is trying to create an already existing directory which belongs to another user and it has not permissions at all for other users. When it manages to create this directory, it is chmoed to 0700, which will cause this problem to appear to any future user. This is the output for these directories:

root@control:~# ls -lh /var/tmp/
total 4.0K
drwx------ 3 ungleich ungleich 4.0K Feb 24 14:22 cdist
root@control:~# ls -lh /var/tmp/cdist/
total 4.0K
drwx------ 3 ungleich ungleich 4.0K Feb 24 14:22 __staged_file
root@control:~# ls -lhd /var/tmp
drwxrwxrwt 3 root root 4.0K Feb 24 14:22 /var/tmp

root@control:~# ls -lhR /var/tmp/cdist/__staged_file/
/var/tmp/cdist/__staged_file/:
total 4.0K
drwx------ 3 ungleich ungleich 4.0K Feb 24 14:22 usr
/var/tmp/cdist/__staged_file/usr:
total 4.0K
drwx------ 3 ungleich ungleich 4.0K Feb 24 14:22 local
/var/tmp/cdist/__staged_file/usr/local:
total 4.0K
drwx------ 2 ungleich ungleich 4.0K Feb 24 14:22 bin
/var/tmp/cdist/__staged_file/usr/local/bin:
total 0
-rw------- 1 ungleich ungleich 0 Feb 24 16:03 consul

I'm mentioning you on this issue @telmich just in case.

*Created by: carlosotgz* Hello @asteven. I get this output when I execute the following command: `control% cdist config -v 136.243.197.186 INFO: cdist: version 3.1.13-69-g36d6ffb root@136.243.197.186's password: INFO: 136.243.197.186: Running global explorers INFO: 136.243.197.186: Running initial manifest /tmp/tmpacxtbhrf/conf/manifest/init INFO: 136.243.197.186: Running manifest and explorers for __consul/ INFO: 136.243.197.186: Running manifest and explorers for __staged_file/usr/local/bin/consul INFO: 136.243.197.186: Generating code for __staged_file/usr/local/bin/consul INFO: 136.243.197.186: Executing code for __staged_file/usr/local/bin/consul mkdir: cannot create directory ‘/var/tmp/cdist’: Permission denied ERROR: 136.243.197.186: Command failed: /bin/sh -e /tmp/tmpacxtbhrf/object/__staged_file/usr/local/bin/consul/.cdist-8tc9mqm6/code-loca l INFO: cdist: Total processing time for 1 host(s): 11.568004369735718 ERROR: cdist: Failed to configure the following hosts: 136.243.197.186` My init file contains only "__consul --version 0.6.0" The problem is that it is trying to create an already existing directory which belongs to another user and it has not permissions at all for other users. When it manages to create this directory, it is chmoed to 0700, which will cause this problem to appear to any future user. This is the output for these directories: ``` root@control:~# ls -lh /var/tmp/ total 4.0K drwx------ 3 ungleich ungleich 4.0K Feb 24 14:22 cdist root@control:~# ls -lh /var/tmp/cdist/ total 4.0K drwx------ 3 ungleich ungleich 4.0K Feb 24 14:22 __staged_file root@control:~# ls -lhd /var/tmp drwxrwxrwt 3 root root 4.0K Feb 24 14:22 /var/tmp root@control:~# ls -lhR /var/tmp/cdist/__staged_file/ /var/tmp/cdist/__staged_file/: total 4.0K drwx------ 3 ungleich ungleich 4.0K Feb 24 14:22 usr /var/tmp/cdist/__staged_file/usr: total 4.0K drwx------ 3 ungleich ungleich 4.0K Feb 24 14:22 local /var/tmp/cdist/__staged_file/usr/local: total 4.0K drwx------ 2 ungleich ungleich 4.0K Feb 24 14:22 bin /var/tmp/cdist/__staged_file/usr/local/bin: total 0 -rw------- 1 ungleich ungleich 0 Feb 24 16:03 consul ``` I'm mentioning you on this issue @telmich just in case.
ungleich-gitea added the
Stale
label 2021-11-20 15:20:44 +00:00
Author
Owner

closed

closed
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#173
No description provided.