Skip to content

Puma outputs unconvertable characters and kills readapt #12

@Antronin

Description

@Antronin

When starting puma (6.0.3.4) the following happens:

=> Booting Puma
=> Rails 6.0.3.4 application starting in development 
=> Run `rails server --help` for more startup options
[6281] Puma starting in cluster mode...
[6281] * Puma version: 5.1.0 (ruby 2.7.0-p0) ("At Your Service")
[6281] *  Min threads: 5
[6281] *  Max threads: 5
#<Thread:0x000055aa14dedcf8 /home/peter/.gem/gems/backport-1.1.2/lib/backport/client.rb:101 run> terminated with exception (report_on_exception is true):
/home/peter/.gem/gems/readapt-1.1.0/lib/readapt/output.rb:21:in `to_json': "\\xE2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
	from /home/peter/.gem/gems/readapt-1.1.0/lib/readapt/output.rb:21:in `send_event'
	from /home/peter/.gem/gems/readapt-1.1.0/lib/readapt/output.rb:8:in `receiving'
	from /home/peter/.gem/gems/backport-1.1.2/lib/backport/client.rb:63:in `tick'
	from /home/peter/.gem/gems/backport-1.1.2/lib/backport/server/stdio.rb:18:in `update'
	from /usr/lib/ruby/2.7.0/observer.rb:197:in `block in notify_observers'
	from /usr/lib/ruby/2.7.0/observer.rb:196:in `each'
	from /usr/lib/ruby/2.7.0/observer.rb:196:in `notify_observers'
	from /home/peter/.gem/gems/backport-1.1.2/lib/backport/client.rb:121:in `read_input'
	from /home/peter/.gem/gems/backport-1.1.2/lib/backport/client.rb:102:in `block in run_input_thread'

Reason for this is puma itself. In this version on puma startup it sends the following output to the console which kills readapt with the above exception:

{:type=>"event",
 :event=>"output",
 :body=>
  {:output=>
    "[6281] *  Environment: development\n" +
    "[6281] *   Master PID: 6281\n" +
    "[6281] *      Workers: 1\n" +
    "[6281] *     Restarts: (\xE2\x9C\x94) hot (\xE2\x9C\x94) phased\n" +
    "[6281] * Listening on http://127.0.0.1:3000\n" +
    "[6281] * Listening on http://[::1]:3000\n" +
    "[6281] Use Ctrl-C to stop\n",
   :category=>"stdout"}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions