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

GNTP/1.0 -ERROR Invalid command #39

Open
maksimr opened this issue Sep 22, 2013 · 3 comments
Open

GNTP/1.0 -ERROR Invalid command #39

maksimr opened this issue Sep 22, 2013 · 3 comments
Labels

Comments

@maksimr
Copy link

maksimr commented Sep 22, 2013

Hi!

I have problem with gol.
I try run guard with support ruby_gntp notification on remote server.

But i get error:

GNTP/1.0 -ERROR Invalid command
Error-Description: Invalid command

Sometimes, very rarely, notification PASSED to gol...
On local machine all 'ok'.

I don't know why ... maybe network latency...

Ubuntu 13.04
gol installed from Ubuntu repository

ruby code snippet:

require 'ruby_gntp'
gntp = ::GNTP.new('Guard', '127.0.0.1', '', 23053)
gntp.register({
  :notifications => [
    { :name => 'notify', :enabled => true  },
    { :name => 'failed', :enabled => true  },
    { :name => 'pending', :enabled => true  },
    { :name => 'success', :enabled => true  }
  ]
})

gntp.notify(:name => 'success', :title => 'Guard test', :text => 'This is a test')

gntp message

GNTP/1.0 REGISTER NONE
Application-Name: Guard
Origin-Machine-Name: <REMOTE-HOST-NAME>
Origin-Software-Name: ruby_gntp
Origin-Software-Version: 0.3.4
Origin-Platform-Name: Windows
Origin-Platform-Version: 0.0
Notifications-Count: 4

Notification-Name: notify
Notification-Display-Name: notify
Notification-Enabled: True

Notification-Name: failed
Notification-Display-Name: failed
Notification-Enabled: True

Notification-Name: pending
Notification-Display-Name: pending
Notification-Enabled: True

Notification-Name: success
Notification-Display-Name: success
Notification-Enabled: True

Use ssh remote forwarding:

  RemoteForward 23053 localhost:23053

nc on remote host also sometimes work sometimes not

ON REMOTE HOST

cat gntp-message | nc -v localhost 23053

Thanks!!

@maksimr
Copy link
Author

maksimr commented Sep 22, 2013

If replace here tv_sec nad tv_usec on:

.tv_sec = 1,
.tv_usec = 0,

All will be ok!

I don't know how it meets the needs of the application (performance issue) ... but for me it working fine

@mattn
Copy link
Owner

mattn commented Sep 23, 2013

What the spec of your PC? Seems too short to timeout?

@maksimr
Copy link
Author

maksimr commented Sep 23, 2013

Intel® Core™ i7-3667U CPU @ 2.00GHz × 4
Ubuntu 13.04 64-bit

use case:

H - home computer
RH - remote host

A: apt-get install growl-for-linux
A: gol &
A: ssh -R 23053:localhost:23053 RH

RH: cat registration-request.txt | nc -v localhost 23053
RH: GNTP/1.0 -ERROR Invalid command
Error-Description: Invalid command

registration-request.txt content:

GNTP/1.0 REGISTER NONE
Application-Name: Guard
Origin-Machine-Name: <REMOTE-HOST-NAME>
Origin-Software-Name: ruby_gntp
Origin-Software-Version: 0.3.4
Origin-Platform-Name: Windows
Origin-Platform-Version: 0.0
Notifications-Count: 4

Notification-Name: notify
Notification-Display-Name: notify
Notification-Enabled: True

Notification-Name: failed
Notification-Display-Name: failed
Notification-Enabled: True

Notification-Name: pending
Notification-Display-Name: pending
Notification-Enabled: True

Notification-Name: success
Notification-Display-Name: success
Notification-Enabled: True

Yes increase timeout to 1 second treat problem

@Flast Flast added the type/bug label Jun 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants