站点 bug 维修记录

两年多没有更新网站了,这两年,我完成了从一名大厂工程师到连续创业者的转变。

网站由于年久失修,存在了许多 bug,比如部分友链 404,阅读量统计失效等等,由于代码丢失,拖了两年才在旧电脑上找到这份代码,将所有 bug 修好后,发布此篇,以作记录。

RSA host key for github.com has changed. Could not read from remote repository

1
2
3
4
5
6
7
8
9
10
11
12
RSA host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

at ChildProcess.<anonymous> (D:\hexoblog\node_modules\hexo-util\lib\spawn.js:37:17)
at ChildProcess.emit (events.js:182:13)
at ChildProcess.cp.emit (D:\hexoblog\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:961:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)

1、如果git config -l 没有输出,在 git 设置一下身份的名字和邮箱,

1
2
3
git config --global user.name "yourname"

git config --global user.email "your@email.com"

yourname 必须与 github 的用户名一致

这里 your@email.com 必须与 github 登录邮箱一致

2、删除.ssh文件夹下的 known_hosts 文件(该文件主要作用是域名解析)

3、ssh-keygen -t rsa -C “your@email.com"(填写github对应的邮箱)

一路回车即可,yes,无需输入

4、在 github 设置界面新增SSH key 将 id_rsa.pub 里面的内容添加到如图中的 Key 上,Title 可随意。

Host key verification failed.

Could not read from remote repository

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

at ChildProcess.<anonymous> (D:\hexoblog\node_modules\hexo-util\lib\spawn.js:37:17)
at ChildProcess.emit (events.js:182:13)
at ChildProcess.cp.emit (D:\hexoblog\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:961:16)
at Socket.stream.socket.on (internal/child_process.js:380:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close [as _onclose] (net.js:596:12)

这是错误是因为本地的博客版本与远程的版本不一致,解决方法是删除博客目录下的.deploy_git文件夹,然后克隆远程的仓库到博客目录里面,然后改名字为.deploy_git。

will not add file alias

1
2
3
4
5
6
7
fatal: will not add file alias 'categories/Python/index.html' ('categories/python/index.html' already exists in index)

at ChildProcess.<anonymous> (D:\hexoblog\node_modules\hexo-util\lib\spawn.js:37:17)
at ChildProcess.emit (events.js:182:13)
at ChildProcess.cp.emit (D:\hexoblog\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:961:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)

解决办法,把 ./deploy_git/.git/config 里面的 ignorecase 值改成 false

评论丢失

评论是保存在 LeanCloud 的,由于 LeanCloud 服务升级,代码丢失无法按期修改 appid 和 appkey,之前的评论数据全部丢失了,现在的评论是重开的。

兄弟站点

已于 2022 年初新开兄弟站点 https://buyixiao.github.io/,更多有趣好玩实用的 tools,欢迎来玩

本文标题:站点 bug 维修记录

文章作者:月小水长

发布时间:2023年06月28日 - 09:06

最后更新:2023年06月28日 - 10:06

原始链接:https://inspurer.github.io/2023/06/28/站点-bug-维修记录/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

您的赞助将鼓励我继续创作!
-------------本文结束感谢阅读-------------