Welcome to the Dash Forum!

Please sign up to discuss the most innovative cryptocurrency!

401 Unauthorized Error

Discussion in 'Development Tech Discussion' started by Emin, Oct 17, 2017.

  1. Emin

    Emin New Member

    Joined:
    Oct 17, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi everyone,

    I am trying to connect dashd but it gives an error.



    When I looked ~/.dash/dash.conf everything is ok.


    I am running dashd with this command.
    Error: Cannot obtain a lock on data directory /root/.dashcore. Dash Core is probably already running.



    I am tried with php
    jsonRPCClient it gives HTTP request failed! 401 Unauthorized
    shell_exec gives no output

    Do you have any idea ? It caused headache.


    PHP:
                $output        shell_exec('curl --user dashUser:dashPass --data-binary \'{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }\' -H \'content-type: text/plain;\' http ://127.0.0.1:9998/');
                
    $res           json_decode($output);
                
    print_r($res);


                
    $Dash           = new jsonRPCClient("http ://user:[email protected]:9998/");
                
    $num     $Dash->getblockcount();
                
    print_r($num);
     
  2. akhavr

    akhavr Active Member

    Joined:
    Oct 11, 2014
    Messages:
    755
    Likes Received:
    376
    Trophy Points:
    133
    Looks like you've forgot to restart your `dashd` after you've added `rpcport` option. Stop it via `dash-cli stop` and then start again.
     
  3. Emin

    Emin New Member

    Joined:
    Oct 17, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I reboot my server but still not works.
    I installed dashd again via PPA and everything is ok now. (I had installed manually via wget)

    Code:
    sudo add-apt-repository ppa:dash.org/dash
    sudo apt-get update
    sudo apt-get install dashd dash-qt
     
  4. thelazier

    thelazier Active Member

    Joined:
    Jan 5, 2015
    Messages:
    240
    Likes Received:
    184
    Trophy Points:
    103
    Dash Address:
    Xreiza1qGJMT5BpW6BDtRJqwtcBSxGwWYN
  5. thelazier

    thelazier Active Member

    Joined:
    Jan 5, 2015
    Messages:
    240
    Likes Received:
    184
    Trophy Points:
    103
    Dash Address:
    Xreiza1qGJMT5BpW6BDtRJqwtcBSxGwWYN