dpl icon indicating copy to clipboard operation
dpl copied to clipboard

dpl 1.9.0 s3 LoadError

Open giannoudak opened this issue 8 years ago • 4 comments

Hello,

After your latest release, our deploy stage we have in gitlab breaks deploying to s3. However yesterday ,earlier before your release, when tryed to deploy with 1.8.47 version we had no issues. Here is our out output:

Downloading artifacts for build-job (1697)...
Downloading artifacts from coordinator... ok        id=1697 responseStatus=200 OK token=3u97oi_M
$ sudo apt-get install -yqq ruby ruby-dev
$ sudo gem install dpl
Successfully installed dpl-1.9.0
Parsing documentation for dpl-1.9.0
Installing ri documentation for dpl-1.9.0
Done installing documentation for dpl after 0 seconds
1 gem installed
$ sudo dpl --skip_cleanup --provider=s3 --region=eu-central-1 --access-key-id=$AWS_ACCESS_KEY --secret-access-key=$AWS_SECRET_KEY --bucket=$AWS_BUCKET --local-dir=dist/ --upload-dir=$AWS_UPLOAD_DIR/libs --acl=public_read --detect-encoding --cache_control=max-age=86400
Installing deploy dependencies
Successfully installed dpl-s3-1.9.0
Parsing documentation for dpl-s3-1.9.0
Installing ri documentation for dpl-s3-1.9.0
Done installing documentation for dpl-s3 after 0 seconds
1 gem installed
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require': cannot load such file -- dpl/provider/s3 (LoadError)
	from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
	from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
	from /var/lib/gems/2.3.0/gems/dpl-1.9.0/lib/dpl/provider.rb:92:in `rescue in block in new'
	from /var/lib/gems/2.3.0/gems/dpl-1.9.0/lib/dpl/provider.rb:67:in `block in new'
	from /var/lib/gems/2.3.0/gems/dpl-1.9.0/lib/dpl/cli.rb:41:in `fold'
	from /var/lib/gems/2.3.0/gems/dpl-1.9.0/lib/dpl/provider.rb:66:in `new'
	from /var/lib/gems/2.3.0/gems/dpl-1.9.0/lib/dpl/cli.rb:31:in `run'
	from /var/lib/gems/2.3.0/gems/dpl-1.9.0/lib/dpl/cli.rb:7:in `run'
	from /var/lib/gems/2.3.0/gems/dpl-1.9.0/bin/dpl:5:in `<top (required)>'
	from /usr/local/bin/dpl:23:in `load'
	from /usr/local/bin/dpl:23:in `<main>'

Do you have any fixes on this? or any suggestion to solve it?

giannoudak avatar Mar 09 '18 08:03 giannoudak

I think the issue here is that we are installing the provider gem with gem install …, and your invocation with sudo is not finding the provider code. Why are you running dpl with sudo?

BanzaiMan avatar Mar 09 '18 13:03 BanzaiMan

A workaround would be to install the provider gem with sudo beforehand:

$ sudo gem install dpl dpl-s3
$ sudo dpl --provider=s3 …

BanzaiMan avatar Mar 09 '18 13:03 BanzaiMan

Ah, you are using gitlab.

BanzaiMan avatar Mar 09 '18 13:03 BanzaiMan

Install the same version of the deployment provider gem (in this case dpl-s3) as dpl with sudo gem install before you invoke sudo dpl ….

I don't know if we can overcome it. I'd probably just note in README and call it a day.

BanzaiMan avatar Mar 12 '18 21:03 BanzaiMan