Jump to content

ModuleNotFoundError lifxlan after move from PG3 to PG3x


pinlawr

Recommended Posts

Posted

Hello! I've been running the LiFX node server on my Polisy for awhile now, migrated from PG2 to PG3 a while ago. Just moved to PG3x. Now when the node server tries to start all I get is the same lines in the log over and over until I stop it.

2023-08-31 16:08:57,295 MainThread udi_interface      INFO     __init__:<module>: UDI Python Interface for Polyglot version 3 3.1.0 Starting...
2023-08-31 16:08:57,300 MainThread udi_interface      ERROR    udi_interface:write: Traceback (most recent call last):
2023-08-31 16:08:57,301 MainThread udi_interface      ERROR    udi_interface:write: File "/var/polyglot/pg3/ns/000db952cee0_12/lifx-poly.py", line 10, in <module>
2023-08-31 16:08:57,302 MainThread udi_interface      ERROR    udi_interface:write: import lifxlan
2023-08-31 16:08:57,303 MainThread udi_interface      ERROR    udi_interface:write: ModuleNotFoundError
2023-08-31 16:08:57,303 MainThread udi_interface      ERROR    udi_interface:write: :
2023-08-31 16:08:57,304 MainThread udi_interface      ERROR    udi_interface:write: No module named 'lifxlan'
2023-08-31 16:08:58,914 MainThread udi_interface      INFO     polylogger:set_basic_config: set_basic_config: enable=True level=30

I SSH'd in and manually and ran the install.sh script and it re-installed the lifxlan module. I can see "lifxlan 1.2.7" in the list when I "pip3 list".

Other potentially relevant version info:

PG3x Version 3.2.3
Frontend Version: 3.2.3
IoX Version: 5.6.4

Not sure where to go next to get the node server back up and running.

Thanks for any help!

Posted

@pinlawr You may be running into the btistring problem from awhile back. Check and see if the module that's not loading is bitstring. The version of bitstring that the LifX NS relies on is old and since no one is maintaining the NS you'll need to down rev the module being called. Here are the commands to do that.
 

sudo -u polyglot bash
pip3 uninstall bitstring
pip3 uninstall --prefix /var/polyglot/.local bitstring
pip3 install --prefix /var/polyglot/.local bitstring==3.1.9

Restart the LifX NS from the web interface and you should be good to go. I don't recall having to reboot the Polisy, but if you have problems after this I'd give that a shot before you get back to us.

  • Like 1
Posted

@Rick Kacel Sorry mate, but we need a lot more information before any help can be offered.

What platform are you on? ISY w/RPi. Polisy, or eisy, and what versions of firmware are you running? A log of the NS output would be especially nice. Please change it from INFO to DEBUG and then do a restart so we can see what is happening in more detail.

  • Like 1
Posted

No problem, I'm on EISY

PG3x Version 3.2.3,

Frontend version 3.2.3

IoX Version 5.6.4

 

The output is:

import lifxlan

ModuleNotFoundError: No module named 'lifxlan'

2023-09-04 18:46:21,434 MainThread udi_interface INFO polylogger:set_basic_config: set_basic_config: enable=True level=30

2023-09-04 18:46:22,158 MainThread udi_interface INFO __init__:<module>: UDI Python Interface for Polyglot version 3 3.1.0 Starting...

2023-09-04 18:46:22,160 MainThread udi_interface ERROR udi_interface:write: Traceback (most recent call last):

File "/var/polyglot/pg3/ns/0021b90260e8_2/lifx-poly.py", line 10, in <module>

import lifxlan

 

Repeated to infinity.

 

Thank you.

Posted

For the eisy you need to use:
You will need to use putty or something similar to access the eisy via SSH. You can log in with the user name <admin> and the password <admin>, then just copy and past the lines below one at a time and hit <enter> after each one. On the first command you will be promoted for password; use <admin> again.

sudo -u polyglot bash
pip3 uninstall bitstring
pip3 uninstall --prefix /var/polyglot/pg3/ns/0021b90260e8_2/.local bitstring
pip3 install --prefix /var/polyglot/pg3/ns/0021b90260e8_2/.local bitstring==3.1.9

Note that the directory /0021b90260e8_2/ may need to be changed for your installation of the LifX NS. Look at your Polyglot dashboard and find the LifX NS slot number; in your case slot 2, then open putty and <cd> to /var/polyglot/pg3/ns. Then type <ls> you will see a list of NS by slot number, cut and past the correct NS name into the above command lines replacing /0021b90260e8_2/ in both lines with your specific NS name. I have updated the above command for the NS listed in the output you supplied, but if something has changed you will need to verify it first.Be sure to use the correct one.

When you type <ls> you should see an output similar to the below with more or less directories depending on your particular setup. Just find the NS with a name ending with the proper slot number.

[admin@polisy /var/polyglot/pg3/ns]$ ls
000db9560fac_1  000db9560fac_11 000db9560fac_3  000db9560fac_5  000db9560fac_7  000db9560fac_9
000db9560fac_10 000db9560fac_2  000db9560fac_4  000db9560fac_6  000db9560fac_8


