第 5 章 对 RHEL Lightspeed 支持的命令行助手进行故障排除
在安装和使用由 RHEL Lightspeed 支持的命令行助手时诊断和解决问题。请注意,这不是详尽的列表。
无法找到 TLS 证书文件,无效的路径: /etc/pki/consumer/cert.pem
当您询问有关命令行助手的问题且助手失败,因为因为存在无效的路径而无法找到 TLS 证书文件,这可能意味着您的系统没有被注册。
要解决错误,请确保您注册系统。按照以下步骤操作:
检查系统是否已注册:
subscription-manager identity
# subscription-manager identity
如果系统没有注册,请使用以下命令来注册系统:
subscription-manager register --username <username> --password <password>
# subscription-manager register --username <username> --password <password>
与服务器通信错误
当您尝试在您的系统中运行 c
命令时,会失败并显示以下错误:
🙁 Communication error with the server: HTTPSConnectionPool(host='cert.console.redhat.com', port=443): Max retries exceeded with url: /api/lightspeed/v1/infer (Caused by ProtocolError('Connection aborted.', PermissionError(13, 'Permission denied'))). Please try again in a few minutes.
🙁 Communication error with the server: HTTPSConnectionPool(host='cert.console.redhat.com', port=443): Max retries exceeded with url: /api/lightspeed/v1/infer (Caused by ProtocolError('Connection aborted.', PermissionError(13, 'Permission denied'))). Please try again in a few minutes.
要解决这个问题,重启命令行助手守护进程(clad)并重新运行 c
命令:
systemctl restart clad c “<Your_question>”
$ systemctl restart clad
$ c “<Your_question>”
附加文件时发出警告
当您尝试运行 c
命令并尝试附加文件时,您会收到警告信息:
"错误:您的问题和上下文总数(478.46 KB)超过 2.00 KB 的限制。修剪它以适合预期大小,您可能会丢失一些上下文"。
这是因为助手对客户端有 2KB 的限制。
Clad 没有正确重新载入更新的证书
当您尝试以非 root 用户身份运行 clad
时,clad
不会正确重新载入更新的证书。/etc/pki/consumer
下的证书需要归 root 所有,因为它必须访问仅可由 root 读取的文件。
要解决错误,将 key.pem
权限改为 root,并以 root 身份运行 clad
命令。
sudo ls -l /etc/pki/consumer/ sudo chown $(whoami):$(id -gn) /etc/pki/consumer/${KEY_NAME}
$ sudo ls -l /etc/pki/consumer/
$ sudo chown $(whoami):$(id -gn) /etc/pki/consumer/${KEY_NAME}