Question about application(_django)


#1

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-
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
-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


#2

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-
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
-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


#3

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-

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 -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


#4

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-

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 -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

#5

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


#6

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


#7

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


#8

On Thu, 15 Nov 2012 11:33:40 -0800 Noah Kantrowitz
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


#9

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-
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


#10

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

You should get your cookbook from this branch:

The commit that matters to you is

On Fri, Nov 16, 2012 at 10:39 AM, Arnold Krille arnold@arnoldarts.dewrote:

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-
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


#11

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:
https://github.com/lastobelus/chef-application/tree/svn_support

The commit that matters to you is
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