Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Exception: 'NoneType' object has no attribute 'recv'

Hi roger,

I am using client.loop_forever in a Thread
I am also using SSL, Is it odd that I'm hitting that line and not the SSL one above it?
I have gone to exiting and using my supervisor to restart

Thanks
Adam
 
Date: Mon, 9 Nov 2015 21:22:17 +0000
From: Roger Light <roger@xxxxxxxxxx>
To: General development discussions for paho project
        <paho-dev@xxxxxxxxxxx>
Subject: Re: [paho-dev] Exception: 'NoneType' object has no attribute
        'recv'
Message-ID:
        <CAH7zdyfr4Md25d2XV8=rasY8nV+w6ySnR0fEqX4v36PNNEk11g@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

Hi Adam,

The error you have suggests that your connection is dropping and that is
then causing the error in packet_read. It's a bug that that code isn't
checking self._sock first.

Are you using client.loop_forever() directly, or client.loop_start()
instead? And are you using threads?

Cheers,

Roger


On Mon, Nov 9, 2015 at 1:13 AM, Adam Mills <adam@xxxxxxxxxxxxx> wrote:

> Under certain circumstances I get the following exception in loop_forever
> I then disconnect, re-create the client and connect and again.
> However, it seems the old connection is maintained as i get the constant
> Connecting/disconnecting that is symptomatic of multiple connections with
> the same clientid
>
> Unfortunately I can't get the exception to happen locally.
> It's running on Python 2.7.3 (OpenWRT)
>
> Is there any better way to restart after this error?
>
>
> Exception: 'NoneType' object has no attribute 'recv'
>
>  self.client.loop_forever(retry_first_connection=True)
>   File "/usr/lib/python2.7/site-packages/paho/mqtt/client.py", line 1261, in loop_forever
>     rc = self.loop(timeout, max_packets)
>   File "/usr/lib/python2.7/site-packages/paho/mqtt/client.py", line 811, in loop
>     rc = self.loop_read(max_packets)
>   File "/usr/lib/python2.7/site-packages/paho/mqtt/client.py", line 1073, in loop_read
>     rc = self._packet_read()
>   File "/usr/lib/python2.7/site-packages/paho/mqtt/client.py", line 1407, in _packet_read
>     command = self._sock.recv(1)"
>
> ?
>
> _______________________________________________
> paho-dev mailing list
> paho-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/paho-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dev.eclipse.org/mailman/private/paho-dev/attachments/20151109/6f08ba06/attachment.html>

Back to the top