401 Unauthorized Error

Emin

New Member
Oct 17, 2017
2
0
1
35
Hi everyone,

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

Message: fopen(http ://[email protected]:9998/): failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized


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

rpcuser=dashUser
rpcpassword=dashPass
server=1
daemon=1
rpcallowip=127.0.0.1
rpcport=9998
#paytxfee=0.0003

I am running dashd with this command.
/usr/bin/dashd -deamon
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);
 

akhavr

Active Member
Oct 11, 2014
837
414
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.
 

Emin

New Member
Oct 17, 2017
2
0
1
35
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