ZMQ Options Error #15808

issue in3rsha opened this issue on April 12, 2019
  1. in3rsha commented at 4:13 PM on April 12, 2019: contributor

    I am trying to enable ZMQ by adding the following options to my bitcoin.conf:

    zmqpubrawblock=tcp://127.0.0.1:28332
    zmqpubrawtx=tcp://127.0.0.1:28333
    

    However, when I start bitcoind with these options I get the following error:

    bitcoind: zmq/zmqpublishnotifier.cpp:104: virtual void CZMQAbstractPublishNotifier::Shutdown(): Assertion `psocket' failed.
    

    For what it's worth, this only seems to happen when I have both zmqpubrawblock and zmqpubrawtx enabled as options, but individually they work fine. For example:

    bitcoind --testnet -zmqpubrawblock=tcp://127.0.0.1:28332 # this works
    bitcoind --testnet -zmqpubrawtx=tcp://127.0.0.1:28333 # this works
    bitcoind --testnet -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28333 # error
    

    I've been following the guide at https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md, but it doesn't seem to explain why this is happening.

    What could be causing this error? Thanks in advance for any advice.


    EDIT: I tried to recreate this error on a different computer and the config works without error. I believe there may be an issue with the bitcoin.conf on the other computer. I will compare the two bitcoin.conf files to see if I can spot what may be causing this error.

    Nonetheless, I'd still be very interested in understanding what this particular error message indicates.

    EDIT 2: I believe this error may be caused due to multiple ZMQs using the same port at the same time (e.g. running bitcoind and bitcoind -testnet at the same time, and both are using the same bitcoin.conf with the same ZMQ ports set).

    Will check the ports on the other computer with ss -lntp to see if they're in use.

  2. fanquake added the label RPC/REST/ZMQ on Apr 12, 2019
  3. benthecarman commented at 6:16 PM on April 13, 2019: contributor

    You can't have mainnet and a testnet node using the same zmq port. You can use network specific options to differentiate the two.

  4. in3rsha closed this on Apr 20, 2019

  5. ysangkok cross-referenced this on Oct 18, 2019 from issue invalid zmq argument syntax on windows causes abort by ysangkok
  6. bitcoin locked this on Dec 16, 2021

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-05-20 06:54 UTC