"This report exceeds the maximum length of 1048576 characters and thus was truncated."

We have reports that it would be infinitely better if they were attached when sent, rather than having to download from Greenbone. I have logged into our Ubuntu server with Putty/SSH, elevated with “sudo su”, and issued the following commands:

openvasmd --max-email-attachment-size=10
openvasmd --max-email-include-size=10
openvasmd --max-email-message-size=10

The “10” is intentionally to trigger a failure for basically all attachments, allowing for a quick report (40 minutes) to be used for testing. Once we have the commands correct, I will be setting these to “-1” to run a real test on one of our larger reports.

Unfortunately, after running these 3 commands, we ran the report and it attached the file, so obviously I’m not doing something correctly. Can anyone tell me how to fix this?

Please note that all three parameters needs to be passed to your startup / systemd script for the openvasmd binary and are no command-line parameters you can use to modify settings “on the fly”.

Unfortunately i can’t give you any further more specific hints. This highly depends on your environment and how your used packages / distribution are packaging GVM and providing the startup scripts like e.g. openvas-manager (this is not part of the GVM source distribution / GSE).

The general advice is to evaluate how the openvasmd is started in your environment and to extend this startup sequence with the mentioned startup commands.

There are indeed two kind of such command line parameters. Unfortunately they are not marked as such directly. But basically all commands shown via

openvasmd/gvmd --help

and which contains the wording “and exit” are the ones you can pass while the daemon is not running where all others are needs to be used on the startup of the daemon.

Thanks again. Performing the following steps, I was able to set the limit to “10”, thus triggering a failure on a small report & confirming the fix works. To eliminate the problem of e-mails not having the attachment, you should set the value to “-1” (as it appears below). “Length” in the original error does indeed actually mean “Attachment size in bytes” for anyone else confused by the e-mail message.

This is written explicitly for Ubuntu with GVM 9. I know in GVM 10 “openvasmd” became “gvmd”, and “openvas-manager” is now “greenbone-manager”, so anyone applying this should bear that in mind:

Stop Manager (openvasmd)

service openvas-manager stop

Confirm stopped

ps aux | grep -i openvas

Edit the openvas-manager service

vi /etc/init.d/openvas-manager

Add the following after the other “DAEMON_ARGS”:

[ -n “$ATTACHMENT_SIZE” ] && DAEMON_ARGS="$DAEMON_ARGS --max-email-attachment-size=$ATTACHMENT_SIZE"
[ -n “$INCLUDE_SIZE” ] && DAEMON_ARGS="$DAEMON_ARGS --max-email-include-size=$INCLUDE_SIZE"
[ -n “$MESSAGE_SIZE” ] && DAEMON_ARGS="$DAEMON_ARGS --max-email-message-size=$MESSAGE_SIZE"

Edit the openvas-manager arguments

vi /etc/default/openvas-manager

Add the following to the end of the file (or whichever you want modified - omit those you do not want set differently from their default value):

ATTACHMENT_SIZE="-1"
INCLUDE_SIZE="-1"
MESSAGE_SIZE="-1"

Reload and start services

systemctl daemon-reload
service openvas-manager start

Confirm started

ps aux | grep -i openvas

1 Like

Keep in mind that changes in “/etc/init.d” files are not update-safe and might be overwritten by a follow-up update of your packages. Depending if you’re using systemd now or in the future they might stop working as well.

To make these changes more future-proof you could create a feature request to the maintainer of your used packages to allow changing these parameters more easily (via e.g. /etc/default/openvas-manager).

It seems there is a misunderstanding here:

Please note that the files you have modified are neither part of GVM nor provided by Greenbone as previously explained in comment #5.

Because of this it is not possible to speak about specific modifications or to get the next version to include this modifications because Greenbone isn’t involved here.

