{"slug": "the-day-dns-broke-our-deployment-solving-a-serverless-framework-s3-resolution-on", "title": "The Day DNS Broke Our Deployment: Solving a Serverless Framework S3 Resolution Failure on AWS", "summary": "A developer encountered a complete deployment failure of a serverless AI application on AWS due to a DNS resolution error. The error EAI_AGAIN indicated a temporary DNS lookup failure on the local machine, not an AWS outage. Switching to reliable public DNS servers like 8.8.8.8 and 1.1.1.1 resolved the issue, and the team added safeguards such as retry logic and pre-deployment connectivity checks.", "body_md": "As engineers, we often spend hours optimizing code, improving prompts, and scaling infrastructure.\n\nBut sometimes the biggest production issues come from something much simpler.\n\nA DNS lookup.\n\nRecently, while deploying a serverless AI application to AWS, I encountered an error that completely blocked deployment.\n\nThe application hadn't changed.\n\nAWS was healthy.\n\nPermissions were correct.\n\nThe deployment package was valid.\n\nYet every deployment failed.\n\nThe error looked like this:\n\n```\nError:\ngetaddrinfo EAI_AGAIN serverless-framework-deployments-eu-north-1-xxxxxxxx.s3.eu-north-1.amazonaws.com\n```\n\nAt first glance, it looked like an AWS outage.\n\nIt wasn't.\n\nThis is the story of how a simple DNS resolution issue brought an entire deployment pipeline to a halt—and how we fixed it.\n\nThe application was an AI-powered Due Diligence Platform built with:\n\nDeployment flow:\n\n```\nDeveloper\n     ↓\nServerless Framework\n     ↓\nS3 Deployment Bucket\n     ↓\nCloudFormation\n     ↓\nLambda Functions\n```\n\nEvery deployment package is first uploaded to an S3 bucket created by the Serverless Framework.\n\nOnly after the upload succeeds does CloudFormation update the stack.\n\nDuring deployment, the terminal suddenly returned:\n\n```\nserverless deploy\n\n✖ Error:\ngetaddrinfo EAI_AGAIN serverless-framework-deployments-eu-north-1-xxxxxxxx.s3.eu-north-1.amazonaws.com\n```\n\nThe deployment stopped immediately.\n\nNo Lambda updates.\n\nNo CloudFormation changes.\n\nNothing.\n\nThe first thing I checked was AWS Service Health.\n\nEverything was operational.\n\nNo incidents were reported.\n\nThe next suspect was permissions.\n\nI verified:\n\n```\naws sts get-caller-identity\n```\n\nResponse:\n\n```\n{\n  \"Account\": \"123456789012\",\n  \"Arn\": \"arn:aws:iam::123456789012:user/developer\"\n}\n```\n\nCredentials were valid.\n\nPermissions were correct.\n\nStill failing.\n\nI upgraded Serverless Framework.\n\n```\nnpm install -g serverless\n```\n\nDeployment still failed.\n\nThe key clue was:\n\n```\nEAI_AGAIN\n```\n\nThis is not an AWS error.\n\nIt is a DNS resolution error.\n\nSpecifically:\n\n```\nEAI_AGAIN\n=\nTemporary DNS lookup failure\n```\n\nThe operating system could not resolve the S3 endpoint hostname.\n\nThe request never reached AWS.\n\nI manually tested DNS resolution:\n\n```\nnslookup google.com\n```\n\nIntermittent failures appeared.\n\nThen:\n\n```\nnslookup s3.eu-north-1.amazonaws.com\n```\n\nThe same issue occurred.\n\nThis confirmed that the problem existed locally.\n\nNot in AWS.\n\nThe machine was using an unstable DNS resolver.\n\nUnder heavy network usage, DNS lookups occasionally timed out.\n\nWhen Serverless Framework attempted to upload artifacts to S3:\n\n```\nServerless\n      ↓\nDNS Lookup\n      ↓\nFailure\n      ↓\nDeployment Stops\n```\n\nNo connection to AWS was ever established.\n\nWe switched to reliable public DNS servers.\n\nLinux:\n\n```\nsudo nano /etc/resolv.conf\n```\n\nAdded:\n\n```\nnameserver 8.8.8.8\nnameserver 1.1.1.1\n```\n\nThen restarted networking:\n\n```\nsudo systemctl restart NetworkManager\n```\n\nAfter updating DNS:\n\n```\nnslookup s3.eu-north-1.amazonaws.com\n```\n\nReturned instantly.\n\nDeployment succeeded:\n\n```\nserverless deploy\n```\n\nOutput:\n\n```\n✔ Service deployed successfully\n```\n\nTo avoid future issues, we added several safeguards.\n\n```\nserverless deploy || serverless deploy\n```\n\nUseful for CI/CD jobs when transient network issues occur.\n\nBefore deployment:\n\n```\ncurl https://s3.eu-north-1.amazonaws.com\n```\n\nIf connectivity fails:\n\n```\nStop deployment\n```\n\nThis prevents wasting build minutes on doomed deployments.\n\nAdded:\n\n```\naws sts get-caller-identity\n```\n\nto deployment pipelines.\n\nThis immediately detects expired or invalid credentials.\n\nThe biggest lesson was simple:\n\n**Not every AWS deployment error is actually an AWS problem.**\n\nSometimes:\n\nAnd the cloud gets blamed.\n\nWhen deployment issues occur, I now follow this order:\n\n```\naws sts get-caller-identity\nping google.com\nnslookup s3.eu-north-1.amazonaws.com\naws s3 ls\nserverless deploy\n```\n\nThis process has saved hours of troubleshooting.\n\nAs engineers, we often expect complex problems to have complex causes.\n\nThis incident reminded me that some of the most disruptive failures originate from the most basic layers of infrastructure.\n\nA single DNS lookup failure stopped an entire deployment pipeline.\n\nThe code was correct.\n\nAWS was healthy.\n\nThe architecture was sound.\n\nBut none of that mattered until the network could resolve a hostname.\n\nSometimes the fastest fix isn't changing code.\n\nIt's understanding where the request actually fails.\n\nBefore blaming AWS:\n\nYou'll save yourself hours of debugging.", "url": "https://wpnews.pro/news/the-day-dns-broke-our-deployment-solving-a-serverless-framework-s3-resolution-on", "canonical_source": "https://dev.to/saif_urrahman/the-day-dns-broke-our-deployment-solving-a-serverless-framework-s3-resolution-failure-on-aws-2kad", "published_at": "2026-06-24 12:03:50+00:00", "updated_at": "2026-06-24 12:09:04.508369+00:00", "lang": "en", "topics": ["developer-tools", "ai-infrastructure"], "entities": ["AWS", "Serverless Framework", "S3", "CloudFormation", "Lambda", "Google DNS", "Cloudflare DNS"], "alternates": {"html": "https://wpnews.pro/news/the-day-dns-broke-our-deployment-solving-a-serverless-framework-s3-resolution-on", "markdown": "https://wpnews.pro/news/the-day-dns-broke-our-deployment-solving-a-serverless-framework-s3-resolution-on.md", "text": "https://wpnews.pro/news/the-day-dns-broke-our-deployment-solving-a-serverless-framework-s3-resolution-on.txt", "jsonld": "https://wpnews.pro/news/the-day-dns-broke-our-deployment-solving-a-serverless-framework-s3-resolution-on.jsonld"}}