bitcoin-cli could not locate RPC credentials
You are using bitcoin-cli incorrectly.

The command line arguments come before the RPC command. Anything that comes after the RPC command will be interpreted as arguments for the RPC, not arguments to bitcoin-cli

So what you should actually be doing is 

src/bitcoin-cli -rpcuser={...} -rpcpassword={...} getblockchaininfo