I spent hours trying to solve this bug and the solution was so simple. 
My rpcpassword in my bitcoin.conf file contained a '#' character.

Prevent this from happening, by outputting this an error or warning when users run bitcoind.

Right now, you can have a # character as a password and it will work on the command line but will fail when you JSON-RPC.
{
    return nStartupTime;
}
fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific)
{
    return fs::absolute(path, GetDataDir(net_specific));
}
int ScheduleBatchPriority()
{
#ifdef SCHED_BATCH
    const static sched_param param{0};
    if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param)) {
        LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
        return ret;
    }
    return 0;
#else
    return 1;
#endif
}
namespace util {
#ifdef WIN32
WinCmdLineArgs::WinCmdLineArgs()