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

 找回密码
 立即注册
楼主: muxiachuixue

[学习笔记] 手把手教你解决HACS无法访问github问题:无需科学上网

  [复制链接]

3

主题

194

帖子

1591

积分

金牌会员

Rank: 6Rank: 6

积分
1591
金钱
1397
HASS币
15
发表于 2022-4-22 14:16:14 | 显示全部楼层
只使用了自动更新hosts的脚本,刚开始还好,今天提示错误,日志如下:
Logger: homeassistant.components.shell_command
Source: components/shell_command/__init__.py:83
Integration: Shell Command (documentation, issues)
First occurred: 06:01:00 (3 occurrences)
Last logged: 14:01:00

Timed out running command: `sh /config/github_docker_hosts_update.sh`, after: 60s
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/streams.py", line 517, in _wait_for_data
    await self._waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/subprocess.py", line 196, in communicate
    stdin, stdout, stderr = await tasks._gather(stdin, stdout, stderr,
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 492, in wait_for
    fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/shell_command/__init__.py", line 83, in async_service_handler
    stdout_data, stderr_data = await asyncio.wait_for(
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 494, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
回复

使用道具 举报

3

主题

194

帖子

1591

积分

金牌会员

Rank: 6Rank: 6

积分
1591
金钱
1397
HASS币
15
发表于 2022-4-22 14:52:28 | 显示全部楼层
OliverY 发表于 2022-4-22 14:16
只使用了自动更新hosts的脚本,刚开始还好,今天提示错误,日志如下:
Logger: homeassistant.components.s ...

自己解决了,可能是hosts的源改了格式,调整了一下更新脚本代码就可以了
#! /bin/bash
# github mirror updating script written by chuixue
# mirror source from: https://github.com/521xueweihan/GitHub520

# get the new hosts from the internet. You can change the source if you have a better one.
curl 'https://raw.hellogithub.com/hosts' > github_hosts.log

# remove the lines between "github hosts start" and "github hosts end" in /etc/hosts
echo "$(sed '/# github520 hosts start; Do not remove or change this line/,/# github520 hosts end; Do not remove or change this line/d' /etc/hosts)" > /etc/hosts

# add the start and end lines
sh -c 'echo "# github520 hosts start; Do not remove or change this line
# github hosts end; Do not remove or change this line" >> /etc/hosts'

# insert the new hosts into /etc/hosts
echo "$(sed '/# github520 hosts start; Do not remove or change this line/r github_hosts.log' /etc/hosts)" > /etc/hosts

回复

使用道具 举报

0

主题

4

帖子

45

积分

新手上路

Rank: 1

积分
45
金钱
41
HASS币
0
发表于 2022-4-27 13:32:08 | 显示全部楼层
谢谢分享,最近镜像不好连接!
回复

使用道具 举报

0

主题

19

帖子

214

积分

中级会员

Rank: 3Rank: 3

积分
214
金钱
195
HASS币
0
发表于 2022-4-30 19:39:44 | 显示全部楼层
感谢大神
回复

使用道具 举报

0

主题

1

帖子

16

积分

新手上路

Rank: 1

积分
16
金钱
15
HASS币
0
发表于 2022-5-19 02:26:04 | 显示全部楼层

感谢大神,终于能下载集成了
回复

使用道具 举报

1

主题

107

帖子

1376

积分

金牌会员

Rank: 6Rank: 6

积分
1376
金钱
1269
HASS币
0
发表于 2022-5-27 12:58:10 | 显示全部楼层
按照楼主的方式配置了,好像无法自动更新github地址,手动运行sh是可以更新的,但是放在pack里的自动化不会运行那个sh,手动去点执行也不会更改
回复

使用道具 举报

0

主题

6

帖子

64

积分

注册会员

Rank: 2

积分
64
金钱
58
HASS币
0
发表于 2022-7-23 23:58:01 | 显示全部楼层
新手学习,又找回当年的感觉了
回复

使用道具 举报

0

主题

6

帖子

103

积分

注册会员

Rank: 2

积分
103
金钱
97
HASS币
0
发表于 2022-8-28 10:07:37 | 显示全部楼层
最新的文件无法读取是怎么回事
回复

使用道具 举报

5

主题

357

帖子

2046

积分

金牌会员

Rank: 6Rank: 6

积分
2046
金钱
1674
HASS币
60
 楼主| 发表于 2022-8-28 10:51:43 | 显示全部楼层
po9873 发表于 2022-8-28 10:07
最新的文件无法读取是怎么回事

好了,估计传的时候网络有问题
回复

使用道具 举报

1

主题

66

帖子

566

积分

高级会员

Rank: 4

积分
566
金钱
500
HASS币
0
发表于 2022-8-29 16:58:41 | 显示全部楼层
muxiachuixue 发表于 2022-8-28 10:51
好了,估计传的时候网络有问题

大神,配置文件是不是今天不能用了,昨天配置新的文件都可以新增集成,今天就新安装集成不行了,更新集成也不行了。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-20 03:10 , Processed in 0.428004 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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