aws / opsworks-cookbooks

Chef Cookbooks for the AWS OpsWorks Service
Other
1.05k stars 1.23k forks source link

Issue in deploying archive which uses http basic authentication #389

Open anoopknayak opened 8 years ago

anoopknayak commented 8 years ago

I have a private bitbucket repo archive which i would like to deploy. But it ends up at the following error:

ERROR: bad component(expected userinfo component or user component):

================================================================================
Recipe Compile Error in /var/lib/aws/opsworks/cache.stage2/cookbooks/deploy/recipes/rails.rb
================================================================================

URI::InvalidComponentError
--------------------------
bad component(expected userinfo component or user component): anoopknayak@gmail.com

Cookbook Trace:
---------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/scm_helper/libraries/archive.rb:9:in `prepare_archive_checkouts'
/var/lib/aws/opsworks/cache.stage2/cookbooks/deploy/definitions/opsworks_deploy.rb:32:in `block in from_file'
/var/lib/aws/opsworks/cache.stage2/cookbooks/deploy/recipes/rails.rb:28:in `block in from_file'
/var/lib/aws/opsworks/cache.stage2/cookbooks/deploy/recipes/rails.rb:3:in `each'
/var/lib/aws/opsworks/cache.stage2/cookbooks/deploy/recipes/rails.rb:3:in `from_file'

Relevant File Content:
----------------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/scm_helper/libraries/archive.rb:

2:  
3:  module OpsWorks
4:    module SCM
5:      module Archive
6:        def prepare_archive_checkouts(scm_options)
7:          unless scm_options[:user].blank? || scm_options[:password].blank?
8:            archive_url = URI.parse(scm_options[:repository])
9>>           archive_url.user = scm_options[:user]
10:            archive_url.password = scm_options[:password]
11:            archive_url = archive_url.to_s
12:          else
13:            archive_url = scm_options[:repository]
14:          end
15:  
16:          tmpdir = Dir.mktmpdir('opsworks')
17:          directory tmpdir do
18:            mode 0755

Is there any solution to above?

githuesch commented 8 years ago

Can you download your code with the same credentials outside OpsWorks?