test: Test failed when running p2p_addr_relay.py #22819

issue nourou4them opened this issue on August 27, 2021
  1. nourou4them commented at 1:54 PM on August 27, 2021: none

    When running the p2p_addr_relay.py test on a WSL (ubuntu1804), I encountered a KeyError exception. It was on the following stage : "Check that we only relay addresses to inbound peers who have previously sent us addr related messages". The missing key is the "addr_relay_enabled". It seems there is no reference or previous dictionary where to find it.

    Here are the logs:

    2021-08-26T10:16:27.071000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_tbpvrrpg 2021-08-26T10:16:27.783000Z TestFramework (INFO): Send an addr message that is too large 2021-08-26T10:16:27.952000Z TestFramework (INFO): Test address relay 2021-08-26T10:16:27.953000Z TestFramework (INFO): Check that addr message content is relayed and added to addrman 2021-08-26T10:16:29.611000Z TestFramework (INFO): Check relay of addresses received from outbound peers 2021-08-26T10:16:29.968000Z TestFramework (INFO): Check that the first addr message received from an outbound peer is not relayed 2021-08-26T10:16:30.021000Z TestFramework (INFO): Check that subsequent addr messages sent from an outbound peer are relayed 2021-08-26T10:16:30.175000Z TestFramework (INFO): Check address relay to outbound peers 2021-08-26T10:16:30.581000Z TestFramework (INFO): Check that addresses are relayed to full outbound peers 2021-08-26T10:16:30.581000Z TestFramework (INFO): Check that addresses are not relayed to block-relay-only outbound peers 2021-08-26T10:16:30.584000Z TestFramework (INFO): Check that we only relay addresses to inbound peers who have previously sent us addr related messages 2021-08-26T10:16:30.895000Z TestFramework (ERROR): Key error Traceback (most recent call last): File "/home/nourou/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main self.run_test() File "p2p_addr_relay.py", line 86, in run_test self.inbound_blackhole_tests() File "p2p_addr_relay.py", line 214, in inbound_blackhole_tests assert_equal(peerinfo[0]['addr_relay_enabled'], True) # addr_source KeyError: 'addr_relay_enabled' 2021-08-26T10:16:30.586000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendaddrv2() 2021-08-26T10:16:30.586000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_verack() 2021-08-26T10:16:30.586000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendheaders() 2021-08-26T10:16:30.587000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendcmpct(announce=False, version=2) 2021-08-26T10:16:30.587000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendcmpct(announce=False, version=1) 2021-08-26T10:16:30.587000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_ping(nonce=3f51963ece3a99e0) 2021-08-26T10:16:30.587000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_pong(nonce=3f51963ece3a99e0) 2021-08-26T10:16:30.587000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_getheaders(locator=CBlockLocator(vHave=[23807444962857534591630102868443165169099872195127563234000810727149388982010, 447397901073913437177306182676806822084817164934125609 01130905383743091755536, 12663556118629435951519719937229071722250511777495500151983207830672125396536, 44153859904987177378521432406456967833959290357169379249027894378362945782348, 6949721849041576887560731018902390530686828028312945809877884568294648915735, 7838396004 4691199607349080946738357045163442094918920687129393... (msg truncated) 2021-08-26T10:16:30.587000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_feefilter(feerate=000003e8) 2021-08-26T10:16:30.634000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_ping(nonce=00000001) 2021-08-26T10:16:30.635000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_pong(nonce=00000001) 2021-08-26T10:16:30.686000Z TestFramework.p2p (DEBUG): Connecting to Bitcoin Node: 127.0.0.1:15188 2021-08-26T10:16:30.687000Z TestFramework.p2p (DEBUG): Connected & Listening: 127.0.0.1:15188 2021-08-26T10:16:30.687000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_version(nVersion=70016 nServices=9 nTime=Thu Aug 26 12:16:30 2021 addrTo=CAddress(nServices=1 net=IPv4 addr=127.0.0.1 port=15188) addrFrom=CAddress(nServices=1 net=IPv4 addr=0.0.0 .0 port=0) nNonce=0xCDE1539BE4DD0287 strSubVer=/python-p2p-tester:0.0.3/ nStartingHeight=-1 relay=1) 2021-08-26T10:16:30.688000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_version(nVersion=70016 nServices=1033 nTime=Thu Aug 26 12:56:27 2021 addrTo=CAddress(nServices=0 net=IPv4 addr=0.0.0.0 port=0) addrFrom=CAddress(nServices=1033 net=IPv4 addr =0.0.0.0 port=0) nNonce=0x1BB1500D2D875110 strSubVer=/Satoshi:21.99.0(testnode0)/ nStartingHeight=200 relay=1) 2021-08-26T10:16:30.688000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_verack() 2021-08-26T10:16:30.689000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_getaddr() 2021-08-26T10:16:30.689000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_wtxidrelay() 2021-08-26T10:16:30.689000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendaddrv2() 2021-08-26T10:16:30.689000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_verack() 2021-08-26T10:16:30.689000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendheaders() 2021-08-26T10:16:30.690000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendcmpct(announce=False, version=2) 2021-08-26T10:16:30.690000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendcmpct(announce=False, version=1) 2021-08-26T10:16:30.690000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_ping(nonce=ce6d7861bf58d32e) 2021-08-26T10:16:30.690000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_pong(nonce=ce6d7861bf58d32e) 2021-08-26T10:16:30.690000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_getheaders(locator=CBlockLocator(vHave=[23807444962857534591630102868443165169099872195127563234000810727149388982010, 447397901073913437177306182676806822084817164934125609 01130905383743091755536, 12663556118629435951519719937229071722250511777495500151983207830672125396536, 44153859904987177378521432406456967833959290357169379249027894378362945782348, 6949721849041576887560731018902390530686828028312945809877884568294648915735, 7838396004 4691199607349080946738357045163442094918920687129393... (msg truncated) 2021-08-26T10:16:30.690000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_feefilter(feerate=000003e8) 2021-08-26T10:16:30.737000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_ping(nonce=00000001) 2021-08-26T10:16:30.738000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_pong(nonce=00000001) 2021-08-26T10:16:30.790000Z TestFramework.p2p (DEBUG): Connecting to Bitcoin Node: 127.0.0.1:15188 2021-08-26T10:16:30.791000Z TestFramework.p2p (DEBUG): Connected & Listening: 127.0.0.1:15188 2021-08-26T10:16:30.791000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_version(nVersion=70016 nServices=9 nTime=Thu Aug 26 12:16:30 2021 addrTo=CAddress(nServices=1 net=IPv4 addr=127.0.0.1 port=15188) addrFrom=CAddress(nServices=1 net=IPv4 addr=0.0.0 .0 port=0) nNonce=0xC03B06A32F1618AC strSubVer=/python-p2p-tester:0.0.3/ nStartingHeight=-1 relay=1) 2021-08-26T10:16:30.792000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_version(nVersion=70016 nServices=1033 nTime=Thu Aug 26 12:56:27 2021 addrTo=CAddress(nServices=0 net=IPv4 addr=0.0.0.0 port=0) addrFrom=CAddress(nServices=1033 net=IPv4 addr =0.0.0.0 port=0) nNonce=0x162B7EC1F6F7DD53 strSubVer=/Satoshi:21.99.0(testnode0)/ nStartingHeight=200 relay=1) 2021-08-26T10:16:30.792000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_verack() 2021-08-26T10:16:30.792000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_wtxidrelay() 2021-08-26T10:16:30.793000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendaddrv2() 2021-08-26T10:16:30.793000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_verack() 2021-08-26T10:16:30.793000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendheaders() 2021-08-26T10:16:30.793000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendcmpct(announce=False, version=2) 2021-08-26T10:16:30.793000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendcmpct(announce=False, version=1) 2021-08-26T10:16:30.793000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_ping(nonce=d1be045bb8729d13) 2021-08-26T10:16:30.794000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_pong(nonce=d1be045bb8729d13) 2021-08-26T10:16:30.794000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_getheaders(locator=CBlockLocator(vHave=[23807444962857534591630102868443165169099872195127563234000810727149388982010, 447397901073913437177306182676806822084817164934125609 01130905383743091755536, 12663556118629435951519719937229071722250511777495500151983207830672125396536, 44153859904987177378521432406456967833959290357169379249027894378362945782348, 6949721849041576887560731018902390530686828028312945809877884568294648915735, 7838396004 4691199607349080946738357045163442094918920687129393... (msg truncated) 2021-08-26T10:16:30.794000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_feefilter(feerate=000003e8) 2021-08-26T10:16:30.841000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_ping(nonce=00000001) 2021-08-26T10:16:30.842000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_pong(nonce=00000001) 2021-08-26T10:16:30.895000Z TestFramework (ERROR): Key error Traceback (most recent call last): File "/home/nourou/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main self.run_test() File "p2p_addr_relay.py", line 86, in run_test self.inbound_blackhole_tests() File "p2p_addr_relay.py", line 214, in inbound_blackhole_tests assert_equal(peerinfo[0]['addr_relay_enabled'], True) # addr_source KeyError: 'addr_relay_enabled' 2021-08-26T10:16:30.937000Z TestFramework (DEBUG): Closing down network thread 2021-08-26T10:16:30.988000Z TestFramework (INFO): Stopping nodes 2021-08-26T10:16:30.989000Z TestFramework.node0 (DEBUG): Stopping node 2021-08-26T10:16:31.417000Z TestFramework.node0 (DEBUG): Node stopped 2021-08-26T10:16:31.417000Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_tbpvrrpg 2021-08-26T10:16:31.418000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_tbpvrrpg/test_framework.log

  2. 0xB10C commented at 2:46 PM on August 27, 2021: member

    On what branch / commit are you? You run git log -1 and post the output here.

  3. nourou4them commented at 2:58 PM on August 27, 2021: none

    Here is the result:

    commit d3203a99d886177eee9d1f9cd8411e215118a4e6 (HEAD -> master, origin/master, origin/HEAD) Merge: ec6db8e85 7c33e3a57 Author: Hennadii Stepanov 32963518+hebasto@users.noreply.github.com Date: Mon Aug 23 22:08:32 2021 +0300

    Merge bitcoin-core/gui#408: Add missing mnemonics in menu bar options
    
    7c33e3a572b62536566247f237031010bcf4ecb2 qt: Add missing mnemonics in menu bar options (Shashwat)
    
    Pull request description:
    
      Since [#362](/bitcoin-bitcoin/362/) we have defaulted to add mnemonic shortcuts for the context menus.
      The Window -> Minimize option and File -> Load PSBT from clipboard were hitherto missing a mnemonic shortcut. This PR adds mnemonic shortcuts for them
    
      Changes introduced in this PR:
      | Master | PR |
      | ----------| ---- |
      | ![Screenshot from 2021-08-23 23-10-07](https://user-images.githubusercontent.com/85434418/130494098-c65ec9da-c3f1-4243-9b3d-0c87cb677825.png) | ![Screenshot from 2021-08-23 23-08-41](https://user-images.githubusercontent.com/85434418/130494083-849ffd14-05e9-4a6d-

    bdc3-b3e55b8a8861.png)| |Screenshot from 2021-08-23 23-10-21|![Screenshot from 2021-08-23 23-09-00](https://user-images.githubusercontent.com/85434418/130494181-dcdbf119-a2c6-469d-a6c 9-3021506ab40b.png)|

    ACKs for top commit:
      jarolrod:
        tACK 7c33e3a572b62536566247f237031010bcf4ecb2
      hebasto:
        ACK 7c33e3a572b62536566247f237031010bcf4ecb2, tested on Linux Mint 20.2 (Qt 5.12.8).
    
    Tree-SHA512: 32f201ae7716b19ca123856292f8bfa0d805f6c7271ac1b5e08eff6b95017443754c8a76e8396ccca1869a57384e11016cbd99d63ccdd2fae6da4eaf3ae32298
  4. nourou4them commented at 3:02 PM on August 27, 2021: none

    I just run git pull, and still the same error.

  5. jonatack commented at 3:07 PM on August 27, 2021: member

    When running the p2p_addr_relay.py test on a WSL (ubuntu1804), I encountered a KeyError exception. It was on the following stage : "_Check that we only relay addresses to inbound peers who have > > File "p2p_addr_relay.py", line 214, in inbound_blackhole_tests

    assert_equal(peerinfo[0]['addr_relay_enabled'], True) # addr_source KeyError: 'addr_relay_enabled'

    That is the first assert on addr_relay_enabled in the test file. My guess is you are running the test on a build that pre-dates the merge of #21528. In other words, you not only need to git pull but also build.

  6. nourou4them commented at 7:01 PM on August 27, 2021: none

    Yes I just did that and tests were successful. Thanks for your help @jonatack.

  7. nourou4them closed this on Aug 27, 2021

  8. DrahtBot locked this on Aug 27, 2022

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-29 03:14 UTC

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