Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

"TextHTTPError: Not Found" when calling API method getSiteEnvVars

Đang mở
#7,709 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
api, cli

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lệnh getSiteEnvVars được ghi trong tài liệu bằng Netlify CLI và curl, sau đó so sánh đường dẫn được yêu cầu với thao tác OpenAPI tại URL tài liệu được liên kết. Theo dõi cách CLI xây dựng yêu cầu getSiteEnvVars và xác minh rằng endpoint và tài liệu sử dụng đường dẫn dự định mà không bị lặp /api/v1; được xem là hoàn tất khi lệnh thực thi thành công đối với một site hiện có.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

type: bug
Describe the bug

I am trying to retrieve information on site environment variables via getEnvVars and getSiteEnvVars using curl and the Netlify CLI. The combination of getSiteEnvVars with Netlify CLI fails for me with TextHTTPError: Not Found. Maybe it's just a typo in my commands, but I don't see it.

I have noticed that in the documentation when clicking on
GET /api/v1/sites/{site_id}/env
it shows
https://api.netlify.com/api/v1/api/v1/sites/{site_id}/env
This is wrong (duplicate /api/v1). Might be unrelated, but if I try with that path I get a Not Found error with curl too.

Steps to reproduce
  • make sure Netlify CLI and curl are installed and variables MY_TOKEN, MY_ACCOUNT_ID and MY_SITE_ID are set and point to an existing account / site.
  • run the following commands
# getEnvVars via curl
curl -s -H "Authorization: Bearer ${MY_TOKEN}" "https://api.netlify.com/api/v1/accounts/${MY_ACCOUNT_ID}/env?site_id=${MY_SITE_ID}"
# getSiteEnvVars via curl
curl -s -H "Authorization: Bearer ${MY_TOKEN}" "https://api.netlify.com/api/v1/sites/${MY_SITE_ID}/env"
# getEnvVars via CLI
netlify api getEnvVars --data '{ "account_id": "'${MY_ACCOUNT_ID}'", "site_id": "'${MY_SITE_ID}'" }'
# getSiteEnvVars via CLI
netlify api getSiteEnvVars --data '{ "site_id": "'${MY_SITE_ID}'" }'
  • see that the last command fails with exit code 1 and error message → › TextHTTPError: Not Found
Configuration

(no local project needed)

Environment

System:
OS: macOS 26.0.1
Shell: 5.9 - /opt/homebrew/bin/zsh
Binaries:
Node: 22.20.0 - /Users/johndoe/.nvm/versions/node/v22.20.0/bin/node
npm: 11.6.2 - /Users/johndoe/.nvm/versions/node/v22.20.0/bin/npm
npmGlobalPackages:
netlify-cli: 23.9.1

Ngôn ngữ chính
TypeScript
Star
1.9k
Fork
480
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
66

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của netlify/cli

Tất cả issue của netlify/cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.