VuCI example app won’t persist UCI config via ubus on RUT906 (RUT9M SDK 7.18.3)

Hello,

I am working with the RUT9M v7.18.3 SDK on a RUT906 running stock firmware RUT9M_R_00.07.18.3. I copied the sample VuCI packages from vuci-examples/README, built them, and installed both vuci-app-example-api and vuci-app-example-ui on the router via opkg over SSH.

The web UI shows up under Services → Example, but saving any field ends with a “Failed to edit configuration” error.

To troubleshoot I tried the API directly:

root@RUT906:~# ubus call api post ‘{“path”:“/example_c/config”,“body”:{“data”:{“id”:“demo01”,“text”:“hello_world”,“bool”:“1”,“select”:“first”}}}’
{
“http_body”: {
“success”: true,
“data”: {
“bool”: “1”,
“.type”: “example”,
“id”: “demo01”,
“text”: “hello_world”,
“test”: “default-value-demo01”,
“select”: “first”
}
},
“http_code”: 201
}

But reading back immediately after shows an empty dataset and /etc/config/example stays empty:

root@RUT906:~# ubus call api get ‘{“path”:“/example_c/config”}’
{
“http_body”: { “success”: true, “data”: },
“http_code”: 200
}

root@RUT906:~# cat /etc/config/example
root@RUT906:~#

For comparison, the built-in event_juggler app works as expected using the same flow:

root@RUT906:~# ubus call api post ‘{“path”:“/event_juggler/events/config”,“body”:{“data”:{“name”:“cli_io”,“plugin”:“io”,“enabled”:“1”,“wait”:“0”,“io_name”:“din1”,“io_trigger”:“falling”}}}’
… http_code 201 …

root@RUT906:~# ubus call api get ‘{“path”:“/event_juggler/events/config”}’
… shows the newly created config …
root@RUT906:~# cat /etc/config/event_juggler
… contains the config …

So the ubus framework, rpcd, and UCI all seem fine. Only the sample example app refuses to write anything. Has anyone hit the same issue?

Is there an extra step needed to hook the example service into rpcd (ACLs, path regeneration, etc.) when installing it manually from the SDK?

Thanks ! Ludovic

Hello,

Could you please check whether the configuration file of your custom package includes both read and write permissions? If not, please try including both of them and retry the API request to see if it saves the changes.

To check file permissions you can use this command: ls -l <config_file_path>

Regards,
M.

Hello Matas,

Indeed, changing the permissions on the configuration file solved the problem.

root@RUT906:/tmp# ls -Al /etc/config/example
-rw-r–r-- 1 root root 0 Oct 28 09:39 /etc/config/example
root@RUT906:/tmp# chmod 666 /etc/config/example
root@RUT906:/tmp# ubus call api post ‘{“path”:“/example_c/config”,“body”:{“data”:{“id”:“demo01”,“text”:“hello_world”,“bool”:“1”,“select”:“first”}}}’
{
“http_body”: {
“success”: true,
“data”: {
“bool”: “1”,
“.type”: “example”,
“id”: “demo01”,
“text”: “hello_world”,
“test”: “default-value-demo01”,
“select”: “first”
}
},
“http_code”: 201
}
root@RUT906:/tmp# cat /etc/config/example

config example ‘demo01’
option test ‘default-value-demo01’
option text ‘hello_world’
option select ‘first’
option enabled ‘1’

root@RUT906:/tmp# ls -Al /etc/config/example
-rw-rw-rw- 1 uhttpd uhttpd 132 Nov 19 11:31 /etc/config/example

What is the simplest way to configure the custom package to give write permission to the configuration file ?

Thanks for your help !

Ludovic

Hi there,

I’ve consulted with my colleagues, and they’ve suggested either utilizing the echo command to push certain settings into the specific configuration file, or checking whether you could do it in the package configuration before compiling.

Regards,
M.

Got it, thanks Matias for your help.

Ludovic

1 Like

This topic was automatically closed after 60 days. New replies are no longer allowed.