question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

luci-base: LuCI is not detecting properly sysauth.htm in 3rd party theme and uses default sysauth.ut.

See original GitHub issue

Steps to reproduce:

  1. On a fresh snapshot (it works in the last official release, but not in the snapshots), install 3rd party luci-theme-argon package by downloading the packages from that repo or using CLI:
opkg update
opkg install luci-compat
opkg install luci-lib-ipkg
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.2.9.4/luci-theme-argon-master_2.2.9.4_all.ipk
opkg install luci-theme-argon*.ipk
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.2.9/luci-app-argon-config_0.9-20210309_all.ipk
opkg install luci-app-argon-config*.ipk
  1. In OpenWrt, go to System > System > Language and Style and select the Argon design.
  2. Logout OpenWrt to return to the login page

Actual behavior:

For some reason, LuCI is executing /usr/share/ucode/luci/template/sysauth.ut instead of /usr/lib/lua/luci/view/themes/argon/sysauth.htm. However, it renders properly the htm headers and the footers provided in the theme, so it seems that the issue only affects the sysauth detection.

image

Expected behavior:

LuCI should render the provided sysauth.htm file /usr/lib/lua/luci/view/themes/argon/sysauth.htm. This is the current behavior in the official release (only fails in the snapshot):

image

Additional Information:

OpenWrt version information from system /etc/openwrt_release

DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r21314-1996d600bd'
DISTRIB_TARGET='mediatek/mt7622'
DISTRIB_ARCH='aarch64_cortex-a53'
DISTRIB_DESCRIPTION='OpenWrt SNAPSHOT r21314-1996d600bd'
DISTRIB_TAINTS='no-all busybox'

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jow-commented, Nov 20, 2022

This actually is a kind of bug in the Argon theme itself. The shipped sysauth.htm is rendered but throws a runtime exception, which causes LuCI to fall back to it’s builtin sysauth.htm.

The issue is within this line:

https://github.com/jerrykuku/luci-theme-argon/blob/master/luasrc/view/themes/argon/sysauth.htm#L132

On 22.03, the global node variable is not defined which causes the ( (node and node.title) and ' - ' .. translate(node.title) or '')) part to be skipped. On master, node is defined and referring to the dispatcher’s node() function, leading to a Lua attempt to index a function value exception due to the node.title expression. After removing the extraneous code which has never been rendered anyway, the theme appears to function normally.

0reactions
okibcncommented, Nov 22, 2022

@jow-

I flashed the new snapshot build r21335-e410833bdd, using the same Argon theme. Now, the login page loads properly, but it can’t access the rest of the site. it returns the following error:

image

Runtime error
Unhandled exception during request dispatching
/usr/lib/lua/luci/ucodebridge.lua:23: /usr/lib/lua/luci/template.lua:158: Failed to load template 'admin_status/index'.
Error while parsing template '/usr/lib/lua/luci/view/admin_status/index.htm':
No such file or directory

In error(), file [C]
called from function [anonymous function] (/usr/lib/lua/luci/ucodebridge.lua:23)
called from function ((tail call))
In [anonymous function](), file /usr/share/ucode/luci/runtime.uc, line 138, byte 45:
  called from function [arrow function] (/usr/share/ucode/luci/dispatcher.uc:778:70)
  called from function render ([C])
  called from function render_action (/usr/share/ucode/luci/dispatcher.uc:768:24)
  called from function run_action (/usr/share/ucode/luci/dispatcher.uc:779:4)
  called from function [anonymous function] (/usr/share/ucode/luci/dispatcher.uc:993:48)
  called from anonymous function (/www/cgi-bin/luci:39:12)

 `        return lcall.call(modname, method, ...args);`
  Near here ----------------------------------------^

It seems the file index.htm is not there. The only file in that folder is luaindex.htm

$ ls /usr/lib/lua/luci/view/admin_status
luaindex.htm

I don’t know if this is related to the same issue. Should I report it as a new issue or just continue here?

I answer myself, I see there is already a new issue #6111 about this. Never mind.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Latest Luci changes affecting a lot of legacy 3rd party themes
Any idea on how to use lua script in the sysauth.ut file, A way to restore previous capability, or any other creative solution...
Read more >
luci-theme-openwrt-2020 theme question · Issue #6118 - GitHub
The login page in the upper right corner is displayed as follows: Click in and the following error is displayed: A fallback is...
Read more >
2m-subdomains.txt - Index of /
... mm openerp htdocs ld db linux 3rdparty css html apps Example linux-3 project ... DD-s-Dictionary parsing sys-auth azure-mgmt-network learnWeb BaiduMap ...
Read more >
restore luci? : r/openwrt - Reddit
A runtime error occurred: /usr/lib/lua/luci/template.lua:97: Failed to execute template 'themes/bootstrap/header'.
Read more >
Class: LuCI
New view code should use 'require dom'; to request the LuCI.dom class. Deprecated. Yes. env. The env object holds environment ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found