phpmyadmin Yiimp:CDb异常:CDbConnection无法打开数据库连接,hasGetInfo设置为false时出错

mwyxok5s  于 2022-11-09  发布在  PHP
关注(0)|答案(1)|浏览(195)

出现CDbConnection failed to open the DB connection错误。
问题是,我的数据库连接似乎没问题,YIIMP日志显示了我打印出来的检索值(参见yiimp-logs/debug.log中的文本)。
除了添加debuglog行之外,我没有修改YIIMP源代码。
我在nginx上运行服务器。
我试图找出问题出在哪里,但到目前为止我还没能找到。
导致此问题的原因是什么?
提前感谢你!:)
yiimp-logs/debug.log

[2022-01-18 16:06:53] wallet-rc.php construtor

[2022-01-18 16:06:53] Bitcoin RPC detected

[2022-01-18 16:06:53] wallet-rpc.php call method

[2022-01-18 16:06:53] Bitcoin RPC, getInfo is set to false

[2022-01-18 16:06:53] array

(

    'blocks' => 18541

    'difficulty' => 818.13886010363

    'testnet' => false

    'walletversion' => null

    'balance' => null

    'keypoololdest' => null

    'keypoolsize' => null

    'paytxfee' => null

    'version' => 229900

    'protocolversion' => 70016

    'timeoffset' => 0

    'connections' => 3

    'relayfee' => 1.0E-5

)

[2022-01-18 16:06:53] info is:

[2022-01-18 16:06:53] array

(

    'blocks' => 18541

    'difficulty' => 818.13886010363

    'testnet' => false

    'walletversion' => null

    'balance' => null

    'keypoololdest' => null

    'keypoolsize' => null

    'paytxfee' => null

    'version' => 229900

    'protocolversion' => 70016

    'timeoffset' => 0

    'connections' => 3

    'relayfee' => 1.0E-5

)

[2022-01-18 16:06:53] remote is:

[2022-01-18 16:06:53] WalletRPC#1

(

    [type] => 'Bitcoin'

    [*:rpc] => Bitcoin#2

    (

        [Bitcoin:username] => 'yiimprpc'

        [Bitcoin:password] => 'passwordgetsshownhere'

        [Bitcoin:proto] => 'http'

        [Bitcoin:host] => '127.0.0.1'

        [Bitcoin:port] => '8836'

        [Bitcoin:url] => null

        [Bitcoin:CACertificate] => null

        [status] => 200

        [error] => null

        [raw_response] => '{\"result\":{\"version\":229900,\"subversion\":\"/Satoshi:22.99.0/\",\"protocolversion\":70016,\"localservices\":\"0000000000000409\",\"localservicesnames\":[\"NETWORK\",\"WITNESS\",\"NETWORK_LIMITED\"],\"localrelay\":true,\"timeoffset\":0,\"networkactive\":true,\"connections\":3,\"connections_in\":0,\"connections_out\":3,\"networks\":[{\"name\":\"ipv4\",\"limited\":false,\"reachable\":true,\"proxy\":\"\",\"proxy_randomize_credentials\":false},{\"name\":\"ipv6\",\"limited\":false,\"reachable\":true,\"proxy\":\"\",\"proxy_randomize_credentials\":false},{\"name\":\"onion\",\"limited\":true,\"reachable\":false,\"proxy\":\"\",\"proxy_randomize_credentials\":false},{\"name\":\"i2p\",\"limited\":true,\"reachable\":false,\"proxy\":\"\",\"proxy_randomize_credentials\":false}],\"relayfee\":0.00001000,\"incrementalfee\":0.00001000,\"localaddresses\":[{\"address\":\"serveripaddressgetsshownhere\",\"port\":8863,\"score\":1}],\"warnings\":\"This is a pre-release test build - use at your own risk - do not use for mining or merchant applications\"},\"error\":null,\"id\":3}

'

        [response] => array(...)

        [Bitcoin:id] => 3

    )

    [*:rpc_wallet] => null

    [*:hasGetInfo] => '0'

    [*:account] => null

    [*:accounts] => null

    [*:coin] => null

    [*:info] => null

    [*:height] => 0

    [error] => null

)

[2022-01-18 16:06:54] wallet-rc.php construtor