You will need to restart Polyglot after you install Bitstrng 3.1.9. You should then see device discovery working. If not open a ticket with UD as the problem is not Bitstring.

Posted

It seems like that should work but the last command fails with a permission message:

[polyglot@eisy /usr/home/admin]$ pip3 install --prefix /var/polyglot/pg3/ns/0021b90260e8_2/.local bitstring==3.1.9
Collecting bitstring==3.1.9
  Using cached bitstring-3.1.9-py3-none-any.whl (38 kB)
Installing collected packages: bitstring
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/var/polyglot/pg3/ns/0021b90260e8_2/.local/lib/python3.9/site-packages/bitstring.py'
Consider using the `--user` option or check the permissions.

 

But the directory exists.  The folder permissions seem to match the other node servers:

[polyglot@eisy ~/pg3/ns]$ ls
0021b90260e8_1  0021b90260e8_12 0021b90260e8_4  0021b90260e8_7
0021b90260e8_10 0021b90260e8_2  0021b90260e8_5  0021b90260e8_8
0021b90260e8_11 0021b90260e8_3  0021b90260e8_6  0021b90260e8_9
 

 

 

Posted
On 8/31/2023 at 7:26 PM, kzboray said:

@pinlawr You may be running into the btistring problem from awhile back. [...]

Sorry for the late reply, and thanks for the help. I guess I had email notifications off. I ran into this (bitstring problem) a while back when it was first a problem on my PG3 instance and used the above instructions to fix it.

Everything worked fine until the move to PG3x.

My pip3 list shows "bitstring 3.1.9", but I went ahead and tried the steps you sent just to verify and it made no difference. I'm still getting the same "no module named 'lifxlan'" error, even with pip3 list showing that "lifxlan 1.2.7" is installed.

I'll go open a ticket.

Posted

The issue has been resolved!  Apparently, I was missing some developer packages that cause this to fail so I installed then through admin console. Side note:

I originally reinstalled the Lifx node server because the group commands weren't working.  Going through this process, I discovered the issue has to do with the tile nodes listed in my devlist.yml file  It seems an update has broken Lifx tile support.  I have no idea when it broke since I usually don't have the Lifx tile online. I couldn't really make too much sense of what was in the error log but if anyone wants to take a crack at it here is the output:

2023-09-06 15:56:32,010 Thread-3   udi_interface      ERROR    udi_interface:write: Exception in thread
2023-09-06 15:56:32,010 Thread-3   udi_interface      ERROR    udi_interface:write: Thread-3
2023-09-06 15:56:32,010 Thread-3   udi_interface      ERROR    udi_interface:write: :
2023-09-06 15:56:32,011 Thread-3   udi_interface      ERROR    udi_interface:write: Traceback (most recent call last):
2023-09-06 15:56:32,011 Thread-3   udi_interface      ERROR    udi_interface:write: File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner
2023-09-06 15:56:32,011 Thread-3   udi_interface      ERROR    udi_interface:write: self.run()
2023-09-06 15:56:32,011 Thread-3   udi_interface      ERROR    udi_interface:write: File "/usr/local/lib/python3.9/threading.py", line 917, in run
2023-09-06 15:56:32,012 Thread-3   udi_interface      ERROR    udi_interface:write: self._target(*self._args, **self._kwargs)
2023-09-06 15:56:32,012 Thread-3   udi_interface      ERROR    udi_interface:write: File "/var/polyglot/pg3/ns/0021b90260e8_2/lifx-poly.py", line 200, in _discovery_process
2023-09-06 15:56:32,012 Thread-3   udi_interface      ERROR    udi_interface:write: if self._manual_discovery():
2023-09-06 15:56:32,012 Thread-3   udi_interface      ERROR    udi_interface:write: File "/var/polyglot/pg3/ns/0021b90260e8_2/lifx-poly.py", line 162, in _manual_discovery
2023-09-06 15:56:32,013 Thread-3   udi_interface      ERROR    udi_interface:write: d = lifxlan.TileChain(mac, ip)
2023-09-06 15:56:32,013 Thread-3   udi_interface      ERROR    udi_interface:write: File "/var/polyglot/pg3/ns/0021b90260e8_2/.local/lib/python3.9/site-packages/lifxlan/tilechain.py", line 15, in __init__
2023-09-06 15:56:32,013 Thread-3   udi_interface      ERROR    udi_interface:write: self.get_tile_info()
2023-09-06 15:56:32,013 Thread-3   udi_interface      ERROR    udi_interface:write: File "/var/polyglot/pg3/ns/0021b90260e8_2/.local/lib/python3.9/site-packages/lifxlan/tilechain.py", line 22, in get_tile_info
2023-09-06 15:56:32,013 Thread-3   udi_interface      ERROR    udi_interface:write: response = self.req_with_resp(GetDeviceChain, StateDeviceChain)
2023-09-06 15:56:32,013 Thread-3   udi_interface      ERROR    udi_interface:write: File "/var/polyglot/pg3/ns/0021b90260e8_2/.local/lib/python3.9/site-packages/lifxlan/device.py", line 560, in req_with_resp
2023-09-06 15:56:32,014 Thread-3   udi_interface      ERROR    udi_interface:write: raise WorkflowException("WorkflowException: Did not receive {} from {} (Name: {}) in response to {}".format(str(response_type), str(self.mac_addr), str(self.label), str(msg_type)))
2023-09-06 15:56:32,014 Thread-3   udi_interface      ERROR    udi_interface:write: lifxlan.errors
2023-09-06 15:56:32,014 Thread-3   udi_interface      ERROR    udi_interface:write: .
2023-09-06 15:56:32,014 Thread-3   udi_interface      ERROR    udi_interface:write: WorkflowException
2023-09-06 15:56:32,014 Thread-3   udi_interface      ERROR    udi_interface:write: :
2023-09-06 15:56:32,014 Thread-3   udi_interface      ERROR    udi_interface:write: WorkflowException: Did not receive [<class 'lifxlan.msgtypes.StateDeviceChain'>] from d0:73:d5:41:c7:a8 (Name: None) in response to <class 'lifxlan.msgtypes.GetDeviceChain'>
 

