berkshelf / ridley

A reliable Chef API client with a clean syntax
Other
230 stars 84 forks source link

Possible bug in chef/config #262

Closed jsirex closed 10 years ago

jsirex commented 10 years ago

Due to https://github.com/RiotGames/ridley/blob/master/lib/ridley/chef/config.rb#L72-L75 each time I issue knife or berks command many temp directories have created:

drwx------ 2 sirex sirex       4096 Apr  7 12:15 d20140407-3969-1hmeyya
drwx------ 2 sirex sirex       4096 Apr  7 12:15 d20140407-3969-1wibq9q
drwx------ 2 sirex sirex       4096 Apr  7 12:15 d20140407-3969-1z02itz
drwx------ 2 sirex sirex       4096 Apr  7 12:15 d20140407-3969-5ic5ap

The same issue I have mistakenly posted to berkshelf gem: https://github.com/berkshelf/berkshelf/issues/1069

Not sure how to fix that. Probably you mean to generate an temp directory path, and create it later, only if directory really required. Or may be do a cleanup after all?

pdf commented 10 years ago

This is a serious problem - I have some code in our monitoring service that needs to talk to Chef, and it can quickly make the /tmp directory nearly inaccessible when the number of entries gets to high.

poliva83 commented 10 years ago

Has anyone found a workaround to this issue?

poliva83 commented 10 years ago

I experience this issue after installing chefdk 0.1.0 on a ubuntu 12.04 node if that helps someone reproduce it in their environment. Apparently Ridley configuration gets called before knife configuration is read which makes configuring :syntax_check_cache_path in knife.rb not a valid workaround.

sethvargo commented 10 years ago

Fixed in https://github.com/RiotGames/ridley/commit/19a3e94de44e2ff88b62cecbb3ae4dde753a70f0

AnalogJ commented 8 years ago

This seems to be happening again. Could there be a regression?

Here's the debugging info that @jsirex provided in the https://github.com/berkshelf/berkshelf/issues/1069 issue. Note, I wiped out the /tmp folder and then ran our script once and the following files were created. Our script uses the ridley gem, executes berks multiple times and also calls knife.

tmp]# ls | grep d2015 | wc
382     382    8987

Chef version information:

$chef --version
Chef Development Kit Version: 0.9.0
chef-client version: 12.5.1
berks version: 4.0.1
kitchen version: 1.4.2

Ruby & Gem version info

$ ruby --version
ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-linux]

$ gem list | grep ridley
ridley (4.3.1, 4.1.1)

I didnt provide the Berksfile/Berksfile.lock/knife.rb nor full Gemlist but I can if needed.

Our CI environment was completely clobbered as nothing could write to the /tmp folder anymore.