Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode capistrano output messages to UTF-8 before manipulating them. #52

Merged
merged 1 commit into from
Feb 3, 2015

Conversation

byroot
Copy link
Contributor

@byroot byroot commented Oct 24, 2014

Hi, we had encoding issues with the datadog capistrano plugin:

Could not submit to Datadog: #<ArgumentError: invalid byte sequence in US-ASCII>
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/dogapi-1.9.2/lib/capistrano/datadog.rb:90:in `gsub'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/dogapi-1.9.2/lib/capistrano/datadog.rb:90:in `block in report'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/dogapi-1.9.2/lib/capistrano/datadog.rb:76:in `map'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/dogapi-1.9.2/lib/capistrano/datadog.rb:76:in `report'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/dogapi-1.9.2/lib/capistrano/datadog.rb:29:in `submit'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/dogapi-1.9.2/lib/capistrano/datadog/v2.rb:69:in `block (3 levels) in <module:Datadog>'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:89:in `execute_task'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/bundler/gems/capistrano-recipes-328e2cdeb41d/lib/capistrano_recipes/task_timer.rb:26:in `block in execute_task_with_benchmarking'
/usr/lib/shopify-ruby/2.1.0-github/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/bundler/gems/capistrano-recipes-328e2cdeb41d/lib/capistrano_recipes/task_timer.rb:25:in `execute_task_with_benchmarking'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/dogapi-1.9.2/lib/capistrano/datadog/v2.rb:25:in `block in find_and_execute_task'
/usr/lib/shopify-ruby/2.1.0-github/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/dogapi-1.9.2/lib/capistrano/datadog/v2.rb:20:in `find_and_execute_task'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/capistrano-2.15.5/lib/capistrano/callback.rb:38:in `call'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/callbacks.rb:141:in `block in trigger'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/callbacks.rb:141:in `each'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/callbacks.rb:141:in `trigger'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:35:in `execute!'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:14:in `execute'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/gems/capistrano-2.15.5/bin/cap:4:in `<top (required)>'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/bin/cap:23:in `load'
/u/apps/shipit/releases/20141023173416/data/bundler/ruby/2.1.0/bin/cap:23:in `<main

This patch does fix it for us.

Regards.

@byroot
Copy link
Contributor Author

byroot commented Jan 9, 2015

@conorbranagan @wang-arthur any chance to get this merged?

@byroot byroot force-pushed the fix-encoding-issues branch from 8fbafaa to fd44d0c Compare January 9, 2015 19:39
conorbranagan added a commit that referenced this pull request Feb 3, 2015
Encode capistrano output messages to UTF-8 before manipulating them.
@conorbranagan conorbranagan merged commit bd0da35 into DataDog:master Feb 3, 2015
@byroot
Copy link
Contributor Author

byroot commented Feb 3, 2015

Thanks!

@conorbranagan
Copy link
Contributor

Sorry for the delay on this one, it's released with 1.15.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants