# SkyPilot 故障排除指南
## 安装问题
### 未找到云凭据
**错误**: `sky check` 显示云服务被禁用
**解决方案**:
bash
# AWS
aws configure
# 验证: aws sts get-caller-identity
# GCP
gcloud auth application-default login
# 验证: gcloud auth list
# Azure
az login
az account set -s
# Kubernetes
export KUBECONFIG=~/.kube/config
kubectl get nodes
# 配置后重新检查
sky check
### 权限错误
**错误**: `PermissionError` 或 `AccessDenied`
**解决方案**:
bash
# AWS: 确保 IAM 权限包含 EC2, S3, IAM
# 所需策略: AmazonEC2FullAccess, AmazonS3FullAccess, IAMFullAccess
# GCP: 确保角色包含 Compute Admin, Storage Admin
gcloud projects add-iam-policy-binding PROJECT_ID
--member="user:
[email protected]"
--role="roles/compute.admin"
# Azure: 确保订阅具有 Contributor 角色
az role assignment create
--assignee
[email protected]
--role Contributor
--scope /subscriptions/SUBSCRIPTION_ID
## 集群启动问题
### 配额超限
**错误**: `Quota exceeded for resource`
**解决方案**:
yaml
# 尝试不同的区域
resources:
accelerators: A100:8
any_of:
- cloud: gcp
region: us-west1
- cloud: gcp
region: europe-west4
- cloud: aws
region: us-east-1
# 或者向云提供商申请增加配额
bash
# 启动前检查配额
sky show-gpus --cloud gcp
### GPU 不可用
**错误**: `No resources available in region`
**解决方案**:
yaml
# 使用回退加速器
resources:
accelerators:
H100: 8
A100-80GB: 8
A100: 8
any_of:
- cloud: gcp
- cloud: aws
- cloud: azure
bash
# 检查 GPU 可用性
sky show-gpus A100
sky show-gpus --cloud aws
### 未找到实例类型
**错误**: `Instance type 'xyz' not found`
**解决方案**:
yaml
# 让 SkyPilot 自动选择实例
resources:
accelerators: A100:8
cpus: 96+
memory: 512+
# 除非必要,否则不要指定 instance_type
### 集群卡在 INIT 状态
**错误**: 集群保持在 INIT 状态
**解决方案**:
bash
# 检查集群日志
sky logs mycluster --status
# SSH 连接并手动检查
ssh mycluster
journalctl -u sky-supervisor
# 终止并重试
sky down mycluster
sky launch -c mycluster task.yaml
## 设置命令问题
### 设置脚本失败
**错误**: 设置命令在配置期间失败
**解决方案**:
yaml
# 添加错误处理和