Updated document for fault messages

This commit is contained in:
Amin Ben Romdhane 2023-07-27 14:21:15 +02:00
parent fe1b84a2a4
commit 0b91e10b5e
2 changed files with 133 additions and 43 deletions

View file

@ -29,7 +29,7 @@ In the above uci, loglevel can have below value:
| 3 | Log everything except debug |
| 4 | Everything will be logged |
For more info on the `bbfdmd` UCI configuration visit [uci documentation](../docs/api/uci/bbfdm.md) OR [raw uci schema](../../schemas/uci/bbfdm.json)
For more info on the `bbfdmd` UCI configuration visit [uci documentation](../api/uci/bbfdm.md) OR [raw uci schema](../../schemas/uci/bbfdm.json)
## Concepts and Workflow
@ -164,10 +164,10 @@ $ bbfdmd -c set "parameter" "value"
## Important topics
* [UBUS methods](../docs/guide/bbfdm_ubus_methods.md)
* [UBUS Errors](../docs/guide/bbfdm_ubus_errors.md)
* [Parallel UBUS call](../docs/guide/bbfdm_ubus_parallel_call.md)
* [Third party datamodel integration](../docs/guide/bbfdm_dm_integration.md)
* [UBUS methods](../guide/bbfdm_ubus_methods.md)
* [UBUS Errors](../guide/bbfdm_ubus_errors.md)
* [Parallel UBUS call](../guide/bbfdm_ubus_parallel_call.md)
* [Third party datamodel integration](../guide/bbfdm_dm_integration.md)
## Dependencies

View file

