Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pika could not take port from context_tracking_host #1144

Closed
davidlatwe opened this issue Oct 26, 2021 · 0 comments · Fixed by #1145
Closed

Pika could not take port from context_tracking_host #1144

davidlatwe opened this issue Oct 26, 2021 · 0 comments · Fixed by #1145

Comments

@davidlatwe
Copy link
Contributor

My value of config.context_tracking_host is formated as host:port, which works before #1140 . Now with the latest Rez, following error shows when I requesting a context.

16:31:29 DEBUG    Using SelectPoller
16:31:29 DEBUG    Created default connection workflow <rez.vendor.pika.adapters.utils.connection_workflow.AMQPConnectionWorkflow object at 0x0000021B371FE278>
16:31:29 DEBUG    Starting AMQP Connection workflow asynchronously.
16:31:29 DEBUG    call_later: added timeout <rez.vendor.pika.adapters.select_connection._Timeout object at 0x0000021B371FE2E8> with deadline=1469717.828 and callback=functools.partial(<bound method AMQPConnectionWorkflow._start_new_cycle_async of <rez.vendor.pika.adapters.utils.connection_workflow.AMQPConnectionWorkflow object at 0x0000021B371FE278>>, first=True); now=1469717.828; delay=0
16:31:29 DEBUG    Beginning a new AMQP connection workflow cycle; attempts remaining after this: 0
16:31:29 DEBUG    call_later: added timeout <rez.vendor.pika.adapters.select_connection._Timeout object at 0x0000021B371FE0B8> with deadline=1469717.828 and callback=<bound method AMQPConnectionWorkflow._try_next_config_async of <rez.vendor.pika.adapters.utils.connection_workflow.AMQPConnectionWorkflow object at 0x0000021B371FE278>>; now=1469717.828; delay=0
16:31:29 DEBUG    _try_next_config_async: '192.168.1.65:5672':5672
16:31:29 ERROR    Address resolution failed: gaierror(11001, 'getaddrinfo failed')
16:31:29 DEBUG    process_timeouts: invoking callback=<bound method _AddressResolver._dispatch_result of <rez.vendor.pika.adapters.utils.selector_ioloop_adapter._AddressResolver object at 0x0000021B371FE320>>
16:31:29 DEBUG    add_callback_threadsafe: added callback=<bound method _AddressResolver._dispatch_result of <rez.vendor.pika.adapters.utils.selector_ioloop_adapter._AddressResolver object at 0x0000021B371FE320>>
16:31:29 DEBUG    Invoking asynchronous getaddrinfo() completion callback; host='192.168.1.65:5672'
16:31:29 ERROR    getaddrinfo failed: gaierror(11001, 'getaddrinfo failed').
16:31:29 ERROR    AMQP connection workflow failed: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - gaierror(11001, 'getaddrinfo failed'); first exception - None.
16:31:29 ERROR    AMQPConnectionWorkflow - reporting failure: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - gaierror(11001, 'getaddrinfo failed'); first exception - None
16:31:29 ERROR    Connection workflow failed: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - gaierror(11001, 'getaddrinfo failed'); first exception - None
16:31:29 ERROR    Error in _create_connection().
Traceback (most recent call last):
  File "C:\Users\davidlatwe.lai\pipeline\rez\src\rez\vendor\pika\adapters\blocking_connection.py", line 452, in _create_connection
    raise self._reap_last_connection_workflow_error(error)
  File "C:\Users\davidlatwe.lai\pipeline\rez\src\rez\vendor\pika\adapters\utils\selector_ioloop_adapter.py", line 567, in _resolve
    self._flags)
  File "C:\miniconda3\envs\avalon\lib\socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
16:31:29 ERROR    Cannot connect to the message broker: [Errno 11001] getaddrinfo failed

Note these two lines

16:31:29 DEBUG    _try_next_config_async: '192.168.1.65:5672':5672
16:31:29 ERROR    Address resolution failed: gaierror(11001, 'getaddrinfo failed')

It appears that you have to split the host and port from url before feed into pika.

https://github.com/nerdvegas/rez/blob/b12cd4f2aefa48056f41517d90c0a3ed7f4c9a66/src/rez/utils/amqp.py#L69-L73

Another possible route is by pika.connection.URLParameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant