Trouble installing openLUUP

Hello,

Finally I took the plunge and installed openLUUP.

I’ve run into a problem, though.
I’m running Debian 4.9.88-1 and installed the required prerequisites (lua5.1, lua-socket, lua-filesystem and lua-sec).
I’ve added an user and installed into ~/cmh-ludl.

vera@debian:~/cmh-ludl$ lua5.1 openLuup_install.lua 
openLuup_install   2017.03.28   @akbooer
getting latest openLuup version tar file from GitHub...
un-zipping download files...
getting dkjson.lua...
creating required files and folders
initialising...
downloading and installing AltUI...
Tue May  8 00:06:11 2018	device 3 'Alternate UI' requesting reload
openLuup downloaded, installed, and running...
visit http://172.20.1.70:3480 to start using the system
vera@debian:~/cmh-ludl$ Tue May  8 00:06:11 2018	device 2 '    openLuup' requesting reload

Now, when I access http://172.20.1.70:3480, it redirects to http://172.20.1.70:3480/data_request?id=lr_ALTUI_Handler&command=home# and I get the following error:

error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)

Anyone knows what to do?

Thanks in advance!

Looking at the code (or some version of it), suggests you are missing a json decoder.

The code at the start does this:

local json = require("dkjson") if (type(json) == "string") then luup.log("ALTUI warning dkjson missing, falling back to L_ALTUIjson", 2) json = require("L_ALTUIjson") end

Note I’m just guessing here but see if the json files exist.

Hi a-lurker,

I’ve checked and the L_ALTUIjson.lua file is there.
Might there be some other dependencies I’m missing? Or is there another way to debug this?

you need a file called dkjson.lua… your log says it got it. You may want to check that.

Do you see any errors or warnings in your LuaUPnP.log and the startup logs for openLuup?

Also, can you go to http://172.20.1.70:3480/console ? You should be able to view the logs there.

Thanks for all the help.

I’ve done the following:

  • installed the lua-dkjson and lua-json Debian packages

Accessing /console works.
Accessing / still gives me the same error.

The log files say this:

LuaUPnP_startup.log:

vera@debian:~/cmh-ludl/logs$ cat LuaUPnP_startup.log
2018-05-10 10:59:15.624   :: openLuup STARTUP :: /home/vera/cmh-ludl
2018-05-10 10:59:15.624   openLuup.init::        version 2018.03.21  @akbooer
2018-05-10 10:59:15.630   openLuup.scheduler::   version 2018.03.21  @akbooer
2018-05-10 10:59:15.632   openLuup.wsapi::       version 2017.01.12  @akbooer
2018-05-10 10:59:15.632   openLuup.servlet::     version 2018.02.22  @akbooer
2018-05-10 10:59:15.632   openLuup.server::      version 2018.03.22  @akbooer
2018-05-10 10:59:15.633   openLuup.rooms::       version 2016.06.23  @akbooer
2018-05-10 10:59:15.634   openLuup.scenes::      version 2018.02.19  @akbooer
2018-05-10 10:59:15.635   openLuup.chdev::       version 2018.03.18  @akbooer
2018-05-10 10:59:15.635   openLuup.userdata::    version 2018.03.02  @akbooer
2018-05-10 10:59:15.635   openLuup.requests::    version 2018.02.18  @akbooer
2018-05-10 10:59:15.635   openLuup.gateway::     version 2018.03.05  @akbooer
2018-05-10 10:59:15.636   openLuup.smtp::        version 2018.03.20  @akbooer
2018-05-10 10:59:15.636   openLuup.io::          version 2018.03.22  @akbooer
2018-05-10 10:59:15.637   openLuup.luup::        version 2018.03.22  @akbooer
2018-05-10 10:59:15.637   luup.create_device:: [1] D_ZWaveNetwork.xml /  / 
2018-05-10 10:59:15.639   luup.create_device:: [2] D_openLuup.xml / I_openLuup.xml / D_openLuup.json
2018-05-10 10:59:15.639   openLuup.init:: loading configuration user_data.json
2018-05-10 10:59:15.639   openLuup.userdata:: loading user_data json...
2018-05-10 10:59:15.642   openLuup.userdata:: loading rooms...
2018-05-10 10:59:15.642   openLuup.userdata:: ...room loading completed
2018-05-10 10:59:15.642   openLuup.userdata:: loading devices...
2018-05-10 10:59:15.642   luup.create_device:: [1] D_ZWaveNetwork.xml /  / 
2018-05-10 10:59:15.653   luup.create_device:: [3] D_ALTUI.xml / I_ALTUI.xml / D_ALTUI_UI7.json
2018-05-10 10:59:15.654   luup.create_device:: [4] D_AltAppStore.xml / I_AltAppStore.xml / D_AltAppStore.json
2018-05-10 10:59:15.654   openLuup.userdata:: loading scenes...
2018-05-10 10:59:15.654   openLuup.userdata:: number of scenes = 0
2018-05-10 10:59:15.654   openLuup.userdata:: ...scene loading completed
2018-05-10 10:59:15.654   openLuup.userdata:: loading installed plugin info...
2018-05-10 10:59:15.654   openLuup.userdata:: [openLuup] openLuup (18.3.23)
2018-05-10 10:59:15.654   openLuup.userdata:: [8246] Alternate UI (GitHub.master)
2018-05-10 10:59:15.654   openLuup.userdata:: [AltAppStore] Alternate App Store (18.2.27)
2018-05-10 10:59:15.654   openLuup.userdata:: [VeraBridge] VeraBridge (not.installed)
2018-05-10 10:59:15.654   openLuup.userdata:: [Z-Way] Z-Way (not.installed)
2018-05-10 10:59:15.654   openLuup.userdata:: [Arduino] MySensors (not.installed)
2018-05-10 10:59:15.654   openLuup.userdata:: [8211] DataYours (not.installed)
2018-05-10 10:59:15.654   openLuup.userdata:: ...user_data loading completed
2018-05-10 10:59:15.654   openLuup.init:: running _openLuup_STARTUP_
2018-05-10 10:59:15.655   luup_log:0: startup code completed
2018-05-10 10:59:15.655   openLuup.init:: init phase completed
2018-05-10 10:59:15.655   :: openLuup LOG ROTATION :: (runtime 0.0 days) 

So that seems alright.

LuaUPnP.log still gives me the same error:

2018-05-10 10:59:36.694   openLuup.server:: new client connection from 172.20.1.100: tcp{client}: 0x557b036c14a8
2018-05-10 10:59:36.694   openLuup.server:: GET / HTTP/1.1 tcp{client}: 0x557b036c14a8
2018-05-10 10:59:36.695   openLuup.server:: request completed (194 bytes, 1 chunks, 0 ms) tcp{client}: 0x557b036c14a8
2018-05-10 10:59:36.905   openLuup.server:: GET /data_request?id=lr_ALTUI_Handler&command=home HTTP/1.1 tcp{client}: 0x557b036c14a8
2018-05-10 10:59:36.905   openLuup.context_switch::  ERROR: [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)
2018-05-10 10:59:36.905   openLuup.servlet:: error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)
2018-05-10 10:59:36.905   openLuup.server:: request completed (222 bytes, 0 chunks, 0 ms) tcp{client}: 0x557b036c14a8

So it seems there is trouble loading AltUI?
I’m going to dig deeper into the source files of AltUI to find out what reference it is missing.

check your ALTUI_SERVICE / “PluginConfig” variable
it must be perfect JSON, otherwise you can get this error

2018-05-10 10:59:36.905   openLuup.servlet:: error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)

Hi amg0,

Thank you.
How do I check the variable?

I think it’s weird because this is a complete clean install (new Debian install and new openLUUP install). No one else has this problem?

[quote=“bruring, post:8, topic:199120”]Hi amg0,

Thank you.
How do I check the variable?

I think it’s weird because this is a complete clean install (new Debian install and new openLUUP install). No one else has this problem?[/quote]

I think on openluup there are visible in the user_data file are not they ? you may need to check with openluup experts.
the failure in your log file indicates we get a nil value for tbl which can only come from a corrupted PluginConfig variable or a json decode which is not working fine