@ -1,5 +1,97 @@
# UBUS Errors
Today, in addional to the `CWMP` and `USP` standard error messages, bbfdm has introduced a new feature to provide customers more clarification about the root cause of the fault,
and based on that it's easily to understand what the issue is and how to fix it and find out the limitations we have on the device.
Whenever you encounter an error in a specific method(GET/SET/ADD/DELETE/OPERATE), you can use the `fault_msg` option to understand the reason for the error.
## Example of fault messages
1. The requested value is correct as per TR181 standard, but there is a limitation in the device.
```console
root@iopsys:~# ubus call bbfdm set '{"path":"Device.Firewall.Config", "value":"High"}'
{
"results": [
{
"path": "Device.Firewall.Config",
"fault": 9007,
"fault_msg": "The current Firewall implementation supports only 'Advanced' config."
}
]
}
root@iopsys:~# ubus call bbfdm set '{"path":"Device.Firewall.AdvancedLevel", "value":"Device.Firewall.Level.2"}'
{
"results": [
{
"path": "Device.Firewall.AdvancedLevel",
"fault": 9007,
"fault_msg": "The current Firewall implementation supports only one Level. So the value should be 'Device.Firewall.Level.1'."
}
]
}
```
2. The requested value is outside the allowed range.
```console
root@iopsys:~# ubus call bbfdm set '{"path":"Device.Firewall.Chain.1.Rule.9.DestPort", "value":"123456"}'
{
"results": [
{
"path": "Device.Firewall.Chain.1.Rule.9.DestPort",
"fault": 9007,
"fault_msg": "'123456' value is not within range (min: '-1' max: '65535')"
}
]
}
```
3. Some arguments should be defined to perform the requested operation.
```console
root@iopsys:~# ubus call bbfdm operate '{"command":"Device.IP.Diagnostics.IPPing()", "command_key":"ipping_test", "input":{}}'
{
"results": [
{
"path": "Device.IP.Diagnostics.IPPing()",
"data": "ipping_test",
"fault": 7004,
"fault_msg": "IPPing: 'Host' input should be defined"
}
]
}
```
4. The requested method is not permitted since the instance was created by the system.
```console
root@iopsys:~# ubus call bbfdm add '{"path":"Device.Firewall.Chain.2.Rule."}'
{
"results": [
{
"path": "Device.Firewall.Chain.2.Rule.",
"fault": 9003,
"fault_msg": "This is a dynamic 'Chain' instance which is created by 'Port Mapping', so it's not permitted to add a static 'Rule'."
}
]
}
root@iopsys:~# ubus call bbfdm del '{"path":"Device.Firewall.Chain.1.Rule.1."}'
{
"results": [
{
"path": "Device.Firewall.Chain.1.Rule.1.",
"fault": 9003,
"fault_msg": "This is a dynamic 'Rule' instance, therefore it's not permitted to delete it."
}
]
}
```
> Note: If no specific fault message defined for particular obj/param, we return the standard error messages that are defined in CWMP and USP protocols as the fault message value.
## Path syntax and possible error cases
Please note some error scenerios with the bbfdm.
@ -9,14 +101,15 @@ Please note some error scenerios with the bbfdm.
```console
root@iopsys:~# ubus call bbfdm get '{"path":"Users.User.", "optional": {"format":"raw", "proto":"usp"}}'
{
"results": [
{
"path": "Users.User.",
"fault": 7026,
"fault_msg": ""
}
]
"results": [
{
"path": "Users.User.",
"fault": 7026,
"fault_msg": "Path is not present in the data model schema"
}
]
}
```
2. The path parameter must end with a '.' if the path element is not a leaf element e.g.,
@ -27,24 +120,24 @@ root@iopsys:~# ubus call bbfdm get '{"path":"Users.User.", "optional": {"format"
root@iopsys:~#
root@iopsys:~# ubus call bbfdm get '{"path":"Device.Users.User.4", "optional": {"format":"raw", "proto":"usp"}}'
{
"results": [
{
"path": "Device.Users.User.4",
"fault": 7026,
"fault_msg": ""
}
]
"results": [
{
"path": "Device.Users.User.4",
"fault": 7026,
"fault_msg": "Path is not present in the data model schema"
}
]
}
root@iopsys:~#
root@iopsys:~# ubus call bbfdm get '{"path":"Device.Users.User.*", "optional": {"format":"raw", "proto":"usp"}}'
{
"results": [
{
"path": "Device.Users.User.*",
"fault": 7026,
"fault_msg": ""
}
]
"results": [
{
"path": "Device.Users.User.*",
"fault": 7008,
"fault_msg": "Requested path was invalid or a reference was invalid"
}
]
}
root@iopsys:~#
root@iopsys:~# ubus call bbfdm get '{"path":"Device.Users.User.4.Alias", "optional": {"format":"raw", "proto":"usp"}}'
@ -64,15 +157,14 @@ root@iopsys:~# ubus call bbfdm get '{"path":"Device.Users.User.4.Alias", "option
```console
root@eagle-44d43771b550:~# ubus call bbfdm get '{"path":"Device.Users.User.*", "optional": {"format":"raw", "proto":"usp"}}'
{
"results": [
{
"path": "Device.Users.User.*",
"fault": 7026,
"fault_msg": ""
}
]
"results": [
{
"path": "Device.Users.User.*",
"fault": 7008,
"fault_msg": "Requested path was invalid or a reference was invalid"
}
]
}
```
4. The path parameter value must be a valid path schema, in example below SSID is used which is invalid schema element for Device.Users.User.{i}.
@ -80,13 +172,13 @@ root@eagle-44d43771b550:~# ubus call bbfdm get '{"path":"Device.Users.User.*", "
```console
root@iopsys:~# ubus call bbfdm get '{"path":"Device.Users.User.1.SSID", "optional": {"format":"raw", "proto":"usp"}}'
{
"results": [
{
"path": "Device.Users.User.1.SSID",
"fault": 7026,
"fault_msg": ""
}
]
"results": [
{
"path": "Device.Users.User.1.SSID",
"fault": 7026,
"fault_msg": "Path is not present in the data model schema"
}
]
}
```
@ -103,5 +195,3 @@ root@iopsys:~# ubus call bbfdm get '{"path":"Device.Users.User.1.SSID", "optiona
| 7012 | Out of range or invalid enumeration. |
| 7022 | Command failed to operate. |
| 7026 | Path is not present in the data model schema. |