That’s the reason why i have tried to redirect you to the maintainer of your used packages (in comment #9) to avoid that such custom modifications are overwritten again in a possible upcoming package update.

Hello,
my gvmd.service Script look like that:

[Unit]
Description=Greenbone Vulnerability Manager
Wants=network-online.target
After=network.target

[Service]
Type=forking
Environment=LD_LIBRARY_PATH=$LD_LIBRARY_PATH:’/home/user/install/lib/’
EnvironmentFile=/home/user/install/etc/default/gvmd
ExecStart=/home/user/install/sbin/gvmd $UNIX
PermissionsStartOnly=true
ExecStop=/bin/kill -HUP $MAINPID
TimeoutStopSec=10

ExecStartPost=/home/user/install/sbin/gvmd $ATTACHMENT_SIZE
ExecStartPost=/home/user/install/sbin/gvmd $INCLUDE_SIZE
ExecStartPost=/home/user/install/sbin/gvmd $MESSAGE_SIZE

[Install]
Alias=greenbone-vulnerability-manager.service
#WantedBy=multi-user.target
WantedBy=default.target




the variables are looking like that:

#EnvironmentFile for gvmd.service
UNIX=–unix-socket /home/user/install/var/run/gvmd.sock
ATTACHMENT_SIZE=–max-email-attachment-size=4000000
INCLUDE_SIZE=–max-email-include-size=4000000
MESSAGE_SIZE=–max-email-message-size=4000000




First i thought i can use multiple “ExecStart” Commands to get the max-email commands, but thats not work, now i tried it with multiple ExecStartPost, but this gives me an error also…

in the journalctl -f i saw this error:
gvmd.service: Control process exited, code=exited status=1
gvmd.service: Failed with result ‘exit-code’.
Failed to start Greenbone Vulnerability Manager.

GVM versions

gsa: 8.0.1
gvm: 8.0.1
openvas-scanner: 6.0.1
gvm-libs: 10.0.1
gvm-tools: 2.0.0.beta1

Environment Greenbone Server

**Operating system: Ubuntu Server 18.4
**Kernel: 4.15.0-58-generic
**Installation method / source: Github

As previously explained:

This means you need to start the gvmd like e.g. while making sure that there are no other gvmd processes already running:

gvmd --max-email-attachment-size=4000000 --max-email-include-size=4000000 --max-email-message-size=4000000
1 Like

Okay, thank you.
Now its start with the Parameters, when i check the status all is fine:

gvmd.service - Greenbone Vulnerability Manager
Loaded: loaded (/home/user/.config/systemd/user/gvmd.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2019-10-11 08:45:44 CEST; 7min ago
Process: 1415 ExecStart=/home/user/install/sbin/gvmd $UNIX $ATTACHMENT_SIZE $INCLUDE_SIZE $MESSAGE_SIZE (code=exited, status=0/SUCCESS)

But the Problem is, that when i get an bigger report with like 5900 results i get this error:
image

Also i saw with the “top” command that the “xsltproc” process takes 100% cpu from the core its use…
After some time i get the mail with and broken pdf…

Kind regard,

ayinuha

Please create a new topic for this new problem to avoid mixing different problems in a single thread.

Hi, I’ve come across this as I’m still facing the issue described here and can’t resolve after trying the suggestions mentioned. I’m using the setup below. I’ve tried running commands manually but no effect, I’ve tried amending the startup script per comment above and still no fix. Is there any other guidance available to get the report to send with attachment and not truncate it?

GVM versions

gsa:9.0.1
gvm:9.0.1

Environment

**Operating system: Ubuntu 20.04
**Kernel:5.4.0-33-generic #37-Ubuntu SMP Thu May 21 12:53:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
**Installation method / source: https://github.com/greenbone/

As previously mentioned both parameters needs to be passed as startup-parameters to the gvmd daemon. How this can be done heavily depends on how you’re starting gvmd. But i guess you probably are using systemd so the parameters needs to be added to the systemd unit / service file of gvmd. If you need further support with the configuration on the systemd files please get in touch with the Ubuntu community.