getnewaddress won't generate bech32 or p2sh-segwit addresses We are only able to generate "legacy" addresses that begin with a "1". This is a long standing problem generating new addresses using bitcoind and has persisted through a few recent versions of bitcoin core.

This might be a possible bug in bitcoind 64-bit linux.

We are currently running core 19.1 taken from here: https://bitcoincore.org/bin/bitcoin-core-0.19.1/

And our linux version is: Ubuntu 18.04.3 LTS x86_64

We have "addresstype=bech32" set in our bitcoin.conf.

Has anyone else seen this problem before?

Here is our bitcoin.conf:

addnode=**.***.***.***

server=1

rpcport=****

walletnotify=/btc_notify.sh %s

# OpenSSL settings used when rpcssl=1
rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH
rpcsslcertificatechainfile=server.cert
rpcsslprivatekeyfile=server.pem

gen=0

keypool=100

paytxfee=0.00005000

addresstype=bech32


And here is an example of how the problem manifests itself:
The problem is that your wallet version is extremely old - it predates support for compressed public keys (which was added in v0.6.0, released in March 2012). As segwit addresses require compressed public keys, Bitcoin Core is failing with the keys you have, and defaulting to legacy addresses instead.

The solution is restart with -upgradewallet (just once), which will update the wallet to the latest version but break compatibility with old Bitcoin Core versions. Note that you'll need a new backup after doing so.