fritzy / SleekXMPP

Python 2.6+/3.1+ XMPP Library
http://groups.google.com/group/sleekxmpp-discussion
Other
1.1k stars 299 forks source link

SleekXMPP connect with my ejabberd server with some error #250

Open jiangzhx opened 11 years ago

jiangzhx commented 11 years ago

i use code from https://github.com/fritzy/SleekXMPP#the-sleekxmpp-boilerplate

anyone can give some suggestion?

DEBUG:sleekxmpp.plugins.base:Loaded Plugin: RFC 6120: Stream Feature: STARTTLS DEBUG:sleekxmpp.plugins.base:Loaded Plugin: RFC 6120: Stream Feature: Resource Binding DEBUG:sleekxmpp.plugins.base:Loaded Plugin: RFC 3920: Stream Feature: Start Session DEBUG:sleekxmpp.plugins.base:Loaded Plugin: RFC 6121: Stream Feature: Roster Versioning DEBUG:sleekxmpp.plugins.base:Loaded Plugin: RFC 6121: Stream Feature: Subscription Pre-Approval DEBUG:sleekxmpp.plugins.base:Loaded Plugin: RFC 6120: Stream Feature: SASL DEBUG:sleekxmpp.xmlstream.xmlstream:Connecting to 127.0.0.1:5222 DEBUG:sleekxmpp.thirdparty.statemachine: ==== TRANSITION disconnected -> connected DEBUG:sleekxmpp.xmlstream.xmlstream:Starting HANDLER THREAD DEBUG:sleekxmpp.xmlstream.xmlstream:Loading event runner DEBUG:sleekxmpp.xmlstream.xmlstream:SEND (IMMED): DEBUG:sleekxmpp.xmlstream.xmlstream:RECV: DEBUG:sleekxmpp.xmlstream.xmlstream:RECV: PLAIN/stream:features INFO:sleekxmpp.util.sasl.client:SASL: PLAIN: PLAIN without encryption ERROR:sleekxmpp.features.feature_mechanisms.mechanisms:No appropriate login method. DEBUG:sleekxmpp.xmlstream.xmlstream:SEND (IMMED): /stream:stream INFO:sleekxmpp.xmlstream.xmlstream:Waiting for /stream:stream from server DEBUG:sleekxmpp.xmlstream.xmlstream:End of stream recieved DEBUG:sleekxmpp.xmlstream.xmlstream:Waiting for 3 threads to exit. DEBUG:sleekxmpp.xmlstream.xmlstream:Threading deadlock prevention! DEBUG:sleekxmpp.xmlstream.xmlstream:Marked event_thread_0 thread as ended due to disconnect() call. 2 threads remain. DEBUG:sleekxmpp.xmlstream.scheduler:Quitting Scheduler thread DEBUG:sleekxmpp.xmlstream.xmlstream:Stopped scheduler thread. 1 threads remain. DEBUG:sleekxmpp.xmlstream.xmlstream:Stopped send thread. 0 threads remain. DEBUG:sleekxmpp.thirdparty.statemachine: ==== TRANSITION connected -> disconnected DEBUG:sleekxmpp.clientxmpp:Finished processing stream features. DEBUG:sleekxmpp.xmlstream.xmlstream:Finished exiting event runner thread after early termination from disconnect() call. 0 threads remain. DEBUG:sleekxmpp.thirdparty.statemachine:State was not ready

jpcaruana commented 11 years ago

can you show us your server configuration ?

legastero commented 11 years ago

This is because Sleek does not allow PLAIN authentication over an unencrypted connection, by default.

To allow it, set this before connecting and processing:

xmpp['feature_mechanisms'].unencrypted_plain = True
noodlebreak commented 8 years ago

@legastero Thanks! That was very helpful.

sudharsan23 commented 7 years ago

Hi, I am using sleekxmpp to connect and send message to ejabberd. But my xmpp connects with ejabberd with invalid namespace error. Enclosing the error below:

Send XML on stream = <<"<?xml version='1.0'?>">> 2017-04-20 19:42:36.906 [debug] <0.1846.1>@ejabberd_c2s:send_text:1802 Send XML on stream = <<"</stream:error>">>

Even i tried adding xmpp['feature_mechanisms'].unencrypted_plain = True

before connect. But still I see same error. Can you please help me out.

RameshJangama commented 6 years ago

Hi I am also receiving similar error on latest 17.11 ejabberd: any suggestion please

DEBUG    Event triggered: ssl_cert
WARNING  Could not find pyasn1 and pyasn1_modules. SSL certificate COULD NOT BE VERIFIED.
DEBUG    SEND (IMMED): <stream:stream to='ec2-34-208-168-55.us-west-2.compute.amazonaws.com' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' xml:lang='en' version='1.0'>
DEBUG    RECV: <stream:stream version="1.0" from="ec2-34-208-168-55.us-west-2.compute.amazonaws.com" id="7547766482003537921" xml:lang="en">
DEBUG    RECV: <stream:features xmlns="http://etherx.jabber.org/streams"><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>PLAIN</mechanism><mechanism>X-OAUTH2</mechanism></mechanisms><register xmlns="http://jabber.org/features/iq-register" /></stream:features>
ERROR    No appropriate login method.
DEBUG    Event triggered: no_auth
DEBUG    Event triggered: failed_auth
DEBUG    Event triggered: session_end
DEBUG    SEND (IMMED): </stream:stream>
INFO     Waiting for </stream:stream> from server
DEBUG    End of stream recieved
DEBUG    Waiting for 3 threads to exit. 
RameshJangama commented 6 years ago

Found the issue - its user/password problem in script. sorry guys. But when you see this error then please double/triple check both username and password.