{"record":{"id":"a653b722d1785087","repo":"serverless/serverless","slug":"either-albdnsname-or-functionurl-must-be-provided","errorCode":null,"errorMessage":"Either albDnsName or functionUrl must be provided for CloudFront origin","messagePattern":"Either albDnsName or functionUrl must be provided for CloudFront origin","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/engine/src/lib/aws/cloudfront.js","lineNumber":108,"sourceCode":"    } else if (functionUrl) {\n      // Lambda function URLs only support HTTPS\n      // Extract only the domain part (no protocol, no trailing slash or path)\n      originDomain = functionUrl.replace(/^https?:\\/\\//, '').replace(/\\/.*/, '')\n      originId = `${resourceNameBase}-lambda-origin`\n      customOriginConfig = {\n        HTTPPort: 443,\n        HTTPSPort: 443,\n        OriginProtocolPolicy: 'https-only',\n        OriginSslProtocols: {\n          Quantity: 1,\n          Items: ['TLSv1.2'],\n        },\n        OriginReadTimeout: 30,\n        OriginKeepaliveTimeout: 5,\n      }\n      originRequestPolicyId = 'b689b0a8-53d0-40ab-baf2-68738e2966ac' // Managed-CORS-S3Origin\n    } else {\n      throw new Error(\n        'Either albDnsName or functionUrl must be provided for CloudFront origin',\n      )\n    }\n\n    const distributionConfig = {\n      CallerReference: `${resourceNameBase}-${Date.now()}`,\n      Comment: `CloudFront distribution for ${resourceNameBase}`,\n      DefaultCacheBehavior: {\n        TargetOriginId: originId,\n        ViewerProtocolPolicy: 'redirect-to-https',\n        AllowedMethods: {\n          Quantity: 7,\n          Items: ['GET', 'HEAD', 'OPTIONS', 'PUT', 'PATCH', 'POST', 'DELETE'],\n          CachedMethods: {\n            Quantity: 3,\n            Items: ['GET', 'HEAD', 'OPTIONS'],\n          },\n        },","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/serverless/serverless/blob/b9d7ea51c8cce57cff1207964b9b71123673081f/packages/engine/src/lib/aws/cloudfront.js#L90-L126","documentation":"Returned by downloadFrameworkVersion (version.go:440) during the tar.TypeDir branch when os.MkdirAll(path, 0755) fails while creating a directory entry from the archive. The path traversal check already passed, so this is a filesystem-level failure.","triggerScenarios":"os.MkdirAll returns a non-nil error for a directory under releasePath — permission denied, disk full, read-only filesystem, or path-too-long (ENAMETOOLONG).","commonSituations":"Disk full during extraction; ~/.serverless/releases has restrictive permissions or is on a read-only volume; quota exceeded on a shared system; path length exceeds OS limits on Windows; antivirus locking directories on Windows.","solutions":["Check available disk space: df -h ~/.serverless","Verify permissions: ls -la ~/.serverless/releases and chmod or chown as needed","Clear old releases to free space: rm -rf ~/.serverless/releases/*","On Windows, check for antivirus interference and path-length limits (enable long path support)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check disk space and permissions before extraction\nfunc extractionPrecheck(releasesDir string) error {\n    if err := os.MkdirAll(releasesDir, 0755); err != nil {\n        return fmt.Errorf(\"cannot create releases dir: %w\", err)\n    }\n    // Check at least 200MB free for a typical framework archive\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := os.MkdirAll(path, 0755); err != nil {\n    if os.IsPermission(err) {\n        fmt.Fprintf(os.Stderr, \"permission denied creating %s — check ownership of ~/.serverless\\n\", path)\n    }\n    return \"\", fmt.Errorf(\"creating directory %s: %w\", path, err)\n}","preventionTips":["Ensure at least 200MB free disk space before installing","Verify ~/.serverless is owned by the current user","Clean old releases periodically: rm -rf ~/.serverless/releases/*","On Windows, check for antivirus locking extraction directories"],"tags":["filesystem","disk","permissions","tar","installer","go"],"backgroundTag":null,"analyzedSha":"b9d7ea51c8cce57cff1207964b9b71123673081f","analyzedAt":"2026-08-13T04:14:40.386Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}