Why does maapi --clicmd apply paginate false but still generate an error in the log?

I am disabling pagination in the ConfD CLI using the following command:

maapi --clicmd --get-io --no-error "paginate false;"

The paginate false setting is applied correctly, but an error still appears in the ConfD logs:

=ERROR REPORT==== 1-Apr-2025::21:47:17.800202 ===  
cli_cmd_io got {paginate,true}  
=ERROR REPORT==== 1-Apr-2025::21:47:31.432143 ===  
cli_cmd_io got {paginate,false}  

This behavior can be reproduced with the following example:

/ # maapi --clicmd --get-io --no-error "paginate true"
/ # maapi --cliget "paginate"
true
/ # maapi --clicmd --get-io --no-error "paginate false"
/ # maapi --cliget "paginate"
false

This behavior started occurring after the ConfD version was updated from 7.2.6 to 8.0.6.

I would like to understand:

  1. Why does this error message appear even though the command works?
  2. Does this error indicate a problem that could impact the CLI’s functionality?
  3. Is there a way to avoid this error when applying paginate false via maapi --clicmd?

I appreciate any guidance on this behavior!

Hi Bruno,

I tested here locally on my machine, on version 7.2.3 and version 8.0.15, not exactly the same versions you are testing, but the example here works the same for both versions.

I had to base my example of the examples.confd/scripting-example, since we are using the maapi-executable.

In addition to the echo.sh-script, I added 3 more, maapi_paging_on.sh, maapi_paging_off.sh and maapi_paging_show.sh.

As an example, attached the maapi_paging_show.sh - which shows how to do it:

#!/bin/sh
set -e
usage=
while [ $# -gt 0 ]; do
    case "$1" in
        --h)
            usage=1
            ;;
        --command)
            cat << EOF
begin command
  modes: oper
  styles: c i j
  cmdpath: my paging show
  help: Shows paging value
end
EOF
            exit
            ;;
        *)
            ;;
    esac
    shift
done
# String to be displayed.
string=$*
echo "export CONFD_MAAPI_USID=$CONFD_MAAPI_USID"
echo "export CONFD_MAAPI_THANDLE=$CONFD_MAAPI_THANDLE"
echo "--- paginate ---"

maapi --cliget paginate

if [ x"$usage" != x ]; then
    echo
    echo "Usage: $0"
    exit 1
fi

Place that file next to the echo.sh file in scripts/command.

Neither in version 7.2.3 nor in version 8.0.15 does the maapi-executable accept your command. in my local installation, if I execute it:

CONFD_MAAPI_THANDLE=X CONFD_MAAPI_USID=Y maapi --clicmd --get-io "paginate false"
Error executing command: item does not exist - no cli session

You do not see this error, since you requested the --no-error parameter.

Now if you use in the scripts:

maapi --cliset paginate "false"
maapi --cliset paginate "true"
maapi --cliget paginate

You get the desired results.

From the confd_cli it would look like this:

user@machine> my paging on
user@machine> my paging show
true

user@machine> my paging off 
user@machine> my paging show
false

Could you tell me if you are running the maapi-executable from an RPC, or from the CLI?

Could you tell me in which log this error is showing up? Additionally please share the XML-snipplet from confd.conf with the settings for the log-file.

Kind regards,

Fabian

Hi Fabian,

Thank you very much for the detailed explanation and the example scripts — they were really helpful!

To answer your questions:

  • Yes, I am running the maapi command from the CLI.
  • The error message appears in the confd_out.log file.

I also noticed that removing the --get-io flag from the command prevents the error message from being logged, even though the paginate setting still works.

That said, I’ll adopt your suggested approach using --cliset instead. I tested it here and it works perfectly as well, without triggering any error messages in the logs.

Thanks again for the support and clear explanation!

Kind regards,
Bruno