[2022-01-18 16:06:54] Bitcoin RPC detected

[2022-01-18 16:06:54] remote in coin_results.php is:

[2022-01-18 16:06:54] WalletRPC#1

(

    [type] => 'Bitcoin'

    [*:rpc] => Bitcoin#2

    (

        [Bitcoin:username] => 'yiimprpc'

        [Bitcoin:password] => 'passwordgetshownhere'

        [Bitcoin:proto] => 'http'

        [Bitcoin:host] => '127.0.0.1'

        [Bitcoin:port] => '8836'

        [Bitcoin:url] => null

        [Bitcoin:CACertificate] => null

        [status] => null

        [error] => null

        [raw_response] => null

        [response] => null

        [Bitcoin:id] => 0

    )

    [*:rpc_wallet] => null

    [*:hasGetInfo] => '0'

    [*:account] => null

    [*:accounts] => null

    [*:coin] => null

    [*:info] => null

    [*:height] => 0

    [error] => null

)

[2022-01-18 16:06:54] reserved1 after dboscalar in coin_results.php is:

[2022-01-18 16:06:54]

[2022-01-18 16:06:54] reserved1 after altcoinvaluetoa in coin_results.php is:

[2022-01-18 16:06:54] 0.000000

[2022-01-18 16:06:54] owed after dboscalar in coin_results.php is:

[2022-01-18 16:06:54]

[2022-01-18 16:06:54] wallet-rpc.php call method

[2022-01-18 16:06:54] Bitcoin RPC, getInfo is set to false

[2022-01-18 16:06:54] array

(

    'blocks' => 18541

    'difficulty' => 818.13886010363

    'testnet' => false

    'walletversion' => null

    'balance' => null

    'keypoololdest' => null

    'keypoolsize' => null

    'paytxfee' => null

    'version' => 229900

    'protocolversion' => 70016

    'timeoffset' => 0

    'connections' => 3

    'relayfee' => 1.0E-5

)

[2022-01-18 17:07:01] CDbException#1

(

    [*:message] => 'CDbConnection failed to open the DB connection.'

    [Exception:string] => ''

    [*:code] => 0

    [*:file] => '/var/web/framework/db/CDbConnection.php'

    [*:line] => 405

    [Exception:trace] => array

    (

        0 => array

        (

            'file' => '/var/web/framework/db/CDbConnection.php'

            'line' => 347

            'function' => 'open'

            'class' => 'CDbConnection'

            'type' => '->'

        )

        1 => array

        (

            'file' => '/var/web/framework/db/CDbConnection.php'

            'line' => 325

            'function' => 'setActive'

            'class' => 'CDbConnection'

            'type' => '->'

        )

        2 => array

        (

            'file' => '/var/web/framework/base/CModule.php'

            'line' => 394

            'function' => 'init'

            'class' => 'CDbConnection'

            'type' => '->'

        )

        3 => array

        (

            'file' => '/var/web/framework/base/CModule.php'

            'line' => 103

            'function' => 'getComponent'

            'class' => 'CModule'

            'type' => '->'

        )

        4 => array

        (

            'file' => '/var/web/yaamp/core/common/libdbo.php'

            'line' => 56

            'function' => '__get'

            'class' => 'CModule'

            'type' => '->'

        )

        5 => array

        (

            'file' => '/var/web/yaamp/core/functions/settings.php'

            'line' => 17

            'function' => 'dborow'

        )

        6 => array

        (

            'file' => '/var/web/yaamp/core/functions/settings.php'

            'line' => 104

            'function' => 'settings_get'

        )

        7 => array

        (

            'file' => '/var/web/yaamp/core/trading/binance_trading.php'

            'line' => 15

            'function' => 'exchange_get'

        )

        8 => array

        (

            'file' => '/var/web/yaamp/modules/thread/CronjobController.php'

            'line' => 142

            'function' => 'doBinanceTrading'

        )

        9 => array

        (

            'file' => '/var/web/framework/web/actions/CInlineAction.php'

            'line' => 49

            'function' => 'actionRun'

            'class' => 'CronjobController'

            'type' => '->'

        )

        10 => array

        (

            'file' => '/var/web/framework/web/CController.php'

            'line' => 308

            'function' => 'runWithParams'

            'class' => 'CInlineAction'

            'type' => '->'

        )

        11 => array

        (

            'file' => '/var/web/framework/web/CController.php'

            'line' => 286

            'function' => 'runAction'

            'class' => 'CController'

            'type' => '->'

        )

        12 => array

        (

            'file' => '/var/web/framework/web/CController.php'

            'line' => 265

            'function' => 'runActionWithFilters'

            'class' => 'CController'

            'type' => '->'

        )

        13 => array

        (

            'file' => '/var/web/yaamp/components/CYiimpConsoleApp.php'

            'line' => 125

            'function' => 'run'

            'class' => 'CController'

            'type' => '->'

        )

        14 => array

        (

            'file' => '/var/web/runconsole.php'

            'line' => 18

            'function' => 'runController'

            'class' => 'CYiimpConsoleApp'

            'type' => '->'

        )

    )

    [Exception:previous] => null

    [errorInfo] => null

)

