# Error for some requests with Watson TTS

**URL:** https://community.openconversational.ai/t/error-for-some-requests-with-watson-tts/12046
**Category:** This category is being retired - Support
**Created:** [March 22, 2022, 6:56pm UTC](https://community.openconversational.ai/t/error-for-some-requests-with-watson-tts/12046 "2022-03-22T18:56:35Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![BlueStone](https://community.openconversational.ai/user_avatar/community.openconversational.ai/bluestone/32/3587_2.png) [@BlueStone](https://community.openconversational.ai/u/BlueStone)
#### Post date: [March 22, 2022, 6:56pm UTC](https://community.openconversational.ai/t/error-for-some-requests-with-watson-tts/12046/1 "2022-03-22T18:56:35Z")

</div>

Hey there!  
I recently switched to Watson TTS for German speech synthesis and it works great most of the time!  
But if I haven’t let Mycroft say something for a longer interval of time, the first thing he says will always fail for some reason, meaning that he simply has no audio output, but the answer is still visible in the CLI.  
The error in the audio.log file looks as follows:

```auto
2022-03-22 18:16:59.354 | ERROR | 699 | mycroft.audio.speech:mute_and_speak:134 | TTS execution failed.
Traceback (most recent call last):
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 449, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 444, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.7/http/client.py", line 1352, in getresponse
    response.begin()
  File "/usr/lib/python3.7/http/client.py", line 310, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.7/http/client.py", line 271, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib/python3.7/ssl.py", line 1052, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib/python3.7/ssl.py", line 911, in read
    return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/requests/adapters.py", line 450, in send
    timeout=timeout
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 786, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 550, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/urllib3/packages/six.py", line 770, in reraise
    raise value
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 710, in urlopen
    chunked=chunked,
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 451, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 341, in _raise_timeout
    self, url, "Read timed out. (read timeout=%s)" % timeout_value
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.eu-de.text-to-speech.watson.cloud.ibm.com', port=443): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/mycroft-core/mycroft/tts/remote_tts.py", line 54, in execute
    self.__play(req)
  File "/home/pi/mycroft-core/mycroft/tts/remote_tts.py", line 83, in __play
    resp = req.result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/requests/adapters.py", line 532, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.eu-de.text-to-speech.watson.cloud.ibm.com', port=443): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/mycroft-core/mycroft/audio/speech.py", line 129, in mute_and_speak
    tts.execute(utterance, ident, listen)
  File "/home/pi/mycroft-core/mycroft/tts/remote_tts.py", line 56, in execute
    LOG.error(e.message)
AttributeError: 'ReadTimeout' object has no attribute 'message'

```

Maybe someone understands how to possibly fix this ☹

Best regards,  
Elias.

---

<div class="post-metadata">

### Author: ![goldyfruit](https://community.openconversational.ai/user_avatar/community.openconversational.ai/goldyfruit/32/2741_2.png) [@goldyfruit](https://community.openconversational.ai/u/goldyfruit)
#### Post date: [March 22, 2022, 9:05pm UTC](https://community.openconversational.ai/t/error-for-some-requests-with-watson-tts/12046/2 "2022-03-22T21:05:47Z")

</div>

> [@BlueStone](#):
>
> ```auto
> requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.eu-de.text-to-speech.watson.cloud.ibm.com', port=443): Read timed out. (read timeout=10)
> 
> ```

Seems to be related to your network according to this message:

```auto
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.eu-de.text-to-speech.watson.cloud.ibm.com', port=443): Read timed out. (read timeout=10)

```

Mycroft is not able to reach the TTS.

---

<div class="post-metadata">

### Author: ![BlueStone](https://community.openconversational.ai/user_avatar/community.openconversational.ai/bluestone/32/3587_2.png) [@BlueStone](https://community.openconversational.ai/u/BlueStone)
#### Post date: [March 22, 2022, 10:11pm UTC](https://community.openconversational.ai/t/error-for-some-requests-with-watson-tts/12046/3 "2022-03-22T22:11:36Z")

</div>

Thanks for your answer, but it can’t be related to the network, as utterances that require web information to be retrieved work just fine. Their output is visible, but the audio output fails…

---

<div class="post-metadata">

### Author: ![goldyfruit](https://community.openconversational.ai/user_avatar/community.openconversational.ai/goldyfruit/32/2741_2.png) [@goldyfruit](https://community.openconversational.ai/u/goldyfruit)
#### Post date: [March 22, 2022, 10:24pm UTC](https://community.openconversational.ai/t/error-for-some-requests-with-watson-tts/12046/4 "2022-03-22T22:24:20Z")

</div>

From your Mycroft instance, are you able to ping `api.eu-de.text-to-speech.watson.cloud.ibm.com`?

---

<div class="post-metadata">

### Author: ![BlueStone](https://community.openconversational.ai/user_avatar/community.openconversational.ai/bluestone/32/3587_2.png) [@BlueStone](https://community.openconversational.ai/u/BlueStone)
#### Post date: [March 23, 2022, 7:42am UTC](https://community.openconversational.ai/t/error-for-some-requests-with-watson-tts/12046/5 "2022-03-23T07:42:43Z")

</div>

> [@BlueStone](#):
>
> `api.eu-de.text-to-speech.watson.cloud.ibm.com`

Yes, it is working just as expected in all instances.

---

<div class="post-metadata">

### Author: ![goldyfruit](https://community.openconversational.ai/user_avatar/community.openconversational.ai/goldyfruit/32/2741_2.png) [@goldyfruit](https://community.openconversational.ai/u/goldyfruit)
#### Post date: [March 23, 2022, 2:52pm UTC](https://community.openconversational.ai/t/error-for-some-requests-with-watson-tts/12046/6 "2022-03-23T14:52:57Z")

</div>

I did some tests and it works fine for me.

Voice: `en-US_AllisonV3Voice`  
Region: `us-south`

No timeouts.

```auto
10:46:28.293 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.us-south.text-to-speech.watson.cloud.ibm.com:443
2022-03-23 10:46:29.303 | DEBUG | 1 | urllib3.connectionpool | https://api.us-south.text-to-speech.watson.cloud.ibm.com:443 "GET /instances/XXXXXXXXXXXXX/v1/synthesize?accept=audio%2Fwav&LOCALE=en-us&voice=en-US_AllisonV3Voice&X-Watson-Learning-Opt-Out=true&text=It%27s+currently+0+degrees. HTTP/1.1" 200 None
10:46:29.303 - urllib3.connectionpool - DEBUG - https://api.us-south.text-to-speech.watson.cloud.ibm.com:443 "GET /instances/XXXXXXXXXXXXX/v1/synthesize?accept=audio%2Fwav&LOCALE=en-us&voice=en-US_AllisonV3Voice&X-Watson-Learning-Opt-Out=true&text=It%27s+currently+0+degrees. HTTP/1.1" 200 None

```

Do you have any firewall rules?

---

<div class="post-metadata">

### Author: ![BlueStone](https://community.openconversational.ai/user_avatar/community.openconversational.ai/bluestone/32/3587_2.png) [@BlueStone](https://community.openconversational.ai/u/BlueStone)
#### Post date: [March 24, 2022, 8:57am UTC](https://community.openconversational.ai/t/error-for-some-requests-with-watson-tts/12046/7 "2022-03-24T08:57:33Z")

</div>

Weird ☹ I just checked and I don’t have any firewall rules…  
I really have no idea what seems to be the problem, as a second request right after the first one fails always works…
