『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 6012|回复: 6

[求助] 百度TTS报错,大神帮忙分析一下,然后怎么解决

[复制链接]

16

主题

331

帖子

2412

积分

金牌会员

Rank: 6Rank: 6

积分
2412
金钱
2081
HASS币
0
发表于 2020-12-17 20:20:40 | 显示全部楼层 |阅读模式
本帖最后由 wyh260595711 于 2020-12-17 20:21 编辑

微信图片_20201217202113.png
HTTPSConnectionPool(host='aip.baidubce.com', port=443): Max retries exceeded with url: /oauth/2.0/token?grant_type=client_credentials&client_id=XXXXXXXXXlient_secret=XXXXXXXXX (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fbaa4232048>: Failed to establish a new connection: [Errno -3] Try again'))
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 57, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/local/lib/python3.7/socket.py", line 748, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 603, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 344, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 843, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 316, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fbaa4232048>: Failed to establish a new connection: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 641, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 399, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='aip.baidubce.com', port=443): Max retries exceeded with url: /oauth/2.0/token?grant_type=client_credentials&client_id=XXXXXXXXXlient_secret=XXXXXXXXX (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fbaa4232048>: Failed to establish a new connection: [Errno -3] Try again'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1150, in async_call
    self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1172, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 143, in async_say_handle
    options=options
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 312, in async_get_url
    engine, key, message, use_cache, language, options)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 324, in async_get_tts_audio
    message, language, options)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/baidu/tts.py", line 129, in get_tts_audio
    message, language, 1, speech_data
  File "/usr/local/lib/python3.7/site-packages/aip/speech.py", line 92, in synthesis
    result = self._request(self.__ttsUrl, data)
  File "/usr/local/lib/python3.7/site-packages/aip/base.py", line 91, in _request
    authObj = self._auth()
  File "/usr/local/lib/python3.7/site-packages/aip/base.py", line 167, in _auth
    ), proxies=self._proxies).json()
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='aip.baidubce.com', port=443): Max retries exceeded with url: /oauth/2.0/token?grant_type=client_credentials&client_id=XXXXXXXXXlient_secret=XXXXXXXXX (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fbaa4232048>: Failed to establish a new connection: [Errno -3] Try again')
TTS文件夹也没有产生音频文件
一段时间没折腾HA了,最近试了试TTS突然不能用了,很久以前是可以正常使用,求大神帮忙解决解决,先谢过啦
回复

使用道具 举报

16

主题

331

帖子

2412

积分

金牌会员

Rank: 6Rank: 6

积分
2412
金钱
2081
HASS币
0
 楼主| 发表于 2020-12-22 16:24:51 | 显示全部楼层
果然木有大神出手了嘛?
回复

使用道具 举报

16

主题

331

帖子

2412

积分

金牌会员

Rank: 6Rank: 6

积分
2412
金钱
2081
HASS币
0
 楼主| 发表于 2020-12-24 18:46:46 | 显示全部楼层
继续盯一下~~~
回复

使用道具 举报

16

主题

331

帖子

2412

积分

金牌会员

Rank: 6Rank: 6

积分
2412
金钱
2081
HASS币
0
 楼主| 发表于 2020-12-31 16:53:12 | 显示全部楼层
大神大神 来来来
回复

使用道具 举报

25

主题

640

帖子

2913

积分

金牌会员

Rank: 6Rank: 6

积分
2913
金钱
2263
HASS币
40
发表于 2020-12-31 19:04:32 | 显示全部楼层
不是说Max retries exceeded.
如果很久不用的话,确认一下api key和secret key是否跟百度服务上的一致
回复

使用道具 举报

16

主题

331

帖子

2412

积分

金牌会员

Rank: 6Rank: 6

积分
2412
金钱
2081
HASS币
0
 楼主| 发表于 2021-1-4 16:11:38 | 显示全部楼层
sasukebinbin 发表于 2020-12-31 19:04
不是说Max retries exceeded.
如果很久不用的话,确认一下api key和secret key是否跟百度服务上的一致 ...

一致的,特意把原来的删了再重新建了一个,还是这么报错
回复

使用道具 举报

16

主题

331

帖子

2412

积分

金牌会员

Rank: 6Rank: 6

积分
2412
金钱
2081
HASS币
0
 楼主| 发表于 2021-1-14 08:34:55 来自手机 | 显示全部楼层
问题依旧,不知道咋解决
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 07:53 , Processed in 0.317839 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表