[2022-01-18 17:07:01] CDbException#1

(

    [*:message] => 'CDbConnection failed to open the DB connection.'

    [Exception:string] => ''

    [*:code] => 0

    [*:file] => '/var/web/framework/db/CDbConnection.php'

    [*:line] => 405

    [Exception:trace] => array

    (

        0 => array

        (

            'file' => '/var/web/framework/db/CDbConnection.php'

            'line' => 347

            'function' => 'open'

            'class' => 'CDbConnection'

            'type' => '->'

        )

        1 => array

        (

            'file' => '/var/web/framework/db/CDbConnection.php'

            'line' => 325

            'function' => 'setActive'

            'class' => 'CDbConnection'

            'type' => '->'

        )

        2 => array

        (

            'file' => '/var/web/framework/base/CModule.php'

            'line' => 394

            'function' => 'init'

            'class' => 'CDbConnection'

            'type' => '->'

        )

        3 => array

        (

            'file' => '/var/web/framework/base/CModule.php'

            'line' => 103

            'function' => 'getComponent'

            'class' => 'CModule'

            'type' => '->'

        )

        4 => array

        (

            'file' => '/var/web/yaamp/core/common/libdbo.php'

            'line' => 46

            'function' => '__get'

            'class' => 'CModule'

            'type' => '->'

        )

        5 => array

        (

            'file' => '/var/web/yaamp/core/functions/settings.php'

            'line' => 64

            'function' => 'dboscalar'

        )

        6 => array

        (

            'file' => '/var/web/yaamp/core/functions/settings.php'

            'line' => 198

            'function' => 'settings_set_default'

        )

        7 => array

        (

            'file' => '/var/web/yaamp/core/backend/markets.php'

            'line' => 7

            'function' => 'market_set_default'

        )

        8 => array

        (

            'file' => '/var/web/yaamp/modules/thread/CronjobController.php'

            'line' => 152

            'function' => 'BackendPricesUpdate'

        )

        9 => array

        (

            'file' => '/var/web/framework/web/actions/CInlineAction.php'

            'line' => 49

            'function' => 'actionRun'

            'class' => 'CronjobController'

            'type' => '->'

        )

        10 => array

        (

            'file' => '/var/web/framework/web/CController.php'

            'line' => 308

            'function' => 'runWithParams'

            'class' => 'CInlineAction'

            'type' => '->'

        )

        11 => array

        (

            'file' => '/var/web/framework/web/CController.php'

            'line' => 286

            'function' => 'runAction'

            'class' => 'CController'

            'type' => '->'

        )

        12 => array

        (

            'file' => '/var/web/framework/web/CController.php'

            'line' => 265

            'function' => 'runActionWithFilters'

            'class' => 'CController'

            'type' => '->'

        )

        13 => array

        (

            'file' => '/var/web/yaamp/components/CYiimpConsoleApp.php'

            'line' => 125

            'function' => 'run'

            'class' => 'CController'

            'type' => '->'

        )

        14 => array

        (

            'file' => '/var/web/runconsole.php'

            'line' => 18

            'function' => 'runController'

            'class' => 'CYiimpConsoleApp'

            'type' => '->'

        )

    )

    [Exception:previous] => null

    [errorInfo] => null

)

[2022-01-18 17:07:03] CDbException#1

