BLOG     |     FORUM
Welcome, Guest
Username: Password: Remember me
Issues related to installation, running, bugs, and features.
  • Page:
  • 1
  • 2

TOPIC: TRP failure in example code

Re:TRP failure in example code 12 years 1 month ago #653

Still not working.


When running hellotrp.rb, I get this message:

"Connection success"
hello.rb:16: undefined method `hello_response' for #<TRP::HelloResponse:0xb76add28> (NoMethodError)
	from /var/lib/gems/1.8/gems/trisulrp-1.4.2/lib/trisulrp/protocol.rb:78:in `get_response'
	from hello.rb:14
	from /var/lib/gems/1.8/gems/trisulrp-1.4.2/lib/trisulrp/protocol.rb:49:in `connect'
	from hello.rb:6

And this in the log: (where did the ^[[34 come from?)
^[[34mTue Mar  6 14:09:09 2012.866171 INFO  Certificate verify ok^[[m
^[[34mTue Mar  6 14:09:09 2012.866491 INFO  Certificate verify ok^[[m
^[[34mTue Mar  6 14:09:09 2012.880519 INFO  SSL/TLS Client Certificate produced creds : /C=US/ST=TN/O=
Unleash Networks/OU=Trisul Client Test Cert/CN=unleashnetworks.com/emailAddress=info@unleashnetworks.c
om^[[m
^[[34mTue Mar  6 14:09:09 2012.880573 INFO  SSL/TLS Client granted rights : Admin^[[m
^[[34mTue Mar  6 14:09:09 2012.880612 INFO  Main Service Thread : New incoming connection - spawning w
orkers^[[m
^[[32mTue Mar  6 14:09:09 2012.881237 DEBUG Service : ZIP Threshold = 100000^[[m
^[[32mTue Mar  6 14:09:09 2012.881258 DEBUG Service : Temp Folder = /tmp^[[m
^[[34mTue Mar  6 14:09:09 2012.881309 INFO  Starting TRP service thread^[[m
^[[34mTue Mar  6 14:09:09 2012.881436 INFO  TRP service thread started^[[m
^[[34mTue Mar  6 14:09:09 2012.936519 INFO  On connection Conn-XReceived HELLO REQUEST ^[[m
^[[32mTue Mar  6 14:09:09 2012.936586 DEBUG Hello request parameters  station ID = MyAutomationProg^[[
m
^[[34mTue Mar  6 14:09:09 2012.993974 INFO  SSL/TLS : Remote side closed connection^[[m
^[[34mTue Mar  6 14:09:09 2012.994082 INFO  On connection Conn-XReceived HELLO REQUEST ^[[m
^[[32mTue Mar  6 14:09:09 2012.994103 DEBUG Hello request parameters  station ID = ^[[m
^[[34mTue Mar  6 14:09:09 2012.994963 INFO  SSL/TLS : Remote side closed connection^[[m
^[[34mTue Mar  6 14:09:09 2012.995002 INFO  On connection Conn-XReceived HELLO REQUEST ^[[m
^[[32mTue Mar  6 14:09:09 2012.995020 DEBUG Hello request parameters  station ID = ^[[m
^[[34mTue Mar  6 14:09:09 2012.995731 INFO  SSL/TLS : Remote side closed connection^[[m
^[[34mTue Mar  6 14:09:09 2012.995791 INFO  On connection Conn-XReceived HELLO REQUEST ^[[m
^[[32mTue Mar  6 14:09:09 2012.995810 DEBUG Hello request parameters  station ID = ^[[m
^[[31mTue Mar  6 14:09:10 2012.000384 ERROR SSL/TLS System Write Error   5^[[m
^[[31mTue Mar  6 14:09:10 2012.000433 ERROR  TLS error:00000005:lib(0):func(0):reason(5)^[[m
^[[31mTue Mar  6 14:09:10 2012.000450 ERROR Error writing pbuf header to socket^[[m
^[[34mTue Mar  6 14:09:11 2012.882937 INFO  Waiting to accept connections from Unsniff instances^[[m

I tried topper_list.rb and got this
~/trp$ ruby topper_list.rb 192.168.1.45 12001 {C51B48D4-7876-479E-B0D9-BD9EFF03CE2E}
/var/lib/gems/1.8/gems/trisulrp-1.4.2/lib/trisulrp/protocol.rb:43:in `initialize': Connection timed out - connect(2) (Errno::ETIMEDOUT)
	from /var/lib/gems/1.8/gems/trisulrp-1.4.2/lib/trisulrp/protocol.rb:43:in `open'
	from /var/lib/gems/1.8/gems/trisulrp-1.4.2/lib/trisulrp/protocol.rb:43:in `connect'
	from topper_list.rb:17

And nothing in the log.

I also had to add this line to topper_list.rb:
include 'rubygems'

Feel free to contact me using email to speed up the resolution of these issues.
The administrator has disabled public write access.

Re:TRP failure in example code 12 years 1 month ago #654

Hi,

Thanks for the logs.

1. There was a bug in the sample code which was causing the problem.

Instead of :
p resp.hello_response.trisul_id

It should read :
p resp.trisul_id

There was an extra hello_response after resp. The code is now updated at trisul.org/docs/trp/trpgemsteps.html

It is quite a bad bug considering it appears in a getting started page. I guess the trisulrp gem was updated but we forgot to update the sample. Thanks for your patience.



2. The TRP documentation is now updated trisul.org/docs/trp/index.html - I re-checked all the samples and they worked. I had to add the following line (as you rightly pointed out) to make some of them work with Ruby 1.8
require 'rubygems' if RUBY_VERSION < '1.9'


3. And this in the log: (where did the ^[34 come from?)

That is a control character that allows the log entries to be colored. Try tail -f the log file to see the colors.

4. The topper_list.rb error ~/trp$ ruby topper_list.rb 192.168.1.45 12001 {C51B48D4-7876-479E-B0D9-BD9EFF03CE2E}
/var/lib/gems/1.8/gems/trisulrp-1.4.2/lib/trisulrp

This is due to the hostname inside the script. Change the string "trisul.org" to your IP and it should work.


Let me know if the new scripts work. We are also adding a whole bunch of new sample scripts this week.

Thanks,
Vivek R
Unleash Networks
Support : www.unleashnetworks.com/forums
The administrator has disabled public write access.

Re:TRP failure in example code 12 years 1 month ago #655

Last Edit: 12 years 1 month ago by daltonporter. Reason: accidentally posted same message
The administrator has disabled public write access.

Re:TRP failure in example code 12 years 1 month ago #656

ok, these examples work now. thanks a lot.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: vivek [unleash]
Time to create page: 0.034 seconds