# Question about application(\_django)

**URL:** <https://discourse.chef.io/t/question-about-application--django/3296>\
**Category:** Chef Infra (archive)\
**Created:** [November 15, 2012, 4:43pm UTC](https://discourse.chef.io/t/question-about-application--django/3296 "2012-11-15T16:43:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arnold\_Krille](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/arnold_krille/32/285_2.png) [@Arnold\_Krille](https://discourse.chef.io/u/Arnold_Krille)\
**Post date:** [November 15, 2012, 4:43pm UTC](https://discourse.chef.io/t/question-about-application--django/3296/1 "2012-11-15T16:43:24Z")

</div>

Hi all,

this is probably a beginners question but I can’t figure it out:

I want to use application (application\_django to be specific) to deploy our  
django project. Our source is in a subversion repository that is only  
accessible with a valid username/password. But I don’t know how to give the  
username and password to the deployment process.

## This is what I have so far:

application “ohf2” do  
path "/srv/ohf2"  
owner "www-data"  
group "www-data"  
scm\_provider Chef::Provider::Subversion do  
svn\_username "**"  
svn\_password "**"  
end  
repository “[https://development.bcs.bcs/svn/bcspackages/trunk/monster-](https://development.bcs.bcs/svn/bcspackages/trunk/monster-)  
master”

#migrate true

django do  
packages [“django”, “django\_extensions”, “django-mptt”]  
debug true

end

## end

## The error it returns is:

## FATAL: Errno::ENOENT: deploy\_revision[ohf2] (/var/chef/cache/cookbooks/application/providers/default.rb line 122) had an error: Errno::ENOENT: No such file or directo ry - svn info [https://development.bcs.bcs/svn/bcspackages/trunk/monster-master](https://development.bcs.bcs/svn/bcspackages/trunk/monster-master) -rHEAD

When I copy the url to a browser it asks for the authentication and when I  
enter the deployment-auth it shows the correct stuff…

I also tried giving svn\_username and svn\_password as parameters on the  
application-level but then it just complains that it doesn’t know what to do  
with the parameters.

What should I do? What am I doing wrong?  
Should I ditch application and just rebuild the parts of application\_django  
that I need for my own recipe?

Thanks in advance,

Arnold

---

<div class="post-metadata">

**Author:** ![coderanger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/coderanger/32/5_2.png) [@coderanger](https://discourse.chef.io/u/coderanger)\
**Post date:** [November 15, 2012, 4:55pm UTC](https://discourse.chef.io/t/question-about-application--django/3296/2 "2012-11-15T16:55:13Z")

</div>

On Nov 15, 2012, at 8:43 AM, Arnold Krille wrote:

> Hi all,
> 
> this is probably a beginners question but I can't figure it out:
> 
> I want to use application (application\_django to be specific) to deploy our  
> django project. Our source is in a subversion repository that is only  
> accessible with a valid username/password. But I don't know how to give the  
> username and password to the deployment process.
> 
> ## This is what I have so far:
> 
> application "ohf2" do  
> path "/srv/ohf2"  
> owner "www-data"  
> group "www-data"  
> scm\_provider Chef::Provider::Subversion do  
> svn\_username "**"  
> svn\_password "**"  
> end  
> repository "[https://development.bcs.bcs/svn/bcspackages/trunk/monster-](https://development.bcs.bcs/svn/bcspackages/trunk/monster-)  
> master"
> 
> #migrate true
> 
> django do  
> packages ["django", "django\_extensions", "django-mptt"]  
> debug true
> 
> end
> 
> ## end
> 
> ## The error it returns is:
> 
> ## FATAL: Errno::ENOENT: deploy\_revision[ohf2] (/var/chef/cache/cookbooks/application/providers/default.rb line 122) had an error: Errno::ENOENT: No such file or directo ry - svn info [https://development.bcs.bcs/svn/bcspackages/trunk/monster-master](https://development.bcs.bcs/svn/bcspackages/trunk/monster-master) -rHEAD
> 
> When I copy the url to a browser it asks for the authentication and when I  
> enter the deployment-auth it shows the correct stuff...
> 
> I also tried giving svn\_username and svn\_password as parameters on the  
> application-level but then it just complains that it doesn't know what to do  
> with the parameters.
> 
> What should I do? What am I doing wrong?  
> Should I ditch application and just rebuild the parts of application\_django  
> that I need for my own recipe?

Are you installing svn before calling that?

--Noah

---

<div class="post-metadata">

**Author:** ![Arnold\_Krille](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/arnold_krille/32/285_2.png) [@Arnold\_Krille](https://discourse.chef.io/u/Arnold_Krille)\
**Post date:** [November 15, 2012, 5:28pm UTC](https://discourse.chef.io/t/question-about-application--django/3296/3 "2012-11-15T17:28:37Z")

</div>

On Thursday 15 November 2012 08:55:13 Noah Kantrowitz wrote:

> On Nov 15, 2012, at 8:43 AM, Arnold Krille wrote:
> 
> > Hi all,
> > 
> > this is probably a beginners question but I can't figure it out:
> > 
> > I want to use application (application\_django to be specific) to deploy  
> > our  
> > django project. Our source is in a subversion repository that is only  
> > accessible with a valid username/password. But I don't know how to give  
> > the  
> > username and password to the deployment process.
> > 
> > ## This is what I have so far:
> > 
> > application "ohf2" do
> > 
> > path "/srv/ohf2"  
> > owner "www-data"  
> > group "www-data"  
> > scm\_provider Chef::Provider::Subversion do
> > 
> > svn\_username "**"  
> > svn\_password "**"
> > 
> > end  
> > repository "[https://development.bcs.bcs/svn/bcspackages/trunk/monster-](https://development.bcs.bcs/svn/bcspackages/trunk/monster-)
> > 
> > master"
> > 
> > #migrate true
> > 
> > django do
> > 
> > packages ["django", "django\_extensions", "django-mptt"]  
> > debug true
> > 
> > end
> > 
> > ## end
> > 
> > ## The error it returns is:
> > 
> > ## FATAL: Errno::ENOENT: deploy\_revision[ohf2] (/var/chef/cache/cookbooks/application/providers/default.rb line 122) had an error: Errno::ENOENT: No such file or directo ry - svn info [https://development.bcs.bcs/svn/bcspackages/trunk/monster-master](https://development.bcs.bcs/svn/bcspackages/trunk/monster-master) -rHEAD
> > 
> > When I copy the url to a browser it asks for the authentication and when I  
> > enter the deployment-auth it shows the correct stuff...
> > 
> > I also tried giving svn\_username and svn\_password as parameters on the  
> > application-level but then it just complains that it doesn't know what to  
> > do with the parameters.
> > 
> > What should I do? What am I doing wrong?  
> > Should I ditch application and just rebuild the parts of  
> > application\_django  
> > that I need for my own recipe?
> 
> Are you installing svn before calling that?

Thanks, that I didn't do.

Now it fails with:  
Chef::Exceptions::Exec: deploy\_revision[ohf2]  
(/var/chef/cache/cookbooks/application/providers/default.rb line 122) had an  
error: Chef::Exceptions::Exec: returned 1, expected 0

I can provide a stacktrace if needed, but neither the stack-trace nor the  
output from chef-client tell me _which_ command returned 1 instead of 0.

Any ideas how to go on?

Arnold

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [November 15, 2012, 6:55pm UTC](https://discourse.chef.io/t/question-about-application--django/3296/4 "2012-11-15T18:55:46Z")

</div>

On Thursday, November 15, 2012 at 9:28 AM, Arnold Krille wrote:

> On Thursday 15 November 2012 08:55:13 Noah Kantrowitz wrote:
> 
> > On Nov 15, 2012, at 8:43 AM, Arnold Krille wrote:
> > 
> > > Hi all,
> > > 
> > > this is probably a beginners question but I can't figure it out:
> > > 
> > > I want to use application (application\_django to be specific) to deploy  
> > > our  
> > > django project. Our source is in a subversion repository that is only  
> > > accessible with a valid username/password. But I don't know how to give  
> > > the  
> > > username and password to the deployment process.
> > > 
> > > ## This is what I have so far:
> > > 
> > > application "ohf2" do
> > > 
> > > path "/srv/ohf2"  
> > > owner "www-data"  
> > > group "www-data"  
> > > scm\_provider Chef::Provider::Subversion do
> > > 
> > > svn\_username "**"  
> > > svn\_password "**"
> > > 
> > > end  
> > > repository "[https://development.bcs.bcs/svn/bcspackages/trunk/monster-](https://development.bcs.bcs/svn/bcspackages/trunk/monster-)
> > > 
> > > master"
> > > 
> > > #migrate true
> > > 
> > > django do
> > > 
> > > packages ["django", "django\_extensions", "django-mptt"]  
> > > debug true
> > > 
> > > end
> > > 
> > > ## end
> > > 
> > > ## The error it returns is:
> > > 
> > > ## FATAL: Errno::ENOENT: deploy\_revision[ohf2] (/var/chef/cache/cookbooks/application/providers/default.rb line 122) had an error: Errno::ENOENT: No such file or directo ry - svn info [https://development.bcs.bcs/svn/bcspackages/trunk/monster-master](https://development.bcs.bcs/svn/bcspackages/trunk/monster-master) -rHEAD
> > > 
> > > When I copy the url to a browser it asks for the authentication and when I  
> > > enter the deployment-auth it shows the correct stuff...
> > > 
> > > I also tried giving svn\_username and svn\_password as parameters on the  
> > > application-level but then it just complains that it doesn't know what to  
> > > do with the parameters.
> > > 
> > > What should I do? What am I doing wrong?  
> > > Should I ditch application and just rebuild the parts of  
> > > application\_django  
> > > that I need for my own recipe?
> > 
> > Are you installing svn before calling that?
> 
> Thanks, that I didn't do.
> 
> Now it fails with:  
> Chef::Exceptions::Exec: deploy\_revision[ohf2]  
> (/var/chef/cache/cookbooks/application/providers/default.rb line 122) had an  
> error: Chef::Exceptions::Exec: returned 1, expected 0
> 
> I can provide a stacktrace if needed, but neither the stack-trace nor the  
> output from chef-client tell me _which_ command returned 1 instead of 0.
> 
> Any ideas how to go on?
> 
> Arnold  
> Usually that error message is "$command returned X, expected 0"[0], which leads me to suspect you have a nil value for some required command.

--  
Daniel DeLeo

1. Random example from first google hit: Chef::Exceptions::Exec: apt-get -q -y install exim4=4.72-6+squeeze2 returned 100, expected 0

---

<div class="post-metadata">

**Author:** ![Arnold\_Krille](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/arnold_krille/32/285_2.png) [@Arnold\_Krille](https://discourse.chef.io/u/Arnold_Krille)\
**Post date:** [November 15, 2012, 7:30pm UTC](https://discourse.chef.io/t/question-about-application--django/3296/5 "2012-11-15T19:30:20Z")

</div>

On Thursday 15 November 2012 10:55:46 Daniel DeLeo wrote:

> Usually that error message is "$command returned X, expected 0"[0], which  
> leads me to suspect you have a nil value for some required command.

Is there a way to make chef-client log every command (as in command-line  
commands) it executes?

Arnold

---

<div class="post-metadata">

**Author:** ![dcondomitti](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/dcondomitti/32/104_2.png) [@dcondomitti](https://discourse.chef.io/u/dcondomitti)\
**Post date:** [November 15, 2012, 7:33pm UTC](https://discourse.chef.io/t/question-about-application--django/3296/6 "2012-11-15T19:33:40Z")

</div>

I usually just run in debug mode, `chef-client -ldebug`

On Thursday, November 15, 2012 at 11:30 AM, Arnold Krille wrote:

> On Thursday 15 November 2012 10:55:46 Daniel DeLeo wrote:
> 
> > Usually that error message is "$command returned X, expected 0"[0], which  
> > leads me to suspect you have a nil value for some required command.
> 
> Is there a way to make chef-client log every command (as in command-line  
> commands) it executes?
> 
> Arnold

---

<div class="post-metadata">

**Author:** ![coderanger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/coderanger/32/5_2.png) [@coderanger](https://discourse.chef.io/u/coderanger)\
**Post date:** [November 15, 2012, 7:33pm UTC](https://discourse.chef.io/t/question-about-application--django/3296/7 "2012-11-15T19:33:40Z")

</div>

On Nov 15, 2012, at 11:30 AM, Arnold Krille wrote:

> On Thursday 15 November 2012 10:55:46 Daniel DeLeo wrote:
> 
> > Usually that error message is "$command returned X, expected 0"[0], which  
> > leads me to suspect you have a nil value for some required command.
> 
> Is there a way to make chef-client log every command (as in command-line  
> commands) it executes?

"-l debug" on the command line should do that.

--Noah

---

<div class="post-metadata">

**Author:** ![Arnold\_Krille](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/arnold_krille/32/285_2.png) [@Arnold\_Krille](https://discourse.chef.io/u/Arnold_Krille)\
**Post date:** [November 15, 2012, 9:08pm UTC](https://discourse.chef.io/t/question-about-application--django/3296/8 "2012-11-15T21:08:51Z")

</div>

On Thu, 15 Nov 2012 11:33:40 -0800 Noah Kantrowitz  
[noah@coderanger.net](mailto:noah@coderanger.net) wrote:

> On Nov 15, 2012, at 11:30 AM, Arnold Krille wrote:
> 
> > Is there a way to make chef-client log every command (as in  
> > command-line commands) it executes?  
> > "-l debug" on the command line should do that.

Thanks to Noah and Daniel!

Now I see the commands, most importantly the command that failed. And  
its something I expected after thinking about it on my way home: This  
machine isn't yet trusting our own root-CA and so its not trusting our  
repository by default.  
Another thing to add into our system-essentials cookbook!

Have fun,

Arnold

---

<div class="post-metadata">

**Author:** ![Arnold\_Krille](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/arnold_krille/32/285_2.png) [@Arnold\_Krille](https://discourse.chef.io/u/Arnold_Krille)\
**Post date:** [November 16, 2012, 9:39am UTC](https://discourse.chef.io/t/question-about-application--django/3296/9 "2012-11-16T09:39:33Z")

</div>

Hi again,

## after yesterdays tips, I added our ca to the trusted CAs for the system and now its actually the user and password that is not working. Here is my current cookbook with error-messages as comments:

package “subversion”

application “ohf2” do  
path "/srv/ohf2"  
owner "www-data"  
group “www-data”  
#scm\_provider Chef::Provider::Subversion

## Doesn’t work, asks for svn-password for user www-data…

scm\_provider Chef::Provider::Subversion do  
svn\_username "deployment"  
svn\_password "\*\*\*"  
end

## FATAL: NoMethodError: undefined method `set’ for

Chef::Provider::Subversion:Class  
#scm\_provider.set[“svn\_username”] = “deployment”  
#scm\_provider.set[“svn\_password”] = "\*\*\*"  
repository “[https://development.bcs.bcs/svn/bcspackages/trunk/monster-](https://development.bcs.bcs/svn/bcspackages/trunk/monster-)  
master”

## FATAL: NoMethodError: undefined method `set’ for

Chef::Provider::Subversion:Class  
#scm\_provider.set[“svn\_username”] = “deployment”  
#scm\_provider.set[“svn\_password”] = “\*\*\*”

#migrate true

django do  
packages [“django”, “django\_extensions”, “django-mptt”, “south”]  
debug true

end

## end

How do I get the checkout to know the credentials? How do I get application to  
pass the credentials to the deploy-resource which seems to know what to do  
with svn\_username and svn\_password?

Thanks in advance,

Arnold

---

<div class="post-metadata">

**Author:** ![Andrea\_Campi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/andrea_campi/32/514_2.png) [@Andrea\_Campi](https://discourse.chef.io/u/Andrea_Campi)\
**Post date:** [November 16, 2012, 9:52am UTC](https://discourse.chef.io/t/question-about-application--django/3296/10 "2012-11-16T09:52:28Z")

</div>

SVN is not currently supported with the application cookbook, but there is  
a pull request.

You should get your cookbook from this branch:

> **[GitHub - lastobelus/chef-application at svn\_support](https://github.com/lastobelus/chef-application/tree/svn_support)**
>
> svn\_support

The commit that matters to you is

> <https://github.com/lastobelus/chef-application/commit/46094e5c9479321361c1a35df2d50f0452f444df>

On Fri, Nov 16, 2012 at 10:39 AM, Arnold Krille [arnold@arnoldarts.de](mailto:arnold@arnoldarts.de)wrote:

> Hi again,
> 
> ## after yesterdays tips, I added our ca to the trusted CAs for the system and now its actually the user and password that is not working. Here is my current cookbook with error-messages as comments:
> 
> package "subversion"
> 
> application "ohf2" do  
> path "/srv/ohf2"  
> owner "www-data"  
> group "www-data"  
> #scm\_provider Chef::Provider::Subversion
> 
> ## Doesn't work, asks for svn-password for user www-data...
> 
> scm\_provider Chef::Provider::Subversion do  
> svn\_username "deployment"  
> svn\_password "\*\*\*"  
> end
> 
> ## FATAL: NoMethodError: undefined method `set' for
> 
> Chef::Provider::Subversion:Class  
> #scm\_provider.set["svn\_username"] = "deployment"  
> #scm\_provider.set["svn\_password"] = "\*\*\*"  
> repository "[https://development.bcs.bcs/svn/bcspackages/trunk/monster-](https://development.bcs.bcs/svn/bcspackages/trunk/monster-)  
> master"
> 
> ## FATAL: NoMethodError: undefined method `set' for
> 
> Chef::Provider::Subversion:Class  
> #scm\_provider.set["svn\_username"] = "deployment"  
> #scm\_provider.set["svn\_password"] = "\*\*\*"
> 
> #migrate true
> 
> django do  
> packages ["django", "django\_extensions", "django-mptt", "south"]  
> debug true
> 
> end
> 
> ## end
> 
> How do I get the checkout to know the credentials? How do I get  
> application to  
> pass the credentials to the deploy-resource which seems to know what to do  
> with svn\_username and svn\_password?
> 
> Thanks in advance,
> 
> Arnold

---

<div class="post-metadata">

**Author:** ![Arnold\_Krille](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/arnold_krille/32/285_2.png) [@Arnold\_Krille](https://discourse.chef.io/u/Arnold_Krille)\
**Post date:** [November 16, 2012, 10:28am UTC](https://discourse.chef.io/t/question-about-application--django/3296/11 "2012-11-16T10:28:29Z")

</div>

On Friday 16 November 2012 10:52:28 Andrea Campi wrote:

> SVN is not currently supported with the application cookbook, but there is  
> a pull request.
> 
> You should get your cookbook from this branch:  
> [GitHub - lastobelus/chef-application at svn\_support](https://github.com/lastobelus/chef-application/tree/svn_support)
> 
> The commit that matters to you is  
> [add support for all deploy\_revision scm attributes · lastobelus/chef-application@46094e5 · GitHub](https://github.com/lastobelus/chef-application/commit/46094e5c9479321361c1a3)  
> 5df2d50f0452f444df

Yeah! I applied the svn-related changes to my repo and it works like charm!

Thanks,

Arnold