(

    [*:message] => 'CDbConnection failed to open the DB connection.'

    [Exception:string] => ''

    [*:code] => 0

    [*:file] => '/var/web/framework/db/CDbConnection.php'

    [*:line] => 405

    [Exception:trace] => array

    (

        0 => array

        (

            'file' => '/var/web/framework/db/CDbConnection.php'

            'line' => 347

            'function' => 'open'

            'class' => 'CDbConnection'

            'type' => '->'

        )

        1 => array

        (

            'file' => '/var/web/framework/db/CDbConnection.php'

            'line' => 325

            'function' => 'setActive'

            'class' => 'CDbConnection'

            'type' => '->'

        )

        2 => array

        (

            'file' => '/var/web/framework/base/CModule.php'

            'line' => 394

            'function' => 'init'

            'class' => 'CDbConnection'

            'type' => '->'

        )

        3 => array

        (

            'file' => '/var/web/framework/base/CModule.php'

            'line' => 103

            'function' => 'getComponent'

            'class' => 'CModule'

            'type' => '->'

        )

        4 => array

        (

            'file' => '/var/web/yaamp/core/common/libdbo.php'

            'line' => 36

            'function' => '__get'

            'class' => 'CModule'

            'type' => '->'

        )

        5 => array

        (

            'file' => '/var/web/yaamp/modules/thread/CronjobController.php'

            'line' => 51

            'function' => 'dborun'

        )

        6 => array

        (

            'file' => '/var/web/framework/web/actions/CInlineAction.php'

            'line' => 49

            'function' => 'actionRunBlocks'

            'class' => 'CronjobController'

            'type' => '->'

        )

        7 => array

        (

            'file' => '/var/web/framework/web/CController.php'

            'line' => 308

            'function' => 'runWithParams'

            'class' => 'CInlineAction'

            'type' => '->'

        )

        8 => array

        (

            'file' => '/var/web/framework/web/CController.php'

            'line' => 286

            'function' => 'runAction'

            'class' => 'CController'

            'type' => '->'

        )

        9 => array

        (

            'file' => '/var/web/framework/web/CController.php'

            'line' => 265

            'function' => 'runActionWithFilters'

            'class' => 'CController'

            'type' => '->'

        )

        10 => array

        (

            'file' => '/var/web/yaamp/components/CYiimpConsoleApp.php'

            'line' => 125

            'function' => 'run'

            'class' => 'CController'

            'type' => '->'

        )

        11 => array

        (

            'file' => '/var/web/runconsole.php'

            'line' => 18

            'function' => 'runController'

            'class' => 'CYiimpConsoleApp'

            'type' => '->'

        )

    )

    [Exception:previous] => null

    [errorInfo] => null

)

[2022-01-18 17:07:03] CDbException#1

(

    [*:message] => 'CDbConnection failed to open the DB connection.'

    [Exception:string] => ''

    [*:code] => 0

    [*:file] => '/var/web/framework/db/CDbConnection.php'

    [*:line] => 405

    [Exception:trace] => array

    (

        0 => array

        (

            'file' => '/var/web/framework/db/CDbConnection.php'

            'line' => 347

            'function' => 'open'

            'class' => 'CDbConnection'

            'type' => '->'

        )

        1 => array

        (

            'file' => '/var/web/framework/db/CDbConnection.php'

            'line' => 325

            'function' => 'setActive'

            'class' => 'CDbConnection'

            'type' => '->'

        )

        2 => array

        (

            'file' => '/var/web/framework/base/CModule.php'

            'line' => 394

            'function' => 'init'

            'class' => 'CDbConnection'

            'type' => '->'

        )

        3 => array

        (

            'file' => '/var/web/framework/base/CModule.php'

            'line' => 103

            'function' => 'getComponent'

            'class' => 'CModule'

            'type' => '->'

        )

        4 => array

        (

            'file' => '/var/web/yaamp/core/common/libdbo.php'

            'line' => 36

            'function' => '__get'

            'class' => 'CModule'

            'type' => '->'

        )

        5 => array

        (

            'file' => '/var/web/yaamp/modules/thread/CronjobController.php'

            'line' => 51

            'function' => 'dborun'

        )

        6 => array

        (

            'file' => '/var/web/framework/web/actions/CInlineAction.php'

            'line' => 49

            'function' => 'actionRunBlocks'

            'class' => 'CronjobController'

            'type' => '->'

        )

        7 => array

        (

            'file' => '/var/web/framework/web/CController.php'

            'line' => 308

            'function' => 'runWithParams'

            'class' => 'CInlineAction'

            'type' => '->'

        )

        8 => array

        (

            'file' => '/var/web/framework/web/CController.php'

            'line' => 286

            'function' => 'runAction'

            'class' => 'CController'

            'type' => '->'

        )

        9 => array

        (

            'file' => '/var/web/framework/web/CController.php'

            'line' => 265

            'function' => 'runActionWithFilters'

            'class' => 'CController'

            'type' => '->'

        )

        10 => array

        (

            'file' => '/var/web/yaamp/components/CYiimpConsoleApp.php'

            'line' => 125

            'function' => 'run'

            'class' => 'CController'

            'type' => '->'

        )

        11 => array

        (

            'file' => '/var/web/runconsole.php'

            'line' => 18

            'function' => 'runController'

            'class' => 'CYiimpConsoleApp'

            'type' => '->'

        )

    )

    [Exception:previous] => null

    [errorInfo] => null

)

