Properly raise exception when key is not found on server (#5415).