OpenWrt Forum Archive

Topic: LuCi RPC not working in latest snapshot. Smth changed or is it a bug?

The content of this topic has been archived on 6 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello!
I've installed todays daily snapshot of openwrt . (4.9.2017) for TpLink 1043nd
When I retrieve RPC token, it works, example:
URL http://172.16.0.100/cgi-bin/luci/rpc/auth
Response:
std Class Object
(
    [id] => 1
    [jsonrpc] => 2.0
    [result] => 70414de0cc279dfa31ec568a2f9e6e83
)
But RPC with exec is not working:
URL: http://172.16.0.100/cgi-bin/luci/rpc/sy … 8a2f9e6e83
Posted string: {"jsonrpc": "2.0","method":"exec","params":["<path_to_file_to_execute>"],"id": 1}
And I get blank responce.
<path_to_file_to_execute> -> this file execs just fine in shell and it outputs some text.

The same procedure worked two months ago with june's daily snapshot for TP Link 4300

Is there a Luci bug or something changed in recent snapshots?

Thanks!

(Last edited by bojan.pogacar on 5 Sep 2017, 09:30)

Looks like that all RCP commands are broken?!

It went broken between
OpenWrt Designated Driver 50104 / LuCI Master (git-17.072.30062-9779d53) (Working)

and

OpenWrt Designated Driver 50107 / LuCI Master (git-17.194.28316-2224714) (NOT working any more)

How can I debug Luci RPC?

(Last edited by bojan.pogacar on 5 Sep 2017, 16:19)

I've found that the problem is that posting to URL http://172.16.0.100/cgi-bin/luci/rpc/sy … 8a2f9e6e83 returns error code 403 .

That means problems with authentication or token.

Token is 100% correct and token in upper example is calculated for every request.

Any idea?

The discussion might have continued from here.