coin.php文件(下面粘贴了调用coin_results.php的文件):

<?php

$id = getiparam('id');
$coin = getdbo('db_coins', $id);
if (!$coin) {
    $this->goback();
}

$this->pageTitle = 'Wallet - '.$coin->symbol;

// force a refresh after 10mn to prevent memory leaks in chrome
app()->clientScript->registerMetaTag('600', null, 'refresh');

if (!empty($coin->algo) && $coin->algo != 'PoS')
    user()->setState('yaamp-algo', $coin->algo);

$remote = new WalletRPC($coin);
$info = $remote->getinfo();
debuglog("info is:");
debuglog($info);
debuglog("remote is:");
debuglog($remote);

$sellamount = $coin->balance;
//if ($info) $sellamount = floatval($sellamount) - arraySafeVal($info, "paytxfee") * 3;

echo getAdminSideBarLinks().'<br/><br/>';
echo getAdminWalletLinks($coin, $info, 'wallet');

$maxrows = arraySafeVal($_REQUEST,'rows', 500);
$since = arraySafeVal($_REQUEST,'since', time() - (7*24*3600)); // one week

echo '<div id="main_actions">';

app()->clientScript->registerCoreScript('jquery.ui'); // dialog

/* 
echo "<br><a href='/site/makeconfigfile?id=$coin->id'><b>MAKE CONFIG & START</b></a>";

if($info)
{
    echo "<br><a href='/site/restartcoin?id=$coin->id'><b>RESTART COIND</b></a>";
    echo "<br><a href='/site/stopcoin?id=$coin->id'><b>STOP COIND</b></a>";

    if(isset($info['balance']) && $info['balance'] && !empty($coin->deposit_address))
        echo "<br><a href='javascript:showSellAmountDialog()'><b>SEND BALANCE TO</b></a> - $coin->deposit_address";
}
else
{
    echo "<br><a href='/site/startcoin?id=$coin->id'><b>START COIND</b></a>";
    echo "<br><br><a href='/site/resetblockchain?id=$coin->id'><b>RESET BLOCKCHAIN</b></a>";

    if($coin->installed)
        echo "<br><a href='javascript:uninstall_coin();'><b>UNINSTALL COIN</b></a><br>";
}

* /

echo <<<END

<br/><a class="red" href="/site/deleteearnings?id={$coin->id}"><b>DELETE EARNINGS</b></a>
<br/><a href="/site/clearearnings?id={$coin->id}"><b>CLEAR EARNINGS</b></a>
<br/><a href="/site/checkblocks?id={$coin->id}"><b>UPDATE BLOCKS</b></a>
<br/><a href="/site/payuserscoin?id={$coin->id}"><b>DO PAYMENTS</b></a>
<br/>
</div>

<style type="text/css">
table.dataGrid a.red, table.dataGrid a.red:visited, a.red { color: darkred; }
div#main_actions {
    position: absolute; top: 60px; right: 16px; width: 280px; text-align: right;
}
div#markets {
    overflow-x: hidden; overflow-y: scroll; max-height: 156px;
}
div#transactions {
    overflow-x: hidden; overflow-y: scroll; min-height: 200px; max-height: 360px;
    margin-bottom: 8px;
}
div#sums {
    overflow-x: hidden; overflow-y: scroll; min-height: 250px; max-height: 600px;
    width: 380px; float: left; margin-top: 16px; margin-bottom: 8px; margin-right: 16px;
}
.page .footer { clear: both; width: auto; margin-top: 16px; }
tr.ssrow.bestmarket { background-color: #dfd; }
tr.ssrow.disabled { background-color: #fdd; color: darkred; }
tr.ssrow.orphan { color: darkred; }
</style>

<div id="main_results"></div>

<script type="text/javascript">

function uninstall_coin()
{
    if(!confirm("Uninstall this coin?"))
        return;

    window.location.href = '/site/uninstallcoin?id=$coin->id';
}

var main_delay=30000;
var main_timeout;

function main_refresh()
{
    var url = "/site/coin_results?id={$id}&rows={$maxrows}&since={$since}";

    clearTimeout(main_timeout);
    $.get(url, '', main_ready).error(main_error);
}

function main_ready(data)
{
    $('#main_results').html(data);
    $(window).trigger('resize'); // will draw graph
    main_timeout = setTimeout(main_refresh, main_delay);
}

function main_error()
{
    console.log("main_error in coin.php");
    main_timeout = setTimeout(main_refresh, main_delay*2);
}

function showSellAmountDialog(marketname, address, marketid, bookmarkid)
{
    $("#dlgaddr").html(address);
    $("#sell-amount-dialog").dialog(
    {
        autoOpen: true,
        width: 400,
        height: 240,
        modal: true,
        title: 'Send $coin->symbol to '+marketname,

        buttons:
        {
            "Send / Sell": function()
            {
                amount = $('#input_sell_amount').val();
                if (marketid > 0)
                    window.location.href = '/market/sellto?id='+marketid+'&amount='+amount;
                else
                    window.location.href = '/site/bookmarkSend?id='+bookmarkid+'&amount='+amount;
            },
        }
    });
    return false;
}

</script>

<div id="sell-amount-dialog" style="display: none;">
<br>
Address: <span id="dlgaddr">xxxxxxxxxxxx</span><br><br>
Amount: <input type=text id="input_sell_amount" value="$sellamount">
<br>
</div>

END;

JavascriptReady("main_refresh();");

if ($coin->watch) {
    $this->renderPartial('coin_market_graph', array('coin'=>$coin));
    JavascriptReady("$(window).resize(graph_resized);");
}

coin_results.php
https://pastebin.com/kN2FPbXy
(抱歉,StackOverflow说我已超过字符数限制!:D)
/var/log/nginx/access.log

[my ip address] - - [18/Jan/2022:16:06:53 +0000] "GET /site/coin?id=1 HTTP/1.1" 200 2213 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
[my ip address] - - [18/Jan/2022:16:06:54 +0000] "GET /site/coin_results?id=1&rows=500&since=1641917213 HTTP/1.1" 500 75 "http://[server's ip address]/site/coin?id=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"

/var/log/nginx/error.log为空。

f2uvfpb9

f2uvfpb91#

ups:(如果你使用的是php 8,这是一个常见的错误
如果您查看您的控制面板,您将看到主显示为红色,这通常意味着MySQL的PHP问题或Mysql问题
php -v查看您的版本
你需要确保你有php7.2或php7.3和teh PDO扩展
请确保设置以下内容:

apt-get install software-properties-common
    sudo add-apt-repository -y ppa:ondrej/php
    sudo apt-get update

它们使用php7.3或7.2
php /usr/bin/php7.3中的文件系统管理器
再次检查您的服务器并查看IS 7.3
php -v型
检查您的nginx域配置并确保php-fpm是7.3或7.2版
如果你重启的话。Walla都能用
尝试使用https://github.com/Kudaraidee/yiimp.git的最新源代码版本的安装脚本
带有Kuraide源代码的更新脚本可在Github up Coleganet中获得,但实际上使用的是Docker Container和更高级的设置

相关问题