Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.81 KB | None | 0 0
  1. src/public/test/test_rabbit_helper.py:3 (test_hunt_rabbit)
  2. self = <amqp.transport.TCPTransport object at 0x11260c400>, host = 'rabbitmq'
  3. port = 5672, timeout = 5
  4.  
  5. def _connect(self, host, port, timeout):
  6. e = None
  7.  
  8. # Below we are trying to avoid additional DNS requests for AAAA if A
  9. # succeeds. This helps a lot in case when a hostname has an IPv4 entry
  10. # in /etc/hosts but not IPv6. Without the (arguably somewhat twisted)
  11. # logic below, getaddrinfo would attempt to resolve the hostname for
  12. # both IP versions, which would make the resolver talk to configured
  13. # DNS servers. If those servers are for some reason not available
  14. # during resolution attempt (either because of system misconfiguration,
  15. # or network connectivity problem), resolution process locks the
  16. # _connect call for extended time.
  17. addr_types = (socket.AF_INET, socket.AF_INET6)
  18. addr_types_num = len(addr_types)
  19. for n, family in enumerate(addr_types):
  20. # first, resolve the address for a single address family
  21. try:
  22. entries = socket.getaddrinfo(
  23. > host, port, family, socket.SOCK_STREAM, SOL_TCP)
  24.  
  25. ../../../../venv/lib/python3.6/site-packages/amqp/transport.py:137:
  26. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  27.  
  28. host = 'rabbitmq', port = 5672, family = <AddressFamily.AF_INET6: 30>
  29. socktype = <SocketKind.SOCK_STREAM: 1>, proto = 6, flags = 0
  30.  
  31. def getaddrinfo(host, port, family=0, socktype=0, proto=0, flags=0):
  32. """Replacement for Python's socket.getaddrinfo
  33.  
  34. This does the A and AAAA lookups asynchronously after which it
  35. calls the OS' getaddrinfo(3) using the AI_NUMERICHOST flag. This
  36. flag ensures getaddrinfo(3) does not use the network itself and
  37. allows us to respect all the other arguments like the native OS.
  38. """
  39. if isinstance(host, six.string_types):
  40. host = host.encode('idna').decode('ascii')
  41. if host is not None and not is_ip_addr(host):
  42. qname, addrs = _getaddrinfo_lookup(host, family, flags)
  43. else:
  44. qname = host
  45. addrs = [host]
  46. aiflags = (flags | socket.AI_NUMERICHOST) & (0xffff ^ socket.AI_CANONNAME)
  47. res = []
  48. err = None
  49. for addr in addrs:
  50. try:
  51. ai = socket.getaddrinfo(addr, port, family,
  52. socktype, proto, aiflags)
  53. except socket.error as e:
  54. if flags & socket.AI_ADDRCONFIG:
  55. err = e
  56. continue
  57. raise
  58. res.extend(ai)
  59. if not res:
  60. if err:
  61. raise err
  62. > raise socket.gaierror(socket.EAI_NONAME, 'No address found')
  63. E socket.gaierror: [Errno 8] No address found
  64.  
  65. ../../../../venv/lib/python3.6/site-packages/eventlet/support/greendns.py:537: gaierror
  66.  
  67. During handling of the above exception, another exception occurred:
  68.  
  69. def test_hunt_rabbit():
  70. service = "user_service"
  71. method = "check_token"
  72. params = {"token": "blbej_token"}
  73. > result = hunt_rabbit(service=service, method=method, params=params)
  74.  
  75. test_rabbit_helper.py:8:
  76. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  77. ../rabbit_helper.py:35: in hunt_rabbit
  78. with ClusterRpcProxy(config) as cluster_rpc:
  79. ../../../../venv/lib/python3.6/site-packages/nameko/standalone/rpc.py:222: in __enter__
  80. return self.start()
  81. ../../../../venv/lib/python3.6/site-packages/nameko/standalone/rpc.py:228: in start
  82. self._reply_listener.setup()
  83. ../../../../venv/lib/python3.6/site-packages/nameko/rpc.py:260: in setup
  84. self.queue_consumer.register_provider(self)
  85. ../../../../venv/lib/python3.6/site-packages/nameko/standalone/rpc.py:123: in register_provider
  86. self._setup_consumer()
  87. ../../../../venv/lib/python3.6/site-packages/nameko/standalone/rpc.py:102: in _setup_consumer
  88. channel = self.connection.channel()
  89. ../../../../venv/lib/python3.6/site-packages/kombu/connection.py:288: in channel
  90. chan = self.transport.create_channel(self.connection)
  91. ../../../../venv/lib/python3.6/site-packages/kombu/connection.py:837: in connection
  92. self._connection = self._establish_connection()
  93. ../../../../venv/lib/python3.6/site-packages/kombu/connection.py:792: in _establish_connection
  94. conn = self.transport.establish_connection()
  95. ../../../../venv/lib/python3.6/site-packages/kombu/transport/pyamqp.py:130: in establish_connection
  96. conn.connect()
  97. ../../../../venv/lib/python3.6/site-packages/amqp/connection.py:311: in connect
  98. self.transport.connect()
  99. ../../../../venv/lib/python3.6/site-packages/amqp/transport.py:77: in connect
  100. self._connect(self.host, self.port, self.connect_timeout)
  101. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  102.  
  103. self = <amqp.transport.TCPTransport object at 0x11260c400>, host = 'rabbitmq'
  104. port = 5672, timeout = 5
  105.  
  106. def _connect(self, host, port, timeout):
  107. e = None
  108.  
  109. # Below we are trying to avoid additional DNS requests for AAAA if A
  110. # succeeds. This helps a lot in case when a hostname has an IPv4 entry
  111. # in /etc/hosts but not IPv6. Without the (arguably somewhat twisted)
  112. # logic below, getaddrinfo would attempt to resolve the hostname for
  113. # both IP versions, which would make the resolver talk to configured
  114. # DNS servers. If those servers are for some reason not available
  115. # during resolution attempt (either because of system misconfiguration,
  116. # or network connectivity problem), resolution process locks the
  117. # _connect call for extended time.
  118. addr_types = (socket.AF_INET, socket.AF_INET6)
  119. addr_types_num = len(addr_types)
  120. for n, family in enumerate(addr_types):
  121. # first, resolve the address for a single address family
  122. try:
  123. entries = socket.getaddrinfo(
  124. host, port, family, socket.SOCK_STREAM, SOL_TCP)
  125. entries_num = len(entries)
  126. except socket.gaierror:
  127. # we may have depleted all our options
  128. if n + 1 >= addr_types_num:
  129. # if getaddrinfo succeeded before for another address
  130. # family, reraise the previous socket.error since it's more
  131. # relevant to users
  132. raise (e
  133. if e is not None
  134. else socket.error(
  135. > "failed to resolve broker hostname"))
  136. E OSError: failed to resolve broker hostname
  137.  
  138. ../../../../venv/lib/python3.6/site-packages/amqp/transport.py:148: OSError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement