Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Remote Directory resource fails #3

Closed
Soulou opened this issue Jun 18, 2013 · 6 comments
Closed

Remote Directory resource fails #3

Soulou opened this issue Jun 18, 2013 · 6 comments
Assignees

Comments

@Soulou
Copy link

Soulou commented Jun 18, 2013

Hi,

I'm using chef-solo

$ chef-solo --version
Chef: 11.4.4

I'm unable to use mongo-10gen::single recipe because it fails with the default recipe, here are the logs :

  * remote_directory[/data/mongodb] action create
================================================================================
Error executing action `create` on resource 'remote_directory[/data/mongodb]'
================================================================================


Chef::Exceptions::FileNotFound
------------------------------
cookbook mongodb-10gen has no directory files/default/mongodb


Resource Declaration:
---------------------
# In /tmp/chef-solo/site-cookbooks/mongodb-10gen/recipes/default.rb

 76: remote_directory "/data/mongodb" do
 77:   source "mongodb"
 78:   recursive true
 79:   files_group "mongodb"
 80:   files_owner "mongodb"
 81:   files_mode 00644
 82:   owner "mongodb"
 83:   group "mongodb"
 84:   mode 00755
 85: end
 86: 



Compiled Resource:
------------------
# Declared in /tmp/chef-solo/site-cookbooks/mongodb-10gen/recipes/default.rb:76:in `from_file'

remote_directory("/data/mongodb") do
  provider Chef::Provider::RemoteDirectory
  action :create
  retries 0
  retry_delay 2
  path "/data/mongodb"
  recursive true
  source "mongodb"
  files_backup 5
  files_owner "mongodb"
  files_group "mongodb"
  files_mode 420
  overwrite true
  cookbook_name :"mongodb-10gen"
  recipe_name "default"
  owner "mongodb"
  group "mongodb"
  mode "0755"
end



[2013-06-18T12:41:10+00:00] ERROR: Running exception handlers
[2013-06-18T12:41:10+00:00] ERROR: Exception handlers complete
Chef Client failed. 4 resources updated
[2013-06-18T12:41:10+00:00] FATAL: Stacktrace dumped to /tmp/chef-solo/chef-stacktrace.out
[2013-06-18T12:41:10+00:00] FATAL: Chef::Exceptions::FileNotFound: remote_directory[/data/mongodb] (mongodb-10gen::default line 76) had an error: Chef::Exceptions::FileNotFound: cookbook mongodb-10gen has no directory files/default/mongodb
ERROR: RuntimeError: chef-solo failed. See output above.

Whereas the files are correctly on the server :

/tmp/chef-solo/site-cookbooks/mongodb-10gen/files/default/mongodb# ls -la
total 24
drwxr-xr-x 6 root root 4096 Jun 18 12:06 .
drwxr-xr-x 3 root root 4096 Jun 18 12:06 ..
drwxr-xr-x 2 root root 4096 Jun 18 12:06 db
drwxr-xr-x 2 root root 4096 Jun 18 12:06 etc
drwxr-xr-x 2 root root 4096 Jun 18 12:06 log
drwxr-xr-x 2 root root 4096 Jun 18 12:06 misc
@ghost ghost assigned sawanoboly Jun 30, 2013
@sawanoboly
Copy link
Member

@Soulou

Please tell me your environments.

I tried to check your report in Ubuntu12.04 on the Joyent VirtualMachine.
A remote_directory resource works fine.

# chef-solo -v
Chef: 11.4.4
# chef-solo -c solo.rb -o 'mongodb-10gen::single'

-- snip -- 
Recipe: mongodb-10gen::default
  * file[/etc/default/mongodb] action create_if_missing
    - create new file /etc/default/mongodb with content checksum a35762
        --- /tmp/chef-tempfile20130630-3670-1fbnvdm 2013-06-30 10:06:55.000000000 +0000
        +++ /tmp/chef-diff20130630-3670-1goh2ch 2013-06-30 10:06:55.000000000 +0000
        @@ -0,0 +1 @@
        +ENABLE_MONGODB=no

  * package[mongodb-10gen] action install
    - install version 2.4.4 of package mongodb-10gen

  * directory[/data] action create (up to date)
  * remote_directory[/data/mongodb] action create
    - create new directory /data/mongodb
    - change mode from '' to '0755'
    - change owner from '' to 'mongodb'
    - change group from '' to 'mongodb'Recipe: <Dynamically Defined Resource>
  * directory[/data/mongodb/misc] action create
    - create new directory /data/mongodb/misc
    - change mode from '' to '0755'
    - change owner from '' to 'mongodb'
    - change group from '' to 'mongodb'
-- snip -- 

@Soulou
Copy link
Author

Soulou commented Jul 1, 2013

I'm using chef-solo to bootstrap a VM from digital ocean with Ubuntu 12.04. So the environment is quite identical as yours, The chef version is the last one (as it has been bootstrapped)

The resource should work, I'm going to do some additional tests.

@sawanoboly
Copy link
Member

mmm... I have never use the digital ocean.

How about changing value of file_cache_path?

@teyrow
Copy link

teyrow commented Jul 12, 2013

I had the same problem. Seems to be a bug in chef in remote_directory. Since my knife solo cook did not rsync the .gitkeep-files the dirs where empty.
Found work around by adding empty files in subfolders to /mongodb-10gen/files/default/mongodb :

.
|____db
| |____.gitkeep
| |____a.txt
|____etc
| |____.gitkeep
| |____a.txt
|____log
| |____.gitkeep
| |____a.txt
|____misc
| |____.gitkeep
| |____.mongorc.js

And for now it works.

@sawanoboly
Copy link
Member

@Soulou @teyrow

Thanks a lot! I had updated cookbook and share.

979c7d9

@Soulou
Copy link
Author

Soulou commented Jul 13, 2013

Thank you @teyrow I hadn't the time to test further, happy to see I'm not alone =)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants