Using remote_file issue with file://

Dear all,

the following snippet doesn’t seem to work properly:

default[:aem][:download_url] = ‘file:///my/path/to/my/file.jar’

remote_jar_name = "aem-quickstart-#{node[:aem][:version]}.jar"
remote_file “#{Chef::Config[:file_cache_path]}/#{remote_jar_name}” do
source "#{vars[:download_url]}"
mode "0755"
action :create_if_missing
end

Can you please advice.

Moreover when I use a http://adress behind an authenticated form I can’t
find the way to provide the username password. This issue
https://tickets.opscode.com/browse/CHEF-3786 seems to provide this
functionality but I can’t find how to use it.

Thanks in advance,
Kiril

On Fri, Jul 17, 2015 at 12:48 PM, Kiril Ilyev kiril.ilyev@gmail.com wrote:

the following snippet doesn't seem to work properly:

default[:aem][:download_url] = 'file:///my/path/to/my/file.jar'

remote_jar_name = "aem-quickstart-#{node[:aem][:version]}.jar"
remote_file "#{Chef::Config[:file_cache_path]}/#{remote_jar_name}" do
source "#{vars[:download_url]}"
mode "0755"
action :create_if_missing
end

Can you please advice.

What do you mean "doesn't work properly"? What error do you get?

Moreover when I use a http://adress behind an authenticated form I can't
find the way to provide the username password. This issue
https://tickets.opscode.com/browse/CHEF-3786 seems to provide this
functionality but I can't find how to use it.

DId you try http://user:password@server.example.com/ ?

  • Julian

--
[ Julian C. Dunn jdunn@aquezada.com * Sorry, I'm ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]

Hello Julien,

DId you try http://user:password@server.example.
http://user:password@server.example.com/

This wroked well thanks a lot.

However I am still having an issue when prefixing with file:/// instead of
an http.

See my error below:
I am using chef version:
09:06 $ chef --v
Chef Development Kit Version: 0.6.2
chef-client version: 12.3.0
berks version: 3.2.4
kitchen version: 1.4.0

If i put this in my browser :
file:///home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties
I get the file i need. So i cannot understand why chef doesn't reach it.
The documentation says that file http & https are supported.

Thanks in advance,
Kiril

==> default: Error executing action create on resource
'remote_file[/opt/aem/author/license.properties]'
==> default:

==> default:
==> default: Errno::ENOENT
==> default: -------------
==> default: No such file or directory @ rb_sysopen -
/home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties
==> default:
==> default: Resource Declaration:
==> default: ---------------------
==> default: # In
/tmp/vagrant-chef/ee0f6fb5916f969b009ab9295c2cdc88/cookbooks/aem/recipes/author.rb
==> default:
==> default: 31: remote_file
"#{node[:aem][:author][:default_context]}/license.properties" do
==> default: 32: source "#{node[:aem][:license_url]}"
==> default: 33: mode 0644
==> default: 34: end
==> default: 35: end
==> default:
==> default: Compiled Resource:
==> default: ------------------
==> default: # Declared in
/tmp/vagrant-chef/ee0f6fb5916f969b009ab9295c2cdc88/cookbooks/aem/recipes/author.rb:31:in
`from_file'
==> default:
==> default: remote_file("/opt/aem/author/license.properties") do
==> default: provider Chef::Provider::RemoteFile
==> default: action [:create]
==> default: retries 0
==> default: retry_delay 2
==> default: default_guard_interpreter :default
==> default: path "/opt/aem/author/license.properties"
==> default: backup 5
==> default: atomic_update true
==> default: source
["file:///home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties"]
==> default: use_etag true
==> default: use_last_modified true
==> default: declared_type :remote_file
==> default: cookbook_name :aem
==> default: recipe_name "author"
==> default: mode 420
==> default: end
==> default:
==> default: [2015-07-20T07:12:22+00:00] INFO: Running queued delayed
notifications before re-raising exception
==> default:
==> default: Running handlers:
==> default: [2015-07-20T07:12:22+00:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default: [2015-07-20T07:12:22+00:00] ERROR: Exception handlers complete
==> default: Chef Client failed. 3 resources updated in 358.642107798
seconds
==> default: [2015-07-20T07:12:22+00:00] FATAL: Stacktrace dumped to
/var/chef/cache/chef-stacktrace.out
==> default: [2015-07-20T07:12:22+00:00] ERROR:
remote_file[/opt/aem/author/license.properties] (aem::author line 31) had
an error: Errno::ENOENT: No such file or directory @ rb_sysopen -
/home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties
==> default: [2015-07-20T07:12:22+00:00] FATAL:
Chef::Exceptions::ChildConvergeError: Chef run process exited
unsuccessfully (exit code 1)

2015-07-19 0:06 GMT+02:00 Julian C. Dunn jdunn@aquezada.com:

On Fri, Jul 17, 2015 at 12:48 PM, Kiril Ilyev kiril.ilyev@gmail.com
wrote:

the following snippet doesn't seem to work properly:

default[:aem][:download_url] = 'file:///my/path/to/my/file.jar'

remote_jar_name = "aem-quickstart-#{node[:aem][:version]}.jar"
remote_file "#{Chef::Config[:file_cache_path]}/#{remote_jar_name}" do
source "#{vars[:download_url]}"
mode "0755"
action :create_if_missing
end

Can you please advice.

What do you mean "doesn't work properly"? What error do you get?

Moreover when I use a http://adress behind an authenticated form I can't
find the way to provide the username password. This issue
https://tickets.opscode.com/browse/CHEF-3786 seems to provide this
functionality but I can't find how to use it.

DId you try http://user:password@server.example.com/ ?

  • Julian

--
[ Julian C. Dunn jdunn@aquezada.com * Sorry, I'm ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]

Does the user account chef is running as have access to the file share you
are connecting to?

Steve
On Jul 20, 2015 2:21 AM, "Kiril Ilyev" kiril.ilyev@gmail.com wrote:

Hello Julien,

DId you try http://user:password@server.example.
http://user:password@server.example.com/

This wroked well thanks a lot.

However I am still having an issue when prefixing with file:/// instead of
an http.

See my error below:
I am using chef version:
09:06 $ chef --v
Chef Development Kit Version: 0.6.2
chef-client version: 12.3.0
berks version: 3.2.4
kitchen version: 1.4.0

If i put this in my browser :
file:///home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties
I get the file i need. So i cannot understand why chef doesn't reach it.
The documentation says that file http & https are supported.

Thanks in advance,
Kiril

==> default: Error executing action create on resource
'remote_file[/opt/aem/author/license.properties]'
==> default:

==> default:
==> default: Errno::ENOENT
==> default: -------------
==> default: No such file or directory @ rb_sysopen -
/home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties
==> default:
==> default: Resource Declaration:
==> default: ---------------------
==> default: # In
/tmp/vagrant-chef/ee0f6fb5916f969b009ab9295c2cdc88/cookbooks/aem/recipes/author.rb
==> default:
==> default: 31: remote_file
"#{node[:aem][:author][:default_context]}/license.properties" do
==> default: 32: source "#{node[:aem][:license_url]}"
==> default: 33: mode 0644
==> default: 34: end
==> default: 35: end
==> default:
==> default: Compiled Resource:
==> default: ------------------
==> default: # Declared in
/tmp/vagrant-chef/ee0f6fb5916f969b009ab9295c2cdc88/cookbooks/aem/recipes/author.rb:31:in
`from_file'
==> default:
==> default: remote_file("/opt/aem/author/license.properties") do
==> default: provider Chef::Provider::RemoteFile
==> default: action [:create]
==> default: retries 0
==> default: retry_delay 2
==> default: default_guard_interpreter :default
==> default: path "/opt/aem/author/license.properties"
==> default: backup 5
==> default: atomic_update true
==> default: source
["file:///home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties"]
==> default: use_etag true
==> default: use_last_modified true
==> default: declared_type :remote_file
==> default: cookbook_name :aem
==> default: recipe_name "author"
==> default: mode 420
==> default: end
==> default:
==> default: [2015-07-20T07:12:22+00:00] INFO: Running queued delayed
notifications before re-raising exception
==> default:
==> default: Running handlers:
==> default: [2015-07-20T07:12:22+00:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default: [2015-07-20T07:12:22+00:00] ERROR: Exception handlers complete
==> default: Chef Client failed. 3 resources updated in 358.642107798
seconds
==> default: [2015-07-20T07:12:22+00:00] FATAL: Stacktrace dumped to
/var/chef/cache/chef-stacktrace.out
==> default: [2015-07-20T07:12:22+00:00] ERROR:
remote_file[/opt/aem/author/license.properties] (aem::author line 31) had
an error: Errno::ENOENT: No such file or directory @ rb_sysopen -
/home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties
==> default: [2015-07-20T07:12:22+00:00] FATAL:
Chef::Exceptions::ChildConvergeError: Chef run process exited
unsuccessfully (exit code 1)

2015-07-19 0:06 GMT+02:00 Julian C. Dunn jdunn@aquezada.com:

On Fri, Jul 17, 2015 at 12:48 PM, Kiril Ilyev kiril.ilyev@gmail.com
wrote:

the following snippet doesn't seem to work properly:

default[:aem][:download_url] = 'file:///my/path/to/my/file.jar'

remote_jar_name = "aem-quickstart-#{node[:aem][:version]}.jar"
remote_file "#{Chef::Config[:file_cache_path]}/#{remote_jar_name}" do
source "#{vars[:download_url]}"
mode "0755"
action :create_if_missing
end

Can you please advice.

What do you mean "doesn't work properly"? What error do you get?

Moreover when I use a http://adress behind an authenticated form I
can't
find the way to provide the username password. This issue
https://tickets.opscode.com/browse/CHEF-3786 seems to provide this
functionality but I can't find how to use it.

DId you try http://user:password@server.example.com/ ?

  • Julian

--
[ Julian C. Dunn jdunn@aquezada.com * Sorry, I'm ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]

I am using chef on my local machine and trying to access a local folder
under my home. Could it be that chef isn't able to read my home folder?

2015-07-20 14:46 GMT+02:00 Steve Murawski steven.murawski@gmail.com:

Does the user account chef is running as have access to the file share you
are connecting to?

Steve
On Jul 20, 2015 2:21 AM, "Kiril Ilyev" kiril.ilyev@gmail.com wrote:

Hello Julien,

DId you try http://user:password@server.example.
http://user:password@server.example.com/

This wroked well thanks a lot.

However I am still having an issue when prefixing with file:/// instead
of an http.

See my error below:
I am using chef version:
09:06 $ chef --v
Chef Development Kit Version: 0.6.2
chef-client version: 12.3.0
berks version: 3.2.4
kitchen version: 1.4.0

If i put this in my browser :
file:///home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties
I get the file i need. So i cannot understand why chef doesn't reach it.
The documentation says that file http & https are supported.

Thanks in advance,
Kiril

==> default: Error executing action create on resource
'remote_file[/opt/aem/author/license.properties]'
==> default:

==> default:
==> default: Errno::ENOENT
==> default: -------------
==> default: No such file or directory @ rb_sysopen -
/home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties
==> default:
==> default: Resource Declaration:
==> default: ---------------------
==> default: # In
/tmp/vagrant-chef/ee0f6fb5916f969b009ab9295c2cdc88/cookbooks/aem/recipes/author.rb
==> default:
==> default: 31: remote_file
"#{node[:aem][:author][:default_context]}/license.properties" do
==> default: 32: source "#{node[:aem][:license_url]}"
==> default: 33: mode 0644
==> default: 34: end
==> default: 35: end
==> default:
==> default: Compiled Resource:
==> default: ------------------
==> default: # Declared in
/tmp/vagrant-chef/ee0f6fb5916f969b009ab9295c2cdc88/cookbooks/aem/recipes/author.rb:31:in
`from_file'
==> default:
==> default: remote_file("/opt/aem/author/license.properties") do
==> default: provider Chef::Provider::RemoteFile
==> default: action [:create]
==> default: retries 0
==> default: retry_delay 2
==> default: default_guard_interpreter :default
==> default: path "/opt/aem/author/license.properties"
==> default: backup 5
==> default: atomic_update true
==> default: source
["file:///home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties"]
==> default: use_etag true
==> default: use_last_modified true
==> default: declared_type :remote_file
==> default: cookbook_name :aem
==> default: recipe_name "author"
==> default: mode 420
==> default: end
==> default:
==> default: [2015-07-20T07:12:22+00:00] INFO: Running queued delayed
notifications before re-raising exception
==> default:
==> default: Running handlers:
==> default: [2015-07-20T07:12:22+00:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default: [2015-07-20T07:12:22+00:00] ERROR: Exception handlers
complete
==> default: Chef Client failed. 3 resources updated in 358.642107798
seconds
==> default: [2015-07-20T07:12:22+00:00] FATAL: Stacktrace dumped to
/var/chef/cache/chef-stacktrace.out
==> default: [2015-07-20T07:12:22+00:00] ERROR:
remote_file[/opt/aem/author/license.properties] (aem::author line 31) had
an error: Errno::ENOENT: No such file or directory @ rb_sysopen -
/home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties
==> default: [2015-07-20T07:12:22+00:00] FATAL:
Chef::Exceptions::ChildConvergeError: Chef run process exited
unsuccessfully (exit code 1)

2015-07-19 0:06 GMT+02:00 Julian C. Dunn jdunn@aquezada.com:

On Fri, Jul 17, 2015 at 12:48 PM, Kiril Ilyev kiril.ilyev@gmail.com
wrote:

the following snippet doesn't seem to work properly:

default[:aem][:download_url] = 'file:///my/path/to/my/file.jar'

remote_jar_name = "aem-quickstart-#{node[:aem][:version]}.jar"
remote_file "#{Chef::Config[:file_cache_path]}/#{remote_jar_name}" do
source "#{vars[:download_url]}"
mode "0755"
action :create_if_missing
end

Can you please advice.

What do you mean "doesn't work properly"? What error do you get?

Moreover when I use a http://adress behind an authenticated form I
can't
find the way to provide the username password. This issue
https://tickets.opscode.com/browse/CHEF-3786 seems to provide this
functionality but I can't find how to use it.

DId you try http://user:password@server.example.com/ ?

  • Julian

--
[ Julian C. Dunn jdunn@aquezada.com * Sorry, I'm ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]

That totally depends on what user account you are running Chef as. Chef will have the rights of the account it runs as. If that account doesn't have rights to your home directory or that file, then it won't be able to open it to read/copy the content to your new file location.

Steve

Steven Murawski
Community Software Development Engineer @ Chef
Microsoft MVP - PowerShell
http://stevenmurawski.com [http://stevenmurawski.com/]
On 7/20/2015 9:02:36 AM, Kiril Ilyev kiril.ilyev@gmail.com wrote:
I am using chef on my local machine and trying to access a local folder under my home. Could it be that chef isn't able to read my home folder?

2015-07-20 14:46 GMT+02:00 Steve Murawski <steven.murawski@gmail.com [mailto:steven.murawski@gmail.com]>:

Does the user account chef is running as have access to the file share you are connecting to?
Steve
On Jul 20, 2015 2:21 AM, "Kiril Ilyev" <kiril.ilyev@gmail.com [mailto:kiril.ilyev@gmail.com]> wrote:

Hello Julien,

DId you try http://user:password@server.example. [http://user:password@server.example.com/]

This wroked well thanks a lot.

However I am still having an issue when prefixing with file:/// instead of an http.

See my error below:
I am using chef version:
09:06 $ chef --v
Chef Development Kit Version: 0.6.2
chef-client version: 12.3.0
berks version: 3.2.4
kitchen version: 1.4.0

If i put this in my browser : file:///home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties I get the file i need. So i cannot understand why chef doesn't reach it. The documentation says that file http & https are supported.

Thanks in advance,
Kiril

==> default: Error executing action create on resource 'remote_file[/opt/aem/author/license.properties]'

==> default: ================================================================================
==> default:
==> default: Errno::ENOENT
==> default: -------------
==> default: No such file or directory @ rb_sysopen - /home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties
==> default:
==> default: Resource Declaration:
==> default: ---------------------
==> default: # In /tmp/vagrant-chef/ee0f6fb5916f969b009ab9295c2cdc88/cookbooks/aem/recipes/author.rb
==> default:
==> default: 31: remote_file "#{node[:aem][:author][:default_context]}/license.properties" do
==> default: 32: source "#{node[:aem][:license_url]}"
==> default: 33: mode 0644
==> default: 34: end
==> default: 35: end
==> default:
==> default: Compiled Resource:
==> default: ------------------
==> default: # Declared in /tmp/vagrant-chef/ee0f6fb5916f969b009ab9295c2cdc88/cookbooks/aem/recipes/author.rb:31:in `from_file'
==> default:
==> default: remote_file("/opt/aem/author/license.properties") do
==> default: provider Chef::Provider::RemoteFile
==> default: action [:create]
==> default: retries 0
==> default: retry_delay 2
==> default: default_guard_interpreter :default
==> default: path "/opt/aem/author/license.properties"
==> default: backup 5
==> default: atomic_update true
==> default: source ["file:///home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties"]
==> default: use_etag true
==> default: use_last_modified true
==> default: declared_type :remote_file
==> default: cookbook_name :aem
==> default: recipe_name "author"
==> default: mode 420
==> default: end
==> default:
==> default: [2015-07-20T07:12:22+00:00] INFO: Running queued delayed notifications before re-raising exception
==> default:
==> default: Running handlers:
==> default: [2015-07-20T07:12:22+00:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default: [2015-07-20T07:12:22+00:00] ERROR: Exception handlers complete
==> default: Chef Client failed. 3 resources updated in 358.642107798 seconds
==> default: [2015-07-20T07:12:22+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2015-07-20T07:12:22+00:00] ERROR: remote_file[/opt/aem/author/license.properties] (aem::author line 31) had an error: Errno::ENOENT: No such file or directory @ rb_sysopen - /home/kiril/Documents/cq5.6-adv-dev-usb-2013-02-21/Distribution/CQ5/license.properties
==> default: [2015-07-20T07:12:22+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

2015-07-19 0:06 GMT+02:00 Julian C. Dunn <jdunn@aquezada.com [mailto:jdunn@aquezada.com]>:

On Fri, Jul 17, 2015 at 12:48 PM, Kiril Ilyev <kiril.ilyev@gmail.com [mailto:kiril.ilyev@gmail.com]> wrote:

the following snippet doesn't seem to work properly:

default[:aem][:download_url] = 'file:///my/path/to/my/file.jar'

remote_jar_name = "aem-quickstart-#{node[:aem][:version]}.jar"
remote_file "#{Chef::Config[:file_cache_path]}/#{remote_jar_name}" do
source "#{vars[:download_url]}"
mode "0755"
action :create_if_missing
end

Can you please advice.

What do you mean "doesn't work properly"? What error do you get?

Moreover when I use a http://adress [http://adress] behind an authenticated form I can't
find the way to provide the username password. This issue
https://tickets.opscode.com/browse/CHEF-3786 [https://tickets.opscode.com/browse/CHEF-3786] seems to provide this
functionality but I can't find how to use it.

DId you try http://user:password@server.example.com/ [http://user:password@server.example.com/] ?

  • Julian

--
[ Julian C. Dunn <jdunn@aquezada.com [mailto:jdunn@aquezada.com]> * Sorry, I'm ]
[ WWW: http://www.aquezada.com/staff/julian [http://www.aquezada.com/staff/julian] * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ [http://sdf.org/1/users/keymaker/] * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]