The above error happens when the original dbo login of a database has been removed from SQL Server.
To solve the issue, change 'dbo' to match a correct login, using either sp_changedbowner or with the following SQL code:
ALTER AUTHORIZATION ON DATABASE::[dbname] TO [somevalidlogin]