{"record":{"id":"8b1c7e4c75f6acdc","repo":"hashicorp/terraform","slug":"provider-mirror-does-not-have-archive-index-for-pr","errorCode":null,"errorMessage":"provider mirror does not have archive index for previously-reported %s version %s","messagePattern":"provider mirror does not have archive index for previously-reported (.+?) version (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/getproviders/http_mirror_source.go","lineNumber":194,"sourceCode":"\t)\n\n\tstatusCode, body, finalURL, err := s.get(ctx, endpointPath)\n\tdefer func() {\n\t\tif body != nil {\n\t\t\tbody.Close()\n\t\t}\n\t}()\n\tif err != nil {\n\t\treturn PackageMeta{}, s.errQueryFailed(provider, err)\n\t}\n\n\tswitch statusCode {\n\tcase http.StatusOK:\n\t\t// Great!\n\tcase http.StatusNotFound:\n\t\t// A 404 Not Found for a version we previously saw in index.json is\n\t\t// a protocol error, so we'll report this as \"query failed.\n\t\treturn PackageMeta{}, s.errQueryFailed(provider, fmt.Errorf(\"provider mirror does not have archive index for previously-reported %s version %s\", provider, version))\n\tcase http.StatusUnauthorized, http.StatusForbidden:\n\t\treturn PackageMeta{}, s.errUnauthorized(finalURL)\n\tdefault:\n\t\treturn PackageMeta{}, s.errQueryFailed(provider, fmt.Errorf(\"server returned unsuccessful status %d\", statusCode))\n\t}\n\n\t// If we got here then the response had status OK and so our body\n\t// will be non-nil and should contain some JSON for us to parse.\n\tvar bodyContent ListInstallationPackagesResponseBody\n\n\tdec := json.NewDecoder(body)\n\tif err := dec.Decode(&bodyContent); err != nil {\n\t\treturn PackageMeta{}, s.errQueryFailed(provider, fmt.Errorf(\"invalid response content from mirror server: %s\", err))\n\t}\n\n\tarchiveMeta, ok := bodyContent.Archives[target.String()]\n\tif !ok {\n\t\treturn PackageMeta{}, ErrPlatformNotSupported{","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/getproviders/http_mirror_source.go#L176-L212","documentation":"In the package-meta fetch path, a 404 on a specific version that was previously advertised in the version index is treated as a protocol error: the mirror told us a version exists but then cannot serve its archive index. The error names the provider and version to make the inconsistency explicit.","triggerScenarios":"`PackageMeta` GET for a previously listed `<provider>/<version>/index.json` returns `http.StatusNotFound`; error at http_mirror_source.go:194.","commonSituations":"Mirror index was regenerated/changed between the version-list request and the version-detail request; partial mirror sync; CDN cache desync where list is fresh but detail is stale; concurrent mirror update removing a version.","solutions":["Retry `terraform init` (the mirror may have finished syncing).","Re-sync or rebuild the mirror so the version list and per-version indexes agree.","Invalidate CDN caches for the mirror.","Pin the provider version to one that is consistently available on the mirror."],"exampleFix":"// before: stale CDN returns 404 for a listed version\n$ terraform init -> provider mirror does not have archive index ... version 4.50.0\n// after: flush cache and re-init\n$ mirror-cdn purge /hashicorp/aws/4.50.0/index.json\n$ terraform init","handlingStrategy":"retry","validationCode":"// Verify the version still exists right before requesting detail\nversions, err := s.AvailableVersions(ctx, provider)\nif err != nil { return err }\nif _, ok := versions.Find(version); !ok {\n    return ErrProviderVersionNotFound{Provider: provider, Version: version}\n}","typeGuard":null,"tryCatchPattern":"// Retry once: the index may be repopulating\nerr := retryDo(ctx, 2, backoff, func() error {\n    _, e := s.PackageMeta(ctx, provider, version, target)\n    return e\n})","preventionTips":["Atomic mirror updates (write to a new prefix, then swap).","Purge CDN caches atomically with content swaps.","Pin provider versions that are stable on the mirror.","Avoid concurrent reindexing windows."],"tags":["network","mirror","consistency","registry"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}