You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried using the following simple ruby code on jruby-9.2.0.0 to authenticate with salesforce via Restforce(3.0.1) gem then try to subscribe to a push topic and it doesn't work and I get an error. See the steps to reproduce below with my expected behavior and actual behavior.
Note if needed I can add steps for the "Streaming API Developer Guide" part. Or maybe change to use another streaming api like twitter to make the repo more easier.
Actual:
ArgumentError: Invalid header value type
from org/ruby_http_parser/RubyHttpParser.java:478:in `header_value_type='
Notes:
If I repeat the steps above but use ruby 2.5.1 and it works fine. Would be happy to debug this but I'm still a novice for ruby. Also not sure if this is the proper place to put this bug. I'm also a novice to github.
Logger
I, [2018-08-16T19:45:39.934649 #74015] INFO -- : [Faye::Client] Initiating handshake with "https://na31.salesforce.com/cometd/36.0"
D, [2018-08-16T19:45:40.021247 #74015] DEBUG -- : [Faye::Dispatcher] Selected "long-polling" transport for https://na31.salesforce.com/cometd/36.0
D, [2018-08-16T19:45:40.034068 #74015] DEBUG -- : [Faye::Client] Passing through outgoing extensions: {"channel":"/meta/handshake","version":"1.0","supportedConnectionTypes":["in-process","websocket","long-polling"],"id":"1"}
D, [2018-08-16T19:45:40.035476 #74015] DEBUG -- : [Faye::Transport::Http] Client nil sending message to https://na31.salesforce.com/cometd/36.0 via "long-polling": {"channel":"/meta/handshake","version":"1.0","supportedConnectionTypes":["in-process","websocket","long-polling"],"id":"1"}
ArgumentError: Invalid header value type
from org/ruby_http_parser/RubyHttpParser.java:478:in `header_value_type='
Stacktrace
ArgumentError: Invalid header value type
header_value_type= at org/ruby_http_parser/RubyHttpParser.java:478
post_init at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:115
block in activate_connection at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:58
bind_connect at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/eventmachine-1.2.7-java/lib/eventmachine.rb:686
activate_connection at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:55
setup_request at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:92
post at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:8
create_request at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/faye-1.2.4/lib/faye/transport/http.rb:70
request at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/faye-1.2.4/lib/faye/transport/http.rb:15
flush at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/faye-1.2.4/lib/faye/transport/transport.rb:82
block in publish at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/faye-1.2.4/lib/faye/transport/transport.rb:68
block in add_timeout at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/faye-1.2.4/lib/faye/mixins/timeouts.rb:9
event_callback at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/eventmachine-1.2.7-java/lib/eventmachine.rb:1545
eventCallback at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/eventmachine-1.2.7-java/lib/jeventmachine.rb:105
run_machine at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/eventmachine-1.2.7-java/lib/jeventmachine.rb:124
run at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/eventmachine-1.2.7-java/lib/eventmachine.rb:195
The text was updated successfully, but these errors were encountered:
I've managed to narrow this down to an issue in http_parser.rb's Java code, and I've opened a pull request for it: tmm1/http_parser.rb#63
Unfortunately I've not managed to find a workaround using monkey-patching to amend the affected method, as it requires changing the native code which we don't have access to at runtime.
In the meantime, em-http-request continues to work on all recent MRI Ruby versions, and we also have a Node.js version of Faye, if you need an alternative way of connecting to the Salesforce API.
I've tried using the following simple ruby code on jruby-9.2.0.0 to authenticate with salesforce via Restforce(3.0.1) gem then try to subscribe to a push topic and it doesn't work and I get an error. See the steps to reproduce below with my expected behavior and actual behavior.
Note if needed I can add steps for the "Streaming API Developer Guide" part. Or maybe change to use another streaming api like twitter to make the repo more easier.
Steps to reproduce:
Expected:
{"event"=>{"createdDate"=>"2018-08-16T20:27:28.818Z", "replayId"=>41, "type"=>"created"}, "sobject"=>{"Id"=>"0013700000ZQWB9AAP", "Name"=>"asdf"}}
Actual:
ArgumentError: Invalid header value type
from org/ruby_http_parser/RubyHttpParser.java:478:in `header_value_type='
Notes:
If I repeat the steps above but use ruby 2.5.1 and it works fine. Would be happy to debug this but I'm still a novice for ruby. Also not sure if this is the proper place to put this bug. I'm also a novice to github.
Logger
I, [2018-08-16T19:45:39.934649 #74015] INFO -- : [Faye::Client] Initiating handshake with "https://na31.salesforce.com/cometd/36.0"
D, [2018-08-16T19:45:40.021247 #74015] DEBUG -- : [Faye::Dispatcher] Selected "long-polling" transport for https://na31.salesforce.com/cometd/36.0
D, [2018-08-16T19:45:40.034068 #74015] DEBUG -- : [Faye::Client] Passing through outgoing extensions: {"channel":"/meta/handshake","version":"1.0","supportedConnectionTypes":["in-process","websocket","long-polling"],"id":"1"}
D, [2018-08-16T19:45:40.035476 #74015] DEBUG -- : [Faye::Transport::Http] Client nil sending message to https://na31.salesforce.com/cometd/36.0 via "long-polling": {"channel":"/meta/handshake","version":"1.0","supportedConnectionTypes":["in-process","websocket","long-polling"],"id":"1"}
ArgumentError: Invalid header value type
from org/ruby_http_parser/RubyHttpParser.java:478:in `header_value_type='
Stacktrace
ArgumentError: Invalid header value type
header_value_type= at org/ruby_http_parser/RubyHttpParser.java:478
post_init at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:115
block in activate_connection at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:58
bind_connect at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/eventmachine-1.2.7-java/lib/eventmachine.rb:686
activate_connection at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:55
setup_request at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:92
post at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:8
create_request at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/faye-1.2.4/lib/faye/transport/http.rb:70
request at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/faye-1.2.4/lib/faye/transport/http.rb:15
flush at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/faye-1.2.4/lib/faye/transport/transport.rb:82
block in publish at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/faye-1.2.4/lib/faye/transport/transport.rb:68
block in add_timeout at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/faye-1.2.4/lib/faye/mixins/timeouts.rb:9
event_callback at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/eventmachine-1.2.7-java/lib/eventmachine.rb:1545
eventCallback at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/eventmachine-1.2.7-java/lib/jeventmachine.rb:105
run_machine at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/eventmachine-1.2.7-java/lib/jeventmachine.rb:124
run at /Users/mislam/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/eventmachine-1.2.7-java/lib/eventmachine.rb:195
The text was updated successfully, but these errors were encountered: