puppet apply. error: 无法生成临时文件 `/tmp/puppet…'

huangapple go评论89阅读模式
英文:

puppet apply. error: cannot generate tempfile `/tmp/puppet...'

问题

在Centos服务器上,我在使用puppet apply时遇到错误:

puppet apply \
--verbose \
--modulepath=modules \
--node_terminus=exec \
--external_nodes=$PWD/modules/puppet/files/hostinfo/nodeclassifier.rb \
--color=true \
--no-daemonize \
--no-usecacheonfailure \
--server=notahost \
--config=$PWD/modules/puppet/files/puppet.conf \
--debug \
manifests/site.pp
debug: 正在执行 '/opt/puppet-data/puppet/modules/puppet/files/hostinfo/nodeclassifier.rb [主机名]'
无法执行: 无法生成临时文件 `/tmp/puppet20230712-12431-18iovt1-9`

另外,文件系统是可读写的:

[root@host puppet]# echo "Test" > /tmp/puppet20230712-4607-ywx98g-9
[root@host puppet]#

以及文件夹属性:

# lsattr /
...
----------I---- /tmp
...
英文:

One one of the servers with Centos I am getting error with puppet apply:

puppet apply \
--verbose \
--modulepath=modules \
--node_terminus=exec \
--external_nodes=$PWD/modules/puppet/files/hostinfo/nodeclassifier.rb \
--color=true \
--no-daemonize \
--no-usecacheonfailure \
--server=notahost \
--config=$PWD/modules/puppet/files/puppet.conf \
--debug \
manifests/site.pp
debug: Executing '/opt/puppet-data/puppet/modules/puppet/files/hostinfo/nodeclassifier.rb [host name]'
Could not run: cannot generate tempfile `/tmp/puppet20230712-12431-18iovt1-9'

Also:

ls -la /
total 3105
drwxr-xr-x.    26 root root    4096 Jan 12 09:22 .
drwxr-xr-x.    26 root root    4096 Jan 12 09:22 ..
...
drwxrwxrwt. 32000 root root 3035136 Jul 12 08:23 tmp
drwxr-xr-x.    15 root root    4096 Sep 14  2014 usr
drwxr-xr-x.    24 root root    4096 Mar 18  2021 var

Filesystem is RW:

[root@host puppet]# echo "Test" > /tmp/puppet20230712-4607-ywx98g-9
[root@host puppet]#

And folder attributes:

# lsattr /
...
----------I---- /tmp
...

答案1

得分: 1

你的 /tmp 目录有32000个子目录。这是ext3文件系统的限制,也可能适用于其他文件系统。如果Puppet试图创建的文件实际上是一个目录,那么失败的尝试并不奇怪。其他软件也会受到影响。

清理你的 /tmp 文件夹应该可以解决这个问题。

你还应该尝试确定为什么你的 /tmp 首先会填满,然后采取适当的措施防止再次发生。你可以考虑使用Puppet的Tidy资源类型,或者systemd-tmpfiles服务,或者修改生成/tmp子目录并未清理它们的任何软件。

英文:

Your /tmp directory has 32000 subdirectories. This is the limit for ext3, and maybe for other filesystems, too. If the file Puppet is trying to create is in fact a directory, then it is not surprising that the attempt fails. Other software will be affected, too.

Cleaning out your /tmp folder should resolve the issue.

You should also try to determine why your /tmp filled so full in the first place, and take appropriate measures to prevent that from happening again. You could consider Puppet's Tidy resource type for that, or the systemd-tmpfiles service, or perhaps modifications to whatever software is generating subdirectories in /tmp and failing to clean them up.

huangapple
  • 本文由 发表于 2023年7月12日 20:32:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76670575.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定