" #25080"> " #25080"> walletpassphrase gives error "must request wallet RPC through /wallet/<filename>" #25080

walletpassphrase gives error "must request wallet RPC through /wallet/<filename>" #25080

issue dynamo-foundation opened this issue on May 7, 2022
  1. dynamo-foundation commented at 7:21 AM on May 7, 2022: none

    When issuing an RPC for walletpassphrase, the following error is returned:

    {"result":null,"error":{"code":-19,"message":"Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path)."},"id":0}

    Documentation from here: https://bitcoincore.org/en/doc/0.20.0/rpc/wallet/walletpassphrase/ states sample call looks like this: _As a JSON-RPC call

    curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "walletpassphrase", "params": ["my pass phrase", 60]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/_ (e.g. no /wallet/<filename> in the RPC)

    Further, my issue stems from wallet names with embedded spaces, for example "encrypted with space". QT allows for the creation of wallet names with spaces (and other characters), which are not valid in a URI, at least as plain text.

    The CLI functions as expected when issued with the rpcwallet parameter, and allows for spaces because the wallet name is enclosed in double quotes.

    At a minimum the docs should reflect the proper usage of the RPC call, however its unclear how support for wallet names with internal spaces would be supported at all given the current design. A better design would be to add the wallet name as a parameter in the array to avoid using different URIs which is inconsistent with the usage of all other RPCs in core.

    BTC 0.21

  2. dynamo-foundation added the label Bug on May 7, 2022
  3. MarcoFalke removed the label Bug on May 7, 2022
  4. MarcoFalke added the label Questions and Help on May 7, 2022
  5. MarcoFalke added the label Wallet on May 7, 2022
  6. MarcoFalke added the label RPC/REST/ZMQ on May 7, 2022
  7. dynamo-foundation commented at 6:49 PM on May 7, 2022: none

    I'm going to have to disagree with you. This is not a question or help. The RPC does not support URL encoded wallet names with spaces. If you have a wallet name with an embedded space and you issue an RPC like

    http://192.168.4.48:6433/wallet/encrypted+with+space

    It fails with "wallet not found", which is a bug. The wallet does exist; the RPC doesnt properly handle embedded spaces. I will highlight the RPC code issues shortly.

  8. achow101 commented at 6:53 PM on May 7, 2022: member

    I believe you can percent encode the spaces.

  9. dynamo-foundation commented at 8:12 PM on May 7, 2022: none

    %20 did it - still feels very hacky - this is not really a URI - thats a data parameter

    line 14 of url.cpp, parameter 2 should be "true" not "false" - to allow support for + to space translation of what is clearly a data param and not a URI

  10. dynamo-foundation closed this on May 7, 2022

  11. DrahtBot locked this on May 7, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me