Fix pkgrepo state failures

Resolves #16683.