flipped-aurora/gin-vue-admin · error
下载技能失败: %w
Error message
下载技能失败: %w
What it means
The HTTP transport itself failed when POSTing to the skill marketplace (http.DefaultClient.Do returned an error). This means no HTTP response was received: DNS resolution failure, connection refused/timeout, TLS handshake failure, or a request-context cancellation.
Source
Thrown at server/service/system/sys_skills.go:410
}
body, err := json.Marshal(map[string]interface{}{
"plugin_id": req.ID,
"version": req.Version,
})
if err != nil {
return fmt.Errorf("构建下载请求失败: %w", err)
}
downloadReq, err := http.NewRequest(http.MethodPost, "https://plugin.gin-vue-admin.com/api/shopPlugin/downloadSkill", bytes.NewReader(body))
if err != nil {
return fmt.Errorf("构建下载请求失败: %w", err)
}
downloadReq.Header.Set("Content-Type", "application/json")
downloadResp, err := http.DefaultClient.Do(downloadReq)
if err != nil {
return fmt.Errorf("下载技能失败: %w", err)
}
defer downloadResp.Body.Close()
if downloadResp.StatusCode != http.StatusOK {
return fmt.Errorf("下载技能失败, HTTP状态码: %d", downloadResp.StatusCode)
}
metaBody, err := io.ReadAll(downloadResp.Body)
if err != nil {
return fmt.Errorf("读取下载结果失败: %w", err)
}
var meta struct {
Data struct {
URL string `json:"url"`
} `json:"data"`
}
if err = json.Unmarshal(metaBody, &meta); err != nil {View on GitHub (pinned to 3136500ef3)
Solutions
- Check outbound network/DNS from the server: curl -v https://plugin.gin-vue-admin.com/api/shopPlugin/downloadSkill
- Confirm HTTPS (443) egress is allowed by firewall/security groups; configure HTTP_PROXY/HTTPS_PROXY if behind a proxy
- If using a custom CA or TLS-intercepting proxy, add it to the system trust store
- Retry later if the marketplace is down; surface the wrapped error via errors.Unwrap to see the net.OpError cause
Defensive patterns
Strategy: retry
Validate before calling
conn, err := net.DialTimeout("tcp", "plugin.gin-vue-admin.com:443", 5*time.Second)
if err != nil { /* no egress to marketplace; short-circuit */ }
else { conn.Close() } Type guard
func isNetworkErr(err error) bool {
var ne net.Error
return errors.As(err, &ne) || errors.Is(err, syscall.ECONNREFUSED) || errors.Is(err, context.DeadlineExceeded)
} Try / catch
if err := DownloadOnlineSkill(ctx, req); err != nil {
var ne net.Error
if errors.As(errors.Unwrap(errors.Unwrap(err)), &ne) {
// transient network failure: retry with backoff or surface 'network unavailable'
}
} Prevention
- Ensure outbound HTTPS (443) egress from the server; document proxy vars
- Set a timeout on the HTTP client instead of http.DefaultClient
- Add retry with exponential backoff for marketplace calls
- Monitor DNS resolution in the deployment environment
When it happens
Trigger: Calling the skill download API when the server has no internet access, DNS for plugin.gin-vue-admin.com fails, the marketplace is down, a firewall/proxy blocks outbound HTTPS (443), or TLS interception breaks the handshake.
Common situations: Air-gapped or intranet-only deployments; expired system CA roots breaking TLS; corporate proxies requiring configuration; marketplace outage; no proxy env vars in containers.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
AI-assisted analysis of flipped-aurora/gin-vue-admin@3136500ef3 (2026-08-31).
Data as JSON: /api/errors/b26229c3f96e7f76.
Report an issue: GitHub.