muink / luci-app-netspeedtest

LuCI Network Speed Test
MIT License
36 stars 13 forks source link

error: RPC call to uci/get failed with ubus code 6: Permission denied #3

Open droideggs opened 1 year ago

droideggs commented 1 year ago

I get this error after installing the package. i have python3-speedtest-cli installed already.

RPC call to uci/get failed with ubus code 6: Permission denied at ClassConstructor.handleCallReply (http://192.168.50.229/luci-static/resources/rpc.js?v=git-23.093.57360-e98243e:15:3)

droideggs commented 1 year ago

nvm it started working randomly. please close.

NKnusperer commented 9 months ago

Same issue using 23.05.0-rc4.

elvetemedve commented 8 months ago

It's still an issue with OpenWrt 23.05.2.

somanathb commented 7 months ago

I am using openwrt 21.02 and I have integrated the luci-app-netspeedtest, and faced the same issue. From my analysis, I found that the netspeedtest app was not found in the command output 'ubus call session list'. Due to this I was seeing the permission denied error. Further analysis into it as to why the netspeedtest was not included, I found that the ACL for luci-app-netspeedtest was providing read & write permissions for uci as below:

                "read": {
                        "file": {
                                "/etc/init.d/netspeedtest": [ "exec" ],
                                "/usr/lib/netspeedtest/speedtest": [ "exec" ],
                                "/var/speedtest_result": [ "read" ]
                        },
                        "ubus": {
                                "service" : [ "list" ]
                        },
                        "uci": [ "netspeedtest" ],
                        "uci": [ "librespeed-go" ]
                },
                "write": {
                        "uci": [ "netspeedtest" ],
                        "uci": [ "librespeed-go" ]
                }

If I made a change for UCI permissions for applications as below, and it works wonderfully. I donot see any errors in UI and all applications work properly. Hope the solution works for you as well.:

                "read": {
                        "file": {
                                "/etc/init.d/netspeedtest": [ "exec" ],
                                "/usr/lib/netspeedtest/speedtest": [ "exec" ],
                                "/var/speedtest_result": [ "read" ]
                        },
                        "ubus": {
                                "service" : [ "list" ]
                        },
                        "uci": [ "netspeedtest", "librespeed-go" ]
                },
                "write": {
                        "uci": [ "netspeedtest", "librespeed-go" ]
                }   
muink commented 7 months ago

patched 913caffcadd86f691a656ea2a257b4c403d3ef3f @somanathb