Troubleshooting with Kiro

How to use Kiro IDE to diagnose and fix code errors, deployment failures, and AWS issues — without needing to understand the error yourself.

The Golden Rule

When something breaks, copy the error and paste it into Kiro. That's it. Kiro reads the error, understands the context of your project, and tells you exactly what to fix.

You don't need to understand the error message. You just need to give Kiro enough context:

  1. The error message — copy the full text
  2. Where it happened — which file, which step, which service
  3. What you were trying to do — one sentence is enough

Fixing Code Errors

🐍 Python / Lambda Error

Your Lambda function throws an error like ImportError, KeyError, TypeError, or returns a 500 response.

What to do:

  1. Open the failing file in Kiro (e.g. backend/lambda/app.py)
  2. Paste the error into Kiro chat:
Paste into Kiro chat
This Lambda function is throwing an error. Here's the error from CloudWatch logs:

[paste the full error traceback here]

Fix it.
Include the full traceback — not just the last line. Kiro uses the full stack trace to pinpoint the exact issue.
🌐 Frontend JavaScript Error

Your app shows a blank page, buttons don't work, or the browser console shows errors.

What to do:

  1. Open browser DevTools (F12 or Cmd+Option+I) → Console tab
  2. Copy the red error messages
  3. Open frontend/index.html in Kiro and paste:
Paste into Kiro chat
My frontend is broken. Browser console shows this error:

[paste error here]

The file is open. Fix it.
🔗 CORS Error

Browser console shows: Access to fetch at '...' has been blocked by CORS policy

What to do:

Paste into Kiro chat
I'm getting a CORS error when my frontend calls the Lambda function URL. 

Error: Access to fetch at 'https://xxx.lambda-url.ap-southeast-1.on.aws/' 
from origin 'http://my-bucket.s3-website...' has been blocked by CORS policy.

My Lambda is a Flask app using Lambda Web Adapter with response streaming. 
Fix the CORS headers in my Lambda function.
CORS errors are almost always fixed in the backend (Lambda), not the frontend. Kiro knows this and will update the right file.

Fixing Deployment Errors

🚀 GitHub Actions Failed

Your deployment shows a red ❌ in the GitHub Actions tab.

What to do:

  1. In GitHub → Actions → click the failed run → click the failed step
  2. Copy the error output (the red text)
  3. Paste into Kiro:
Paste into Kiro chat
My GitHub Actions deployment failed at the [step name] step. Here's the error:

[paste the full error output]

What's wrong and how do I fix it?
☁️ SAM / CloudFormation Error

Deployment fails with errors like CREATE_FAILED, ROLLBACK_COMPLETE, or resource-specific errors.

What to do:

Paste into Kiro chat
My SAM deploy failed with this CloudFormation error:

[paste error]

My template.yaml is open. Fix it.

Common CloudFormation errors:

ErrorLikely cause
Resource already existsA previous failed deploy left resources behind. Delete the stack first.
ROLLBACK_COMPLETEStack is stuck. Delete it in CloudFormation console, then redeploy.
Insufficient permissionsIAM role missing a policy. Tell Kiro which permission is denied.
Template format errorYAML indentation issue. Kiro can fix this instantly.
S3 bucket already existsBucket names are global. Change the name in template.yaml.
🔑 AWS Credentials Error

Errors like ExpiredTokenException, InvalidClientTokenId, or Access Denied.

What to do:

ErrorFix
ExpiredTokenExceptionYour session token expired. Get fresh credentials from the sandbox portal and update GitHub secrets.
InvalidClientTokenIdAccess key is wrong. Double-check the AWS_ACCESS_KEY_ID secret — no extra spaces.
Access DeniedYour IAM role doesn't have the required permission. Tell Kiro which action was denied.
Credentials could not be loadedGitHub secrets are not set or named incorrectly. Check Settings → Secrets.
Credential errors are NOT code bugs — Kiro can explain them but you need to update secrets manually in GitHub.

Fixing Bedrock / AI Errors

🤖 Bedrock Model Error

Your AI feature returns an error instead of a response.

Common errors:

ErrorFix
AccessDeniedExceptionModel not enabled. Go to Bedrock → Model access → enable the model.
ModelNotReadyExceptionModel access is still pending. Wait a few minutes and retry.
ValidationExceptionBad request format. Paste the full error into Kiro — it'll fix the API call.
ThrottlingExceptionToo many requests. Add retry logic — ask Kiro to add exponential backoff.
ModelTimeoutExceptionRequest took too long. Reduce prompt length or increase Lambda timeout.
Empty response (no error)Claude's safety filter declined. Rephrase the prompt to be more specific.
Paste into Kiro chat
My Bedrock call is failing with this error:

[paste error]

My Lambda function file is open. Fix the Bedrock API call.

General Troubleshooting Workflow

Follow this process for any error:

  1. 1 Get the error — copy the full error message from wherever it appears (GitHub Actions, browser console, CloudWatch logs, terminal)
  2. 2 Open the relevant file — open the file that's causing the issue in Kiro (Lambda function, template.yaml, index.html, deploy.yml)
  3. 3 Paste and ask — paste the error into Kiro chat with one sentence of context
  4. 4 Apply the fix — Kiro edits the file directly. Review the change.
  5. 5 Redeploy — commit the fix to GitHub and let Actions redeploy
If Kiro's first fix doesn't work, paste the NEW error back into chat. Kiro learns from each attempt and narrows down the issue.

Where to Find Error Messages

ProblemWhere to look
Deployment failedGitHub → Actions → click failed run → click failed step → read red text
App shows error in browserBrowser DevTools (F12) → Console tab → red messages
API returns errorBrowser DevTools → Network tab → click the failed request → Response tab
Lambda function errorAWS Console → CloudWatch → Log groups → find your function → latest log stream
CloudFormation errorAWS Console → CloudFormation → your stack → Events tab → look for FAILED
Bedrock errorCloudWatch logs for your Lambda function (Bedrock errors appear there)

Pro Tips

Ready-to-Use Prompts

Copy any of these and replace the bracketed parts:

Generic error fix
I'm getting this error: [paste error]. The relevant file is open. Fix it.
Deployment failure
My GitHub Actions deploy failed at [step name]. Error: [paste]. What's wrong?
Runtime error
My Lambda function crashes with: [paste traceback]. Fix the bug.
Ask for explanation
Explain this error in simple terms and fix it: [paste error]
Multiple errors
I have several errors after deploying. Here's the first one: [paste]. 
Fix this one first, then I'll share the next.