How to enable bash history?

In principle, everything looks ok:

set -o | grep history

history on

echo $HISTFILE

/root/.bash_history

echo $HISTSIZE

500

echo $HISTFILESIZE

500

But .bash_history is empty and the history is lost between sessions.

Add to .bashrc

PROMPT_COMMAND=“history -a”
shopt -s histappend