wazo-calld: impossible to get trunk status, conference etc. on slower machines
Description
Zendesk Ticket IDs
None
relates to
Activity
Show:
Done
Details
Details
Priority
Assignee
Sébastien Duthil
Sébastien DuthilReporter
Sébastien Duthil
Sébastien DuthilFix versions
Labels
Zendesk Support
Linked Tickets1
Zendesk Support

Linked Tickets
1
Created September 14, 2020 at 4:21 PM
Updated September 14, 2020 at 5:02 PM
Resolved September 14, 2020 at 4:23 PM
Given I installed Wazo Platform on a slow machine (more precisely: wazo-auth takes > 2seconds to generate a token)
Given have a trunk
When I get the status of the trunk
Then I get a 503 error
Then I see in the `/var/log/wazo-calld.log` a lot of errors like
```
2020-09-14 18:15:43,661 [2290] (ERROR) (xivo.pubsub): 401 Client Error: for url: http://localhost:9486/1.1/trunks?recurse=True
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/xivo/pubsub.py", line 39, in publish_one
callback(message)
File "/usr/lib/python3/dist-packages/wazo_calld/plugins/endpoints/bus.py", line 43, in on_hangup
endpoint.remove_call(unique_id)
File "/usr/lib/python3.7/contextlib.py", line 119, in exit
next(self.gen)
File "/usr/lib/python3/dist-packages/wazo_calld/plugins/endpoints/services.py", line 107, in update
self._notify_fn(endpoint)
File "/usr/lib/python3/dist-packages/wazo_calld/plugins/endpoints/notifier.py", line 28, in endpoint_updated
trunk = self._confd_cache.get_trunk(endpoint.techno, endpoint.name)
File "/usr/lib/python3/dist-packages/wazo_calld/plugins/endpoints/services.py", line 169, in get_trunk
return self._get_endpoint_by_index(techno, name, self._trunks, index='name')
File "/usr/lib/python3/dist-packages/wazo_calld/plugins/endpoints/services.py", line 208, in _get_endpoint_by_index
self._initialize()
File "/usr/lib/python3/dist-packages/wazo_calld/plugins/endpoints/services.py", line 219, in _initialize
trunks = self._confd.trunks.list(recurse=True)['items']
File "/usr/lib/python3/dist-packages/wazo_confd_client/crud.py", line 70, in list
response = self.session.get(url, headers=headers, params=kwargs)
File "/usr/lib/python3/dist-packages/wazo_confd_client/session.py", line 55, in get
self.check_response(response, check_response)
File "/usr/lib/python3/dist-packages/wazo_confd_client/session.py", line 33, in check_response
response.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: for url: http://localhost:9486/1.1/trunks?recurse=True
```
Expected: I can get the status of the trunk
Technical details: the timeout for wazo-auth was 2 seconds.