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

undefined method `to_sym' for 5:Integer (NoMethodError) when unauthorised #28

Open
rgaufman opened this issue Apr 28, 2018 · 3 comments

Comments

@rgaufman
Copy link

I added this to my mosquitto broker config:

password_file /etc/mosquitto/passwd
allow_anonymous false

When I try to connect with paho without supplying a password, I get:

Traceback (most recent call last):
	5: from ./bin/publisher-main.rb:9:in `<main>'
	4: from /usr/local/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.7/lib/paho_mqtt/client.rb:113:in `connect'
	3: from /usr/local/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.7/lib/paho_mqtt/connection_helper.rb:43:in `do_connect'
	2: from /usr/local/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.7/lib/paho_mqtt/handler.rb:45:in `receive_packet'
	1: from /usr/local/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.7/lib/paho_mqtt/handler.rb:88:in `handle_connack'
/usr/local/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.7/lib/paho_mqtt/handler.rb:181:in `handle_connack_error': undefined method `to_sym' for 5:Integer (NoMethodError)
Did you mean?  to_s

There should maybe be a more graceful and descriptive error?

@p-goudet
Copy link
Contributor

Could you confirm that this issue has been fixed as well?

@rgaufman
Copy link
Author

Thank you for the update! - I'm not sure if this is related, but getting this:

Traceback (most recent call last):
	4: from test-paho.rb:40:in `<main>'
	3: from /usr/local/lib/ruby/gems/2.5.0/bundler/gems/paho.mqtt.ruby-4a121dd03a69/lib/paho_mqtt/client.rb:118:in `connect'
	2: from /usr/local/lib/ruby/gems/2.5.0/bundler/gems/paho.mqtt.ruby-4a121dd03a69/lib/paho_mqtt/connection_helper.rb:43:in `do_connect'
	1: from /usr/local/lib/ruby/gems/2.5.0/bundler/gems/paho.mqtt.ruby-4a121dd03a69/lib/paho_mqtt/handler.rb:45:in `receive_packet'
/usr/local/lib/ruby/gems/2.5.0/bundler/gems/paho.mqtt.ruby-4a121dd03a69/lib/paho_mqtt/handler.rb:89:in `handle_connack': uninitialized constant PahoMqtt::Handler::MQTT_CS_DISCONNECTED (NameError)
Did you mean?  PahoMqtt::MQTT_CS_CONNECTED
               PahoMqtt::MQTT_CS_DISCONNECT

@p-goudet
Copy link
Contributor

Um, I think there is typo there. I will fix soon.

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

No branches or pull requests

2 participants