Hello Allan,
I'm not in the Invenio developer team, but I remember dealing with a
very similar issue a few weeks ago. In my case it was the same error,
but with inveniocfg --upgrade-check. I'm not 100% sure what i did to
overcome it, but i *think* i run the upgrade-check as the apache user
and this was enough.
So, you could give a try to either one of these:
sudo -u www-data make check-upgrade or
sudo -u www-data /opt/invenio/bin/inveniocfg --upgrade-check
and see if you get the same error.
Best regards,
Theodoros