add a retry when metadata fetched with a corrupt JSON format
Fixes #1868