Trying to get a pdf report with gvm-cli in a script using the syntax: gvm-cli socket --socketpath /var/run/openvasmd.sock --timeout -1 --gmp-username admin --gmp-password pwd -X ‘<get_reports report_id="’$reportId’" format_id="’$formatId’" filter=“apply_overrides=1 overrides=1 levels=hml” ignore_pagination=“1”/>’ | xmlstarlet sel -t -v get_reports_response/report/text() | base64 -i -d > $reportName.$ext
Fails with the following error:
-:1.10004001: xmlSAX2Characters: huge text node: out of memory
PSCjDZozSjOY4iIeewZM1HnBgtFiRMIwAAkqYCndG4JE1gpDBH1TRVx8nk2tne05CaGEHhj2wi2IRUSL
_ ^_ -:1.10004001: Extra content at the end of the document PSCjDZozSjOY4iIeewZM1HnBgtFiRMIwAAkqYCndG4JE1gpDBH1TRVx8nk2tne05CaGEHhj2wi2IRUSL
_ ^_
_Exception ignored in: <io.TextIOWrapper name=’’ mode=‘w’ encoding=‘UTF-8’>
This doesn’t happen with smaller reports. Any idea why this is failing ?
I confirm it’s an xmlstarlet issue. Dumping gvm-cli command to a local file works as expected. But piping this file through xmlstarlet fails. Is there any workaround to this or an alternative to xmlstarlet perhaps ?