error: error switching euid to 33 and egid to -1: Invalid argument

I recently encountered the following error (after an upgrade from Debian Jessie to Debian Stretch):

/etc/cron.daily/logrotate:
error: error switching euid to 33 and egid to -1: Invalid argument
run-parts: /etc/cron.daily/logrotate exited with return code 1

It was not so easy to find the cause in the long list of possible offenders in /etc/logrotate.d/ ! In the end, it turned out that the faulty line was:

su www-data

in one of the logrotate configuration files. Indeed, no group was given in addition to the user account, hence the gid set to -1 which is blatanly an incorrect value.

The correct and expected syntax was:

su www-data www-data