Issue #12215 has been updated by Felix Frank.

Thanks guys, this really saved me. Fell into the same hole for whatever reason.

I think this still is a bug though. The agent output is extremely misleading 
and does not point the user to /tmp at all, but complains about not being able 
to create the file in $CWD. This makes debugging quite difficult.

I see two routes here:

1. Find a way to make the agent generate a more distinct error message 
pertaining to the root cause.
2. Add code that detects this scenario (insufficient permissions on temp dir) 
and throws a custom error message.

The former may be more difficult. I'd be willing to try and implement either. 
Thoughts?

Peter Meier wrote:
> Ok a little update, that now makes sense: Unfortunately my /tmp had for some 
> unknown reasons not `chmod 1777`, which I didn't see in the first case, so it 
> is quite clear, why it also wasn't able to write, while being in /tmp, as it 
> would write the tmp file as the target user, which couldn't write to /root 
> nor /tmp at that time. Changing /tmp to `chmod 1777` and running `puppet 
> apply` from there work.
> 
> So what remains is that we have the problem that tempfile is trying to create 
> the temporary files in the current working directory, instead at some more 
> sane place, such as `/tmp` or the target directory itself. I assume that a 
> lot of people will run from `/root`, or as cron jobs from `/`, which makes 
> this quite an ugly issue. I have no idea, what the cwd of the daemon is, but 
> probably not `/tmp`.



----------------------------------------
Bug #12215: Crash in tempfile.rb
https://projects.puppetlabs.com/issues/12215#change-95892

* Author: Joe Hillenbrand
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 2.7.10
* Keywords: 
* Branch: 
----------------------------------------
I was just building new Ubuntu 10.04 servers that have the new version of 
puppet (2.7.10) from the official apt repo. The master is also 2.7.10.

I'm getting this issue on all 4 of the new servers.

I get this from `puppet agent --test --debug`:

<pre>
debug: file_metadata supports formats: b64_zlib_yaml marshal pson raw yaml; 
using pson  
debug: Prefetching parsed resources for ssh_authorized_key  
notice: 
/Stage[main]/Users::Admins/Users::Admin[joe]/Users::Normal[joe]/Ssh_authorized_key[ssh_auth_keys_joe]/user:
 user changed 'root' to 'joe'  
debug: Finishing transaction 70331047200640  
info: FileBucket got a duplicate file {md5}4823b62668593982394e5940425f7180  
debug: Flushing ssh_authorized_key provider target 
/home/joe/.ssh/authorized_keys  
/usr/lib/ruby/1.8/tempfile.rb:52:in `initialize'  
/usr/lib/ruby/1.8/puppet/util/filetype.rb:107:in `new'  
/usr/lib/ruby/1.8/puppet/util/filetype.rb:107:in `write'  
/usr/lib/ruby/1.8/puppet/util/filetype.rb:56:in `real_write'  
/usr/lib/ruby/1.8/puppet/util/filetype.rb:56:in `write'  
/usr/lib/ruby/1.8/puppet/provider/parsedfile.rb:95:in `flush_target'  
/usr/lib/ruby/1.8/puppet/provider/parsedfile.rb:69:in `flush'  
/usr/lib/ruby/1.8/puppet/provider/parsedfile.rb:67:in `each'  
/usr/lib/ruby/1.8/puppet/provider/parsedfile.rb:67:in `flush'  
/usr/lib/ruby/1.8/puppet/provider/parsedfile.rb:341:in `flush'  
/usr/lib/ruby/1.8/puppet/provider/ssh_authorized_key/parsed.rb:65:in `flush'  
/usr/lib/ruby/1.8/puppet/util/suidmanager.rb:81:in `asuser'  
/usr/lib/ruby/1.8/puppet/provider/ssh_authorized_key/parsed.rb:59:in `flush'  
/usr/lib/ruby/1.8/puppet/type.rb:643:in `flush'  
/usr/lib/ruby/1.8/puppet/transaction/resource_harness.rb:139:in `evaluate'  
/usr/lib/ruby/1.8/puppet/transaction.rb:49:in `apply'  
/usr/lib/ruby/1.8/puppet/transaction.rb:84:in `eval_resource'  
/usr/lib/ruby/1.8/puppet/transaction.rb:104:in `evaluate'  
/usr/lib/ruby/1.8/puppet/util.rb:476:in `thinmark'  
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'  
/usr/lib/ruby/1.8/puppet/util.rb:475:in `thinmark'  
/usr/lib/ruby/1.8/puppet/transaction.rb:104:in `evaluate'  
/usr/lib/ruby/1.8/puppet/transaction.rb:386:in `traverse'  
/usr/lib/ruby/1.8/puppet/transaction.rb:99:in `evaluate'  
/usr/lib/ruby/1.8/puppet/resource/catalog.rb:141:in `apply'  
/usr/lib/ruby/1.8/puppet/configurer.rb:121:in `retrieve_and_apply_catalog'  
/usr/lib/ruby/1.8/puppet/util.rb:180:in `benchmark'  
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'  
/usr/lib/ruby/1.8/puppet/util.rb:179:in `benchmark'  
/usr/lib/ruby/1.8/puppet/configurer.rb:120:in `retrieve_and_apply_catalog'  
/usr/lib/ruby/1.8/puppet/configurer.rb:151:in `run'  
/usr/lib/ruby/1.8/puppet/agent.rb:46  
/usr/lib/ruby/1.8/puppet/agent/locker.rb:11:in `lock'  
/usr/lib/ruby/1.8/puppet/agent.rb:46  
/usr/lib/ruby/1.8/sync.rb:230:in `synchronize'  
/usr/lib/ruby/1.8/puppet/agent.rb:46  
/usr/lib/ruby/1.8/puppet/agent.rb:110:in `with_client'  
/usr/lib/ruby/1.8/puppet/agent.rb:44  
/usr/lib/ruby/1.8/puppet/application.rb:172:in `call'  
/usr/lib/ruby/1.8/puppet/application.rb:172:in `controlled_run'  
/usr/lib/ruby/1.8/puppet/agent.rb:42:in `run'  
/usr/lib/ruby/1.8/puppet/application/agent.rb:344:in `onetime'  
/usr/lib/ruby/1.8/puppet/application/agent.rb:318:in `run_command'  
/usr/lib/ruby/1.8/puppet/application.rb:309:in `run'  
/usr/lib/ruby/1.8/puppet/application.rb:413:in `hook'  
/usr/lib/ruby/1.8/puppet/application.rb:309:in `run'  
/usr/lib/ruby/1.8/puppet/application.rb:404:in `exit_on_fail'  
/usr/lib/ruby/1.8/puppet/application.rb:309:in `run'  
/usr/lib/ruby/1.8/puppet/util/command_line.rb:69:in `execute'  
/usr/bin/puppet:4  
err: 
/Stage[main]/Users::Admins/Users::Admin[joe]/Users::Normal[joe]/Ssh_authorized_key[ssh_auth_keys_joe]:
 Could not evaluate: Puppet::Util::FileType::FileTypeFlat could not write 
/home/joe/.ssh/authorized_keys: cannot generate tempfile 
`/root/puppet20120126-10183-jdezsk-9'  
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to