Posted

@pinlawr Based upon @Rick Kacel post above, you might open AC go to <Config><System> and click <Install Dev Packages>. This can take quite some time as I recall. Up to 20 minutes so wait patiently for your Polisy to beep five times and then reboot followed by a single beep. If that fails I'd go ahead and open a support ticket with UD support. They will need to take a look at whats going on.

 

  • Like 1
Posted

Mine did not install correctly the first time. You may have to hit it twice. I did not have to downgrade the bitstream afterwards.  It seems to run fine on 4.x as long as you don't have tiles in your devlist file.

  • Like 1
  • 4 weeks later...
Posted

I Updated to 2.1.26 and this node server will not connect to my eisy.  And tried a few more times.  Status is consistently disconnected.  Any thoughts?

Hers is my log snipet - Seems to be missing a module

ModuleNotFoundError: No module named 'lifxlan'
2023-10-01 19:21:27,886 MainThread udi_interface      INFO     polylogger:set_basic_config: set_basic_config: enable=True level=30
2023-10-01 19:21:27,886 MainThread udi_interface      INFO     __init__:<module>: UDI interface initializing
2023-10-01 19:21:27,886 MainThread udi_interface      INFO     __init__:<module>: User=0021b9026256_3
2023-10-01 19:21:27,887 MainThread udi_interface      INFO     __init__:<module>: Home=/var/polyglot/pg3/ns/0021b9026256_3
2023-10-01 19:21:27,887 MainThread udi_interface      INFO     __init__:<module>: Node Server Path=/var/polyglot/pg3/ns/0021b9026256_3
2023-10-01 19:21:27,887 MainThread udi_interface      INFO     __init__:<module>: PG3INIT=eyJ1dWlkIjoiMDA6MjE6Yjk6MDI6NjI6NTYiLCJwcm9maWxlTnVtIjozLCJsb2dMZXZlbCI6IklORk8iLCJ0b2tlbiI6IjdteCttaGV5TGxvdXMpJSgiLCJtcXR0SG9zdCI6ImxvY2FsaG9zdCIsIm1xdHRQb3J0Ijo4ODgzLCJzZWN1cmUiOjEsImlzUEczeCI6dHJ1ZSwicGczVmVyc2lvbiI6IjMuMi44IiwiaXN5VmVyc2lvbiI6IjUuNy4wIiwiZWRpdGlvbiI6IkZyZWUifQ==
2023-10-01 19:21:27,887 MainThread udi_interface      INFO     __init__:<module>: Loading interface module
2023-10-01 19:21:27,936 MainThread udi_interface      INFO     interface:<module>: Loading MQTT module
2023-10-01 19:21:28,384 MainThread udi_interface      INFO     interface:<module>: MQTT module loaded
2023-10-01 19:21:28,612 MainThread udi_interface      INFO     __init__:<module>: Loading udi_interface module
2023-10-01 19:21:28,613 MainThread udi_interface      INFO     __init__:<module>: Loading node module
2023-10-01 19:21:28,613 MainThread udi_interface      INFO     __init__:<module>: Loading custom module
2023-10-01 19:21:28,613 MainThread udi_interface      INFO     __init__:<module>: Loading isy module
2023-10-01 19:21:28,613 MainThread udi_interface      INFO     __init__:<module>: UDI interface initialized
2023-10-01 19:21:28,613 MainThread udi_interface      INFO     __init__:<module>: UDI Python Interface for Polyglot version 3 3.2.2 Starting...
2023-10-01 19:21:28,615 MainThread udi_interface      ERROR    udi_interface:write: Traceback (most recent call last):
  File "/var/polyglot/pg3/ns/0021b9026256_3/lifx-poly.py", line 10, in <module>
    import lifxlan
ModuleNotFoundError: No module named 'lifxlan'
 
Guest
This topic is now closed to further replies.

×
×
  • Create New...