BUGFIX: Handle error path correctly when attributes cannot be retrieved from DB.

For example, if the DB server is down or the DB credentials are not accepted
or the URL accidentaly points to an HTML page.