local result = luup.variable_get(ALTUI_SERVICE, "PluginConfig", deviceID) local tbl = json.decode(result)

I still can’t figure it out :frowning:

Could it have to do with this: http://forum.micasaverde.com/index.php/topic,50352.0.html ?

Maybe I should try manually installing through git?

You should check your openSSL version: http://forum.micasaverde.com/index.php/topic,38102.msg352456.html#msg352456

Also try reinstalling AltUI: http://openLuupIP:3480/data_request?id=altui - check the logs during this time to make sure it is fully installed (replace ‘openLuupIP’ appropriately).

Make sure the /tmp/AltAppStore has correct permissions: sudo chmod a+w /tmp sudo chmod a+w /tmp/AltAppStore

Not sure if any of this will help, but maybe it gives you a lead.

I’m having the same problem – fresh openLuup install on a fresh RedHat/Centos 7.5 system. Currently running it as root, so permissions shouldn’t be an issue. Here’s the end of the log output after reinstalling AltUI:

2018-05-16 14:42:57.205 luup.variable_set:: 4.urn:upnp-org:serviceId:altui1.DisplayLine2 was: Alternate UI 100% now: Alternate UI 100% #hooks:0 2018-05-16 14:42:57.205 luup_log:4: AltAppStore : updating icons in icons/ ... 2018-05-16 14:42:57.205 luup_log:4: AltAppStore : updating device files in ./ ... 2018-05-16 14:42:57.236 luup_log:4: AltAppStore : ... 2 icon files 2018-05-16 14:42:57.236 luup_log:4: AltAppStore : ... 30 device files 2018-05-16 14:42:57.236 luup_log:4: AltAppStore : Alternate UI update completed 2018-05-16 14:42:57.236 openLuup.luup:: device 4 'Alternate App Store' requesting reload 2018-05-16 14:42:57.236 luup.reload:: saving user_data 2018-05-16 14:42:57.244 openLuup.luup:: exiting with code 42 - after 0.0 hours

And do you also see this in the log after it restarts when you try to access AltUI?

2018-05-10 10:59:36.905 openLuup.context_switch:: ERROR: [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value) 2018-05-10 10:59:36.905 openLuup.servlet:: error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)

Almost, but a different line number:

2018-05-16 16:32:36.798 openLuup.server:: GET /data_request?id=lr_ALTUI_Handler&command=home HTTP/1.1 tcp{client}: 0x272c6f8 2018-05-16 16:32:36.799 openLuup.context_switch:: ERROR: [string "L_ALTUI.lua"]:2306: attempt to index local 'tbl' (a nil value) 2018-05-16 16:32:36.799 openLuup.servlet:: error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2306: attempt to index local 'tbl' (a nil value)

Can you try this:http://openLuupIP:3480/data_request?id=status&output_format=xml&DeviceNum=3replace the 3 with your AltUI device ID. If you are not sure, try them consecutively from 2. One of them should give you the full variable set for AltUI. Then look for the PluginConfig that amg0 mentions above. Or take a look directly at the user_data.json to find that variable. The theory is that it isn’t set correctly for some reason.

It’s there, but empty:

"id":7, "service":"urn:upnp-org:serviceId:altui1", "value":"", "variable":"PluginConfig"

What should it be?

Edit: and how do I change it, if need be?

It has to be valid JSON, but perhaps it can be minimal: “{}”.

You can edit it by stopping openLuup, edit the file (save a copy first!), then start up openLuup.

The bigger question that I’m worried about is why didn’t this get set properly initially and what problems will you hit after this? I’m worried that there are other issues because something went wrong earlier. But I don’t know what that it is, so maybe try this and see what you hit next…

I’m not familiar with the initial installation flow in openLuup with AltUI.

That seems to have done it! System is up and running, and I haven’t gotten any more errors (although I can’t get the bridge plugin to clone my vera, but that’s an issue for another thread). Thanks for your help!

amg0, any idea why this isn’t set? Looks like getDefaultConfig didn’t get called? Something went wrong in initialization of AltUI.

No . I ll have a look but it should be fine now.
To be sure flaquito can you share the whole device variable list and values ( same http call as you used earlier )