Skip to content

2.15.6 crash on Rails deploy at rollbar:sourcemap stage #713

@DMA57361

Description

@DMA57361

TLDR: Moving from 2.15.5 to 2.15.6 has added a new rollbar:sourcemap stage to my capistrano deploys, which crashes unless I add a rollbar_sourcemaps_minified_url_base config value (even though I have no meaningful value to set on most of our apps).

Below is relevant bit from the bundle exec cap production deploy --trace (partly anonymised):

** Invoke deploy:assets:backup_manifest (first_time)
** Execute deploy:assets:backup_manifest
00:14 deploy:assets:backup_manifest
      01 mkdir -p /var/www/projectname/releases/20180418084937/assets_manifest_backup
    ✔ 01 deploy@server.hostname.com 0.054s
      02 cp /var/www/projectname/releases/20180418084937/public/assets/.sprockets-manifest-ba1494b464b023103745788f3cd11928.json /var/www/projectname/releases/20180418084937/assets_manifest_backup
    ✔ 02 deploy@server.hostname.com 0.056s
** Invoke rollbar:sourcemap (first_time)
** Execute rollbar:sourcemap
00:14 rollbar:sourcemap
      Uploading source maps from
#<Thread:0x00000001055bf788@/Users/username/.rvm/gems/ruby-2.5.1@projectname/gems/sshkit-1.16.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
	1: from /Users/username/.rvm/gems/ruby-2.5.1@projectname/gems/sshkit-1.16.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/Users/username/.rvm/gems/ruby-2.5.1@projectname/gems/sshkit-1.16.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as deploy@server.hostname.com: undefined local variable or method `rollbar_sourcemaps_minified_url_base' for #<SSHKit::Backend::Netssh:0x00000001055bf620> (SSHKit::Runner::ExecuteError)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@server.hostname.com: undefined local variable or method `rollbar_sourcemaps_minified_url_base' for #<SSHKit::Backend::Netssh:0x00000001055bf620>
/Users/username/.rvm/gems/ruby-2.5.1@projectname/gems/sshkit-1.16.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute'
/Users/username/.rvm/gems/ruby-2.5.1@projectname/gems/sshkit-1.16.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'

Caused by:
NameError: undefined local variable or method `rollbar_sourcemaps_minified_url_base' for #<SSHKit::Backend::Netssh:0x00000001055bf620>
/Users/username/.rvm/gems/ruby-2.5.1@projectname/gems/rollbar-2.15.6/lib/rollbar/tasks/rollbar.cap:39:in `block (3 levels) in <top (required)>'
/Users/username/.rvm/gems/ruby-2.5.1@projectname/gems/sshkit-1.16.0/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
/Users/username/.rvm/gems/ruby-2.5.1@projectname/gems/sshkit-1.16.0/lib/sshkit/backends/abstract.rb:29:in `run'
/Users/username/.rvm/gems/ruby-2.5.1@projectname/gems/sshkit-1.16.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => rollbar:sourcemap
The deploy has failed with an error: Exception while executing as deploy@server.hostname.com: undefined local variable or method `rollbar_sourcemaps_minified_url_base' for #<SSHKit::Backend::Netssh:0x00000001055bf620>
** Invoke deploy:failed (first_time)
** Execute deploy:failed

Having had a glance at the top of the backtrace - https://github.com/rollbar/rollbar-gem/blob/master/lib/rollbar/tasks/rollbar.cap#L39 - it should probably just be a string, without the interpolation.

I assume setting a rollbar_sourcemaps_minified_url_base value will fix the problem, however this application (any several others of ours) has no sourcemaps and is also firewalled to be internal to our company. So I don't have a useful value to assign here.

I tested this with 3 of our applications and bundle update rollbar then bundle exec cap production deploy is enough to cause the exception.

I'm rolling back to 2.15.5 for now, but thought I'd let you know.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions