agent: refined logging during error conditions when reading/writing the tags file