Bug-4388 Disable database expansion when enabled throws Error 500

Signed-off-by: Chirayu Chiripal <chirayu.chiripal@gmail.com>