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

nut-cgi Only shows Authorization Required message #25277

Open
cconde opened this issue Nov 8, 2024 · 6 comments
Open

nut-cgi Only shows Authorization Required message #25277

cconde opened this issue Nov 8, 2024 · 6 comments

Comments

@cconde
Copy link

cconde commented Nov 8, 2024

Issue template (remove lines from top till here)

Maintainer: @\neheb
Environment: UBNT_E300 (CN7030p1.2-1000-AAP) / Ubiquiti EdgeRouter 4 / OpenWrt 21.02.3 r16554-1d4dea6d4f / LuCI openwrt-21.02 branch git-23.093.57360-e98243e

Description:

After proper configuration of nut-monitor I installed nut-CGI, so I can now access my router /nut webpage, properly loading and showing stats and configuration links.

image

When accessing any of them, only a black page with "Authorization required" is shown.

image

I don't know what to do as the logs show that nut-monitor is properly connected to remote UPS (with authorization) and nut-cgi doesn't have any property for authorization.

What may be I missing?

Thanks!

@brada4
Copy link

brada4 commented Nov 10, 2024

Your device is perfectly supported by latest OpenWRT 23.05.5 , if you still encounter problems after upgrade feel free to adjust your post with supportable numbers.

@cconde
Copy link
Author

cconde commented Nov 14, 2024

After upgrading I'm getting this error when clicking on menu option:

Runtime error
Unhandled exception during request dispatching
/usr/lib/lua/luci/ucodebridge.lua:23: /usr/lib/lua/luci/model/cbi/nut_server.lua:133: attempt to call a nil value

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 148, byte 45:
  called from function [arrow function] (/usr/share/ucode/luci/dispatcher.uc:817:4)
  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:818:4)
  called from function [anonymous function] (/usr/share/ucode/luci/dispatcher.uc:1003:48)
  called from anonymous function (/www/cgi-bin/luci:39:13)

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

I tried uninstalling and reinstalling luci-app-nut (forcing files) but no luck.

Maybe it's related to a leftover, but I'd need a little guidance to ensure everything is clean before retrying.

@brada4
Copy link

brada4 commented Nov 14, 2024

Not related to initial issue, approach forums.

@cconde
Copy link
Author

cconde commented Nov 15, 2024

Approached and fixed, thanks, now on OpenWrt 23.05.5 r24106-10cc5fcd00 / LuCI openwrt-23.05 branch git-24.313.38121-76e4eca

Error is still there, I just get an Authrization Error when browsing:
http://myDevice/cgi-bin/nut/upsstats.cgi
http://myDevice/cgi-bin/nut/upsset.cgi

The UPS client seems to be working properly and connect to the remote UPS network server

@brada4
Copy link

brada4 commented Nov 15, 2024

Web log would be nice to add..

@cconde
Copy link
Author

cconde commented Nov 15, 2024

Sorry mi ignorance, the logs from the web browser?

In the console I only see the following:
http://*****/cgi-bin/nut/upsset.cgi

That's it, the only line there.

I've tried adding a basic authentication by prepending "user:pass@" but still having the same negative result.

I have to say I'm absolutley lost tryinig to understand which authorization is it referring to:

  • My user is logged to openWrt device before I open the Nut CGI (indeed I use LUCI web page link).
  • The client is logges to the UPS server.
  • There's no authentication field I can populate on the Nut CGI tab at LUCI page

Thanks

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

No branches or pull requests

2 participants