Thanks, I solved my problem with this command:
sudo chown -R vnstat:vnstat /var/lib/vnstat
Is it safer? I got it from the unbuntu website. I think it means that ownership of the file has been switched to vnstat, so now it's able to write to the file and display bandwidth use.