Skip to content

Dashmate is incorrectly generating the rpcauth credentials on first restart #2497

Description

@ktechmidas

Expected Behavior

rpccredentials should be put inside dash.conf correctly when running dashmate restart after changing them in the config.json

Current Behavior

The password is 1234567

Hashing in dash.conf is as follows:
rpcauth=dashrpc:a512ab492f0faed0ba66e9240e34e961$5e001c5d08dd753958047e39d742154dee89d247af07ee237da751b0f72c9740

Change password to 123456789 in the config.json

Run dashmate restart

dashmate@hp-masternode-1:~/.dashmate$ curl http://127.0.0.1:20002 --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getbestblockhash", "params": []}' -H 'Content-Type: application/json' --user dashrpc:123456789 -X POST -i
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm="jsonrpc"
Date: Fri, 14 Mar 2025 09:07:48 GMT
Content-Length: 0
Content-Type: text/html; charset=ISO-8859-1

Hashing as follows:
rpcauth=dashrpc:8463fda0e18385de17be64d5f4ba7aa6$26245e43ea7593569d0a1c41940dce498ef1a78f434ea83a239e2fb87ad391ad

Run dashmate restart again without changing the config and curl works:

dashmate@hp-masternode-1:~/.dashmate$ curl http://127.0.0.1:20002 --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getbestblockhash", "params": []}' -H 'Content-Type: application/json' --user dashrpc:123456789 -X POST -i
HTTP/1.1 200 OK
Content-Type: application/json
Date: Fri, 14 Mar 2025 09:09:27 GMT
Content-Length: 107

{"result":"000000e808c758463dbf41480e1a579ab5b05b96c146b094838c309d3ad8b01d","error":null,"id":"curltest"}

Hashing is as follows in the dash.conf

rpcauth=dashrpc:6b4e1f9358596c8bf19cd4cf219278f3$e38553ba9b93b0ab0e953dbee8ea8723f20a3ec1ec4b56724bdefd6d0765dd29

Possible Solution

As we can see, the hashing changes between the two restarts. The first restart appears not to read the config file with an updated password correctly.

Steps to Reproduce (for bugs)

Steps above

Context

This bug ensures rpc can't be connected to properly with a password change until two dashmate restarts have been done

Your Environment

  • Version used: 2.0.0-dev.1
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
  • Operating System and version (desktop, server, or mobile): Ubuntu 24.04 server
  • Link to your project:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdashmateDashmate relatedeffort: SSmall effort — a few hours or lesspriority: lowLow priority — nice to havepriority: mediumMedium priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions