When you call getNewAddress with returnAll: true, it will not only return the new address but all other addresses before that one too. And you have to know all addresses to be able to ask for their balances.
getNewAddress will not attach the new address or anything, just compute addresses until it finds one that has never been used before i.e. ...
Which operating system did you install it on?
Did you configure anything so far? (for example changed any ports or added any neighbors so far?)
By the way this reminds me of something similar I have opened an issue a while back https://github.com/iotaledger/iri/issues/1678
Maybe you've added a neighbor with an invalid port? Please check /etc/default/iri