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

Has Occured TypeError in STT Real-Time Recognition. #50

Closed
yuyaito opened this issue Jan 23, 2019 · 11 comments
Closed

Has Occured TypeError in STT Real-Time Recognition. #50

yuyaito opened this issue Jan 23, 2019 · 11 comments

Comments

@yuyaito
Copy link

yuyaito commented Jan 23, 2019

We discover to have occured TypeError in STT real-time recognition, and disconnect websocket connection. Error logs as below.

TypeError - [82, 73, 70, 70, 32, 64, 1, 0, 87, 65, 86, 69, 102, 109, 116, 32, 16, 0, 0, 0, 1, 0, 1, 0, 68, 172, 0, 0, 136, 88, 1, 0, 2, 0, 16, 0, 100, 97, 116, 97, 0, 64, 1, 0, 0, 0, 0, ... 0, 0, 0] is not a symbol nor a string]: 
/home/centos/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ibm_watson-0.10.0/lib/ibm_watson/websocket/speech_to_text_websocket_listener.rb:156:in `send_chunk' | /home/centos/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ibm_watson-0.10.0/lib/ibm_watson/websocket/speech_to_text_websocket_listener.rb:119:in `send_audio' | /home/centos/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ibm_watson-0.10.0/lib/ibm_watson/websocket/speech_to_text_websocket_listener.rb:136:in `block in send_audio' | /home/centos/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine' | /home/centos/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'

Please research its issue.

@mamoonraja
Copy link
Member

HI, thanks for opening the issue, we are looking into STT WebSocket related issues right now, and we are targeting patch fix by the end of next week.

@germanattanasio
Copy link
Contributor

Please provide a set of reproducible steps.

@mamoonraja
Copy link
Member

@yuyaito I am looking into WebSocket related issues, can you please provide more info on this issue as mentioned by @germanattanasio

@yuyaito
Copy link
Author

yuyaito commented Feb 4, 2019

Thank you for your confirmation.
Steps to reproduce as below.

  1. Modify ruby SDK as below.
    ibm_watson/websocket/speech_to_text_websocket_listener.rb l71
# before
EM.stop_event_loop
# after
EM.stop_event_loop if EM.present? && EM.connection_count <= 1

ibm_watson/websocket/speech_to_text_websocket_listener.rb l78

# before
EM&.reactor_thread&.join
# after
# EM&.reactor_thread&.join

ibm_watson/websocket/speech_to_text_websocket_listener.rb l158

# before
@bytes_sent += chunk.size
@client.send(chunk.bytes)
@client.send({ "action" => "stop" }.to_json) if final
@timer.cancel if @timer.respond_to?(:cancel) && final
# after
begin
  @bytes_sent += chunk.size
  @client.send(chunk.bytes)
  @client.send({ "action" => "stop" }.to_json) if final
  @timer.cancel if @timer.respond_to?(:cancel) && final
rescue => error
  Rails.logger.error("send_chunk_error: #{error.message}, #{error.backtrace_locations.inspect}")
  @callback.on_error(error: error)
end
  1. Open one or more websocket connection with Watson STT, and run real-time recognition several tens of minutes.

  2. (sorry don't know the cause) occured its typeerror.

@yuyaito
Copy link
Author

yuyaito commented Mar 5, 2019

Please answer the question about this issue.

Q1. Please tell me the progress for this issue.

Q2. Could you understand the reason of problem?

Q3. When is the release for fix this issue?

@mamoonraja
Copy link
Member

mamoonraja commented Mar 5, 2019

Hi @yuyaito, We are investigating issues related to STT WebSocket and we are planning to have a patch out by the end of this month, and we are tracking work here.

@mamoonraja
Copy link
Member

@yuyaito What's the reason behind modifying the SDK code as you mentioned in #50 (comment).

@mamoonraja mamoonraja mentioned this issue Mar 29, 2019
7 tasks
@EikiWakamatsu
Copy link

I will reply instead of Mr. yuyaito

I modified the library to allow multiple connections for Issue #39 .

#EM&.reactor_thread&.join

This error now occurs.

@mamoonraja
Copy link
Member

@EikiWakamatsu Why are you commenting the line out? Please try this example snippet.

@EikiWakamatsu
Copy link

@mamoonraja
When run according to the example, the connection was successful.
Thank you.

@mamoonraja
Copy link
Member

@EikiWakamatsu Thanks for the confirmation!

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

No branches or pull requests

4 participants