Added debug information for the unexpected state revert error

* We had an 1% error that the topology is reverted back to
undeployed state during deploying. This commit attempts to log
the stacktrace when the error occurs.
* Remove some unnecessary state setting.