sock is None before invoking deleteSession



4 years ago
9 months ago


(Reporter: pyang, Unassigned)



Firefox Tracking Flags

(Not tracked)




4 years ago
in marionette_transport

File "/marionette_client_mozilla_b2g37_v2_2-0.1-py2.7.egg/marionette/runner/", line 751, in run_tests
     if self.capabilities['device'] != 'desktop' and self.capabilities['browserName'] == 'B2G':
marionette_client_mozilla_b2g37_v2_2-0.1-py2.7.egg/marionette/runner/", line 574, in capabilities
   File "/marionette_client_mozilla_b2g37_v2_2-0.1-py2.7.egg/marionette/", line 839, in delete_session
     response = self._send_message('deleteSession', 'ok')
   File "/marionette_client_mozilla_b2g37_v2_2-0.1-py2.7.egg/marionette/", line 36, in _
     return func(*args, **kwargs)
   File "/marionette_client_mozilla_b2g37_v2_2-0.1-py2.7.egg/marionette/", line 609, in _send_message
     response = self.client.send(message)
   File "/marionette_transport-0.4-py2.7.egg/marionette_transport/", line 96, in send
 AttributeError: 'NoneType' object has no attribute 'send'

Looks like we didn't protect when sock is set as None.

Comment 1

4 years ago
Andreas, I found bug1157273 for marionette-server, are they related?


4 years ago
Flags: needinfo?(ato)
If `self.sock` isn’t defined on calling the `send` routine in marionette_transport, we reconnect on

        if not self.sock:

The only slightly suspicious thing about is that we’re relying on the coerced boolean value of `self.sock` instead of explicitly testing for None-ness as such:

        if self.sock is not None:

I don’t think what you’re seeing is related to bug 1157273 as that is more a theoretical bug limited to the server.  It _could_ potentially manifest itself if you create and delete a session very rapidly in succession, but as I said I don’t think it’s related.

Do you have a reliable way to reproduce the error you’re seeing?  From reading the code I can’t immediately think of anything that would cause this to happen.  Perhaps some code is writing directly to’s internals and resetting `self.sock`, but that seems unlikely.
Flags: needinfo?(ato)

Comment 3

4 years ago
I triggered 5 machines yesterday and 1 of them reproduced in 2 hours.
likely an unexpected flow and it didn't trigger reconnecting.

Comment 5

4 years ago
That is rational and I saw many failures with "self.capabilities". Probably we can maintain session other than use it disposable.  
Just check new test run and haven't encountered.  

We can inject log or patch at next run, any suggestion?
Keywords: ateam-marionette-client has changed significantly since this was filed.
Last Resolved: 9 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.