state-store error occurs. Contributed by Jian He (cherry picked from commit 9b78e6e33d8c117c1e909df414f20d9db56efe4b)