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

NoneType #81

Open
jwschmo opened this issue Sep 4, 2016 · 6 comments
Open

NoneType #81

jwschmo opened this issue Sep 4, 2016 · 6 comments

Comments

@jwschmo
Copy link

jwschmo commented Sep 4, 2016

Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
File "/usr/local/lib/python2.7/dist-packages/openxc/sources/base.py", line 195, in run
File "/usr/local/lib/python2.7/dist-packages/openxc/sources/usb.py", line 72, in read
File "/usr/local/lib/python2.7/dist-packages/openxc/sources/usb.py", line 88, in _read
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'core'

@emarsman
Copy link
Member

emarsman commented Sep 6, 2016

Can you please provide more info on how this error is generated and steps to reproduce it?

@theJalden
Copy link

theJalden commented Oct 14, 2016

I've been getting the same issue. I'm running Debian with a low horse power system. Got ~248 MB of memory.

Just for the record, the results of the "Free command"

 root@OpenXC-VI-V2X-F1A4:~# free -m
              total       used       free     shared    buffers     cached
 Mem:           248         66        182          0          8         33
 -/+ buffers/cache:         23        224

I regularily get errors when executing the "openxc-control version", and "openxc-control id".

The full Errors are:

root@OpenXC-VI-V2X-F1A4:~# openxc-control id
Device ID is 0006666D53F4
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
File "/usr/local/lib/python2.7/dist-packages/openxc-0.12.0-py2.7.egg/openxc/sources/base.py", line 196, in run
File "/usr/local/lib/python2.7/dist-packages/openxc-0.12.0-py2.7.egg/openxc/sources/usb.py", line 72, in read
File "/usr/local/lib/python2.7/dist-packages/openxc-0.12.0-py2.7.egg/openxc/sources/usb.py", line 88, in _read
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'USBError'

root@OpenXC-VI-V2X-F1A4:~# openxc-control version
Device is running version 7.1.1 (default)
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
File "/usr/local/lib/python2.7/dist-packages/openxc-0.12.0-py2.7.egg/openxc/sources/base.py", line 214, in run
File "/usr/local/lib/python2.7/dist-packages/openxc-0.12.0-py2.7.egg/openxc/formats/json.py", line 19, in parse_next_message
File "/usr/local/lib/python2.7/dist-packages/openxc-0.12.0-py2.7.egg/openxc/formats/json.py", line 35, in deserialize
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'utf_8_decode'

In both cases the interpreter doesn't seem to recognize an imported module, this may be due to limited hardware, I can't replicate this issue when running from a PC.

@scarabdesign
Copy link

scarabdesign commented Apr 21, 2017

I'm also seeing these errors about 50% to 70% of the time. What's more, it sometimes only shows the first few lines of the exception before spitting me out to the shell.

dev@nuc:~$ sudo openxc-control id
Device ID is FF:FF:FF:FF:FF:FF
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_innerdev@nuc:~$ sudo openxc-control id
Device ID is FF:FF:FF:FF:FF:FF
Exception in thread Thread-1 (most likely raised during interpreter shutdown):dev@nuc:~$ sudo openxc-control id
Device ID is FF:FF:FF:FF:FF:FF
dev@nuc:~$ sudo openxc-control id
Device ID is FF:FF:FF:FF:FF:FF
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
  File "/usr/local/lib/python2.7/dist-packages/openxc/sources/base.py", line 195, in run
  File "/usr/local/lib/python2.7/dist-packages/openxc/sources/usb.py", line 72, in read
  File "/usr/local/lib/python2.7/dist-packages/openxc/sources/usb.py", line 88, in _read
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'USBError'dev@nuc:~$ sudo openxc-control id
Device ID is FF:FF:FF:FF:FF:FF
Exception in thread Thread-1 (most likely raised during interpreter shutdown):dev@nuc:~$ sudo openxc-control id
Device ID is FF:FF:FF:FF:FF:FF
Exception in thread Thread-1 (most likely raised during interpreter shutdown):dev@nuc:~$ sudo openxc-control id
Device ID is FF:FF:FF:FF:FF:FF
Exception in thread Thread-1 (most likely raised during interpreter shutdown):dev@nuc:~$ sudo openxc-control id
Device ID is FF:FF:FF:FF:FF:FF
dev@nuc:~$ 

From what I'm gathering, this seems to be the result of threads not exiting cleanly. I can't say why this would be different between platforms (it strikes me as funny that there are so few Linux OpenXC tinkerers), but Exception in thread Thread-1 (most likely raised during interpreter shutdown) is a clue. The final error at the end comes when the object being requested is no longer in memory. In both the "id" and "version" cases, it does successfully return the desired values (if I am to believe that my device id "FF:FF:FF:FF:FF:FF", but @theJalden looks to be getting a valid id).

For instance, "/usr/local/lib/python2.7/dist-packages/openxc-0.12.0-py2.7.egg/openxc/sources/usb.py", line 88 is the catching of an exception, but at this point, it seams, usb.core is turned into nothing (probably unloaded because the thread was told to exit).

The first google result for the "Exception in thread" line suggests this is improper use of the daemon threads, but I don't have enough info or knowledge to corroborate or contradict that claim. Anyway, I'll keep poking at it and come back with further info if I glean anything.

Just for reference:
Linux version 4.9.0-0.bpo.1-amd64 (debian-kernel @ lists.debian.org) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 SMP Debian 4.9.2-2~bpo8+1 (2017-01-26)

dev@nuc:~$ free -m
             total       used       free     shared    buffers     cached
Mem:         32068       1726      30341        774        163       1300
-/+ buffers/cache:        262      31805
Swap:        61041          0      61041

@emarsman
Copy link
Member

FYI, the MAC showing as all FF:FF was a bug. It is fixed in current vi-firmware master (this PR: openxc/vi-firmware#361). Not in the pre-compiled ones yet though. Working on a few other things before release.

@kylewludwig
Copy link

Additionally openxc-control version from terminal gave an error but still read out the version while I had the OpenXC Enabler open on an Android phone.

Can't read logs from data source -- stopping: ("USB device couldn't be read", USBError(60, 'Operation timed out'))
Device is running version 7.1.1 (default)

However, when I locked the screen on the phone with OpenXC Enabler still running there were additional errors reported:

Can't read logs from data source -- stopping: ("USB device couldn't be read", USBError(60, 'Operation timed out'))
Device is running version 7.1.1 (default)
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
  File "/Users/kylewludwig/openxc-python/openxc/sources/base.py", line 213, in run
  File "/Users/kylewludwig/openxc-python/openxc/formats/json.py", line 19, in parse_next_message
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'deserialize'

Here's the screenshot (same info):
image

@raphaottoni
Copy link

I have the exact same problem as @kylewludwig. Did you manage to solve it?

Every command I sent, I do get the answer, but also a "Can't read logs from data source -- stopping: ("USB device couldn't be read", USBError(60, 'Operation timed out'))"

screen shot 2017-07-14 at 4 24 45 pm

screen shot 2017-07-14 at 4 25 04 pm

I am also using a Mac and mine is with Sierra Version 10.12

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

No branches or pull requests

7 participants