Lambda Runtime.HandlerNotFound: Fix the Handler Path

Logeshwaran
—

AWS Lambda Runtime.HandlerNotFound means the runtime cannot locate the exported handler named in your function configuration. Check the actual deployed package, then make the Handler setting match its module/function, Java class or method, or .NET assembly/type/method. The surprising trap: fixing your source filename may do nothing if the deployed ZIP still contains an older compiled file or a different folder layout. For container images, also inspect Dockerfile CMD and any Lambda image-command override.

⚡ Quick Answer

• Console: Lambda → Functions → your ZIP function → Code → Runtime settings → Edit Handler.

• CLI: aws lambda get-function-configuration --function-name orders-api --query '{Handler:Handler,Runtime:Runtime}'.

• Node/Python: Match a deployed module and an exported callable such as index.handler or lambda_function.lambda_handler.

• Java: Check package.Class for handler interfaces or package.Class::method for a suitable named method.

• .NET: Check Assembly::Namespace.Class::Method for class libraries.

For containers, inspect CMD and ImageConfig. Follow the full diagnostic sequence below.

Jake uses Lambda to confirm repairs for his phone shop. An update compiles without warnings, but the first order arrives with HandlerNotFound. He needs to know which exported symbol his deployment actually contains.

Jake: "It compiled without a warning, and the first order failed with HandlerNotFound."

Ethan: "Match the name Lambda asks for to the thing you actually uploaded. That beats guessing at timeouts or permissions."

Find the missing handler before rebuilding the function

Your function may have deployed successfully, yet the very first invocation produces Runtime.HandlerNotFound. That is usually a naming problem, not an IAM permission problem or a reason to raise memory. Lambda has located enough of your code to attempt handler resolution, but the configured callable is unavailable at the expected name. Compare the Handler setting with the deployed artifact, not merely the source file open in your editor.

A simple diagnostic is to retrieve the configuration, list the ZIP, and write down three separate facts: the actual filename or class name, its exported callable, and the handler string saved with the function. If those three disagree, choose whether to correct the artifact or the configuration. For a quick restoration, correcting a typo in the handler may be cheaper than rebuilding; when your deployment automation generated the wrong directory structure, fix the build pipeline so the next deploy does not undo your manual correction.

Jake sees this after changing an order-notification function. The source says sendOrder, but the Lambda setting says index.handler.

Ethan: "The runtime cannot guess your function's nickname. Give it the exported name that actually exists in the package."

Start with these commands. Replace the function name and Region with the ones that received the failed invocation:

aws lambda get-function-configuration --function-name orders-api --region us-east-1 --query '{Handler:Handler,Runtime:Runtime,PackageType:PackageType,LastUpdateStatus:LastUpdateStatus,Version:Version}'
aws logs tail /aws/lambda/orders-api --since 30m --region us-east-1

Decode HandlerNotFound against its neighboring errors

If your CloudWatch logs say Handler 'lambda_handler' missing on module 'lambda_function', the module can be present while the requested callable is absent. If they say index.handler is undefined or not exported, a Node.js module may have loaded but not exposed an export named handler. These two messages point toward a callable-name mismatch. A message beginning Unable to import module can instead indicate a missing module file or an import-time dependency failure. Treating them as identical wastes time.

An invocation can also fail before any of your own console.log or print statements appear, because handler loading happens before the handler body runs. Read the first error and stack trace in the log stream, including its INIT_REPORT and REPORT fields where available. The last line alone is not where you start. An apparently empty CloudWatch log group might mean the invocation never reached the function, logging permissions are missing, you selected the wrong Region, or you are viewing a different alias.

The exact runtime wording varies. Use it to form a hypothesis, then inspect the artifact. A ZIP may contain src/index.js while the handler string addresses index.handler; a Python archive may contain project/lambda_function.py instead of lambda_function.py at the root. Import problems and missing exports can also coexist: after fixing a module path, the next error may reveal the missing handler name. Fix the first demonstrated failure, invoke once, and reassess the new logs rather than changing three things simultaneously.

Match the handler string to the runtime at a glance

The handler field is a small string with an outsized job. It identifies what Lambda should call, but its grammar differs by runtime. Node.js and Python generally use a module path and callable separated by a dot. Java commonly uses a fully qualified class and, in some cases, a double-colon method. Class-library .NET uses a three-part assembly/type/method value. Each is resolved against the deployed package, so case and capitalization matter.

For Node.js, the prefix is a module path, not the filename with .js, .mjs, or .cjs appended. index.handler refers to a handler export in an index module. Python's lambda_function.lambda_handler similarly refers to a callable named lambda_handler in lambda_function.py. Nested Python module paths may use dots if the package and imports are structured appropriately. Java example.OrderHandler is valid for a class implementing the supported request-handler interface. Java's example.Handler::process identifies a specifically named handler method in a different pattern. .NET Orders::Shop.Function::Handle requires a compiled Orders assembly, a type Shop.Function, and its method Handle.

A handler path is not an HTTP URL, a filesystem path beginning /var/task/, or the Docker image tag. That is why copying a local absolute filename into the Lambda Handler field fails. Your task is to map the archive-relative module or compiled identifier to the runtime's supported naming convention.

RuntimeHandler exampleActual deployed target
Node.jsindex.handlerindex.mjs, index.cjs or index.js exports handler
Pythonlambda_function.lambda_handlerlambda_function.py defines lambda_handler
Java interfaceexample.OrderHandlerClass implements RequestHandler / RequestStreamHandler
Java named methodexample.OrderHandler::processCompatible named method on class
.NET class libraryOrders::Shop.Function::HandleAssembly, type and callable method

Fix Node.js ESM exports and CommonJS exports

If your Node.js Lambda reports index.handler is undefined or not exported, inspect both the filename extension and the module system. Node.js treats .mjs files as ES modules and .cjs as CommonJS. A .js file is ordinarily CommonJS unless package metadata such as "type": "module" changes how it is interpreted. Mixing the two export styles can prevent Lambda from finding the intended callable.

For a file named index.mjs, export the function with ESM syntax:

export const handler = async (event) => {
  return { ok: true, orderId: event.orderId ?? null };
};

Set the Lambda handler to index.handler. The .mjs extension stays on the artifact filename, not in the handler setting. For a CommonJS file named index.cjs, use:

exports.handler = async (event) => ({ ok: true });

Again use index.handler. A function declared as async function handler(...) but never exported is not an exported handler. A default export is not a substitute for a named handler export in this arrangement. Check the actual compiled output when bundlers transform your source; a wrapper might expose a different symbol from what you wrote.

ESM and CommonJS are module-loading conventions, not Lambda trigger types. API Gateway, SQS, and scheduled invocations can all use the same module convention. Keep trigger troubleshooting separate until the handler loads. The fastest local inspection is to import or require the built artifact and inspect whether its handler property is a function. The command must match your module format and local Node.js version.

Repair Python module names and lambda_handler typos

When Python displays Runtime.HandlerNotFound with handler lambda_handler, start with the file named on the left side of the dot. A handler configured as lambda_function.lambda_handler expects a resolvable module lambda_function, normally lambda_function.py, containing a callable exactly named lambda_handler. Case mismatches matter because the Lambda environment is Linux-based.

This minimal implementation matches the conventional setting:

def lambda_handler(event, context):
    return {"ok": True, "orderId": event.get("orderId")}

If your file is orders.py and its function is send_order, the correct setting is orders.send_order. If you use a package directory such as app/handlers.py, a handler like app.handlers.lambda_handler may resolve when the deployed folder structure and Python import path support it. Inspect __init__.py, package layout, and imports instead of treating every dot as a literal directory separator.

A frequent mistake is uploading the enclosing project folder into the ZIP. Your archive then begins my-project/lambda_function.py, and the configured top-level module lambda_function cannot be imported directly from /var/task. Package the contents of the deployment directory, not an unnecessary parent folder. This is a different layout rule from Python layers, where the python/ directory belongs at the layer archive root.

Handle Java Class::method and RequestHandler correctly

If a Java function cannot locate a handler, first determine whether the class implements RequestHandler or RequestStreamHandler. Those interfaces expect a method named handleRequest, and the configured handler can be the fully qualified class name such as example.OrderHandler. For Java classes not using those interfaces, identify a compatible handler method with a string such as example.OrderHandler::process. The double colon belongs to the named-method form, not the Node/Python module notation.

A compact interface example is:

package example;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;
import java.util.Map;
public class OrderHandler implements RequestHandler<Map<String, Object>, String> {
    @Override
    public String handleRequest(Map<String, Object> event, Context context) {
        return "accepted";
    }
}

The handler setting for this interface example is example.OrderHandler. Ensure the class is public, packaged into a deployed JAR, and its package declaration matches the configuration. A Java file's name on your workstation does not override its compiled package and class identity. When you refactor a package from example to shop.orders, update the handler and rebuild the JAR.

The standalone method form also requires a supported method signature. An error about no public method with the appropriate signature is not solved merely by appending ::handleRequest to an incorrect class. Inspect whether the compiled method is accessible, whether arguments match the Java handler model, and whether the deployment contains the new class rather than an older artifact.

Set the .NET assembly::namespace.class::method name

Your C# class-library Lambda uses a handler with three components separated by double colons: AssemblyName::Namespace.Classname::Methodname. The assembly name usually derives from the project name unless you explicitly set an assembly name in the .csproj file. The namespace and class must match the compiled type; the method must be an appropriate public handler method. A namespace rename can therefore break a deployment even when the method code is unchanged.

Imagine the project builds Orders.dll and defines Shop.Function.HandleRequest. Its handler is Orders::Shop.Function::HandleRequest, not Function.HandleRequest, and not Orders.dll::Shop.Function::HandleRequest. The name you configure is the assembly identity without the .dll extension. A project folder called order-service is irrelevant if the compiled assembly name is Orders.

namespace Shop;
public class Function
{
    public string HandleRequest(string input)
    {
        return $"Received: {input}";
    }
}

This is a simplified handler shape. Real projects must supply the serialization configuration and dependency references appropriate to their event types. The primary troubleshooting point is the match between the compiled assembly/type/method and the handler setting. AWS's .NET deployment tooling can package the published output so you avoid zipping source files instead of assemblies.

There is a meaningful exception: .NET executable-assembly handlers using top-level statements use an executable assembly name rather than the class-library triple-part format. Identify which .NET packaging model your project uses before forcing a :: string into its configuration. If you receive an error about an unavailable assembly, inspect publish output and deployment contents before changing the handler method's spelling. If it finds the assembly but not the method, focus on the compiled type and member.

For Jake's order processor, this is the equivalent of delivering a phone labeled with the correct model number but the wrong firmware. The source project may look right, yet Lambda only sees what the published assembly contains.

Inspect the ZIP root and prevent one extra folder

If you can read the correct handler in your source repository, inspect the ZIP before changing Lambda configuration. A deployment archive is the runtime's filesystem view, not your repository tree. For Node.js and straightforward Python ZIP functions, the file defining the handler is typically accessible at the archive root or along the intended module path relative to that root. The extra outer folder is among the quickest mistakes to spot and repair.

A useful archive inspection on Linux or macOS is unzip -l function.zip | head -40. On Windows, inspect the ZIP in File Explorer or use PowerShell's Expand-Archive into a temporary directory. Be sure you're looking at the deployed file, not merely the latest local build folder.

Correct layout for a simple Node.js ZIP:

function.zip
  index.mjs
  package.json
  node_modules/

Incorrect for index.handler:

function.zip
  project/
    index.mjs
    package.json

Correct layout for a simple Python handler:

function.zip
  lambda_function.py
  requirements-installed-as-packages/

ZIP archives for Java and .NET are different: they hold compiled assemblies, classes, JAR files, and their supporting files in structures expected by those runtimes. It is inaccurate to demand index.js-style flat packaging for a .NET publish archive or for every Java build. The universal principle is that the deployed bundle must match the runtime's loading conventions.

To rebuild a basic Node.js archive, change into the directory containing index.mjs and run zip -r ../function.zip ., not zip -r function.zip project/ from the parent. For Python, follow the same idea while keeping the handler module at the right location. The file path in the Handler setting must reflect the resulting archive-relative module name. Check hidden files and package.json because a missing package.json may alter .js module interpretation.

Trace TypeScript source to compiled output

If you author Lambda in TypeScript, the file src/handler.ts is not necessarily what Lambda executes. Your build tool emits JavaScript into an output directory such as dist, build, or a bundled single file. The configured handler must describe the emitted JavaScript package, not the original TypeScript path, unless your deployment tooling deliberately rewrites the setting to match its bundle.

For example, src/orders.ts may export handler, while TypeScript emits dist/orders.js. If your ZIP includes a top-level dist/ directory, a handler like dist/orders.handler can be appropriate. If your CI system changes into dist and zips its contents so orders.js is at the archive root, the handler should instead be orders.handler. Both designs can work; mixing them fails.

source tree:              archive option A:          archive option B:
src/orders.ts             dist/orders.js             orders.js
handler: generated        handler: dist/orders.handler handler: orders.handler

Run the build before zipping. Then inspect the emitted module exports, output extension, and package.json module type. A TypeScript setting such as module: NodeNext may alter ESM/CommonJS output decisions. A bundler may rename the file or generate a wrapper, and your CI job may copy only a subset of files. Those are build-artifact issues, not AWS permissions.

You can inspect a CommonJS bundle with node -e "console.log(Object.keys(require('./dist/orders.js')))" when its module format permits require. For an ESM bundle, use dynamic import() and inspect the result. If handler is absent, fix the export or the bundler's entry-point configuration. If it exists locally but Lambda still cannot resolve it, inspect the uploaded archive or version again.

Deployed ZIP pathConfigured handlerDiagnosis
index.mjsindex.handlerMatch if named handler exported
src/index.mjsindex.handlerIncorrect module path
dist/orders.jsdist/orders.handlerMatch if export and module format agree
lambda_function.pylambda_function.lambda_handlerMatch if callable exists
project/lambda_function.pylambda_function.lambda_handlerUnwanted parent folder for simple ZIP

Choose between console edits and CLI configuration fixes

When the artifact is correct but the handler field is wrong, editing the configuration is the narrowest repair. Open Lambda → Functions → your ZIP-based function → Code → Runtime settings → Edit. Set the Handler to the matching module/function, Java class, or .NET assembly/type/method value. Save, then watch the update status before invoking again. The exact panel layout can differ for container-image functions because the command belongs to image configuration rather than the ZIP runtime handler setting.

For a ZIP function, this AWS CLI command changes the handler configured on the unpublished version:

aws lambda update-function-configuration   --function-name orders-api   --handler orders.handler   --region us-east-1
aws lambda wait function-updated   --function-name orders-api   --region us-east-1

Before doing this in production, record the original handler and verify whether traffic goes to $LATEST, a numbered version, or an alias. Published versions cannot have their configuration changed in place. If an alias still points to an older published version, updating $LATEST does not update that alias's code or configuration. Publish a new version and intentionally move the alias after testing if that is your release process.

The get-function-configuration command shows a LastUpdateStatus field. A completed update is different from successful invocation: Lambda can accept a handler string that later fails when it loads code. Invoke the actual target with a representative event and read the log entry. An HTTP 200 from the CLI update is not success yet.

Repair container-image handler commands and CMD

For Lambda container images, the Handler field used with ZIP packages is not the central configuration. An AWS Lambda language base image normally receives the handler through the Dockerfile's CMD array, such as CMD ["index.handler"] for Node.js or CMD ["lambda_function.lambda_handler"] for Python. The code is copied into the location expected by the base image, commonly ${LAMBDA_TASK_ROOT}.

FROM public.ecr.aws/lambda/nodejs:22
COPY index.mjs ${LAMBDA_TASK_ROOT}/
CMD ["index.handler"]

A Python example similarly copies lambda_function.py and uses CMD ["lambda_function.lambda_handler"]. Keep the image's runtime interface client and entry-point behavior aligned with the base image. A custom non-AWS base image has additional requirements and may use a different startup mechanism.

Lambda can override image configuration, including Command, EntryPoint, and WorkingDirectory, using the function's ImageConfig. That means fixing a Dockerfile is not enough if a function-specific command override still points at an old handler. Inspect image configuration as part of the diagnosis, then compare it against the image's current CMD and the files present inside the built image.

aws lambda get-function-configuration   --function-name image-orders   --region us-east-1   --query '{PackageType:PackageType,ImageConfigResponse:ImageConfigResponse}'

For an intended override, aws lambda update-function-configuration --function-name image-orders --image-config '{"Command":["index.handler"]}' can set the command. Use it only when that is the desired deployment model. If you maintain the command in the Dockerfile, prefer keeping overrides consistent or removing obsolete overrides through your deployment configuration.

An image might include app/index.mjs rather than index.mjs at task root. You can change the copy location or adjust the module path appropriately; choose one consistent approach. Inspect the image actually referenced by the deployed function. Rebuilding a local image does not replace the image digest already deployed to Lambda.

Distinguish Unable to import module from a missing export

When the log reports Unable to import module 'index', Lambda may not have found the module, or the module raised an exception while importing a dependency. That contrasts with Handler 'handler' missing on module 'index', which points more specifically to resolving a callable after the module has been considered. However, error classification and exact wording vary between runtimes, so use the accompanying message and stack trace rather than the label alone.

A missing module can come from a ZIP folder mismatch, incorrect filename, or case mismatch. An import-time failure may come from missing node_modules, a broken Python dependency, or code that throws at module import time. A missing handler can come from export default instead of named handler, a Python typo, an inaccessible Java method, or a changed .NET class name.

Use a two-question test. First: can the deployed runtime locate and load the module or class? Second: does that module expose the specific callable Lambda is configured to invoke? If the answer to the first is no, repair imports and packaging. If the first is yes and the second is no, repair the callable or handler string. Errors after the handler starts belong to an entirely different execution path.

One useful contrast is Runtime.ExitError, which indicates an unexpected runtime or extension process exit rather than simply an unresolved handler name. Another is a timeout, which may occur during slow initialization or invocation. The fact that all these errors happen when you test a Lambda does not make them interchangeable.

Use CloudWatch logs to pinpoint resolution failures

If your Lambda error appears only in the console banner, open the CloudWatch log stream behind the failed invocation. Select Lambda → Functions → your function → Monitor → View CloudWatch logs, and find the request's START, relevant import or handler-resolution message, and REPORT or initialization report where emitted. If you use an alias, filter by the same time and invocation target as your application.

aws logs tail /aws/lambda/orders-api --since 30m --region us-east-1 gives you recent entries. Logs are evidence of what the runtime saw; their absence does not prove the handler is correct. If there is no log stream, check whether the function was invoked, whether the log group exists, whether its execution role can write logs, and whether you are inspecting the correct account and Region. An invocation-level error response may provide a message even when application logs are missing.

For console test events, use the same payload shape your actual trigger supplies. Handler resolution occurs before your event-specific business logic, so a Runtime.HandlerNotFound should not depend on whether your order payload has a phone number. If you see a different error after repairing the handler, that can be evidence that Lambda reached a later stage. Record the new error rather than claiming every problem is fixed.

The request ID can help connect Lambda console invocation output with a CloudWatch stream. Log messages for imports might precede a START or appear during initialization. Keep the surrounding records together so you don't mistake a failure from one invocation for the cause of another.

Log clueLikely branchWhat to inspect
index.handler is undefined or not exportedMissing named exportESM/CommonJS export syntax
Handler lambda_handler missingMissing Python callableFunction name and module
Unable to import moduleImport or dependencyZIP paths and stack trace
Class not foundCompiled class mismatchPackage declaration and JAR
Unable to find methodType/member mismatchMethod signature and assembly

Test the exported callable before deploying again

Your local test should answer whether the built artifact exposes the callable that Lambda will request. For Python, import the module from the directory you intend to package and inspect its attribute. For Node.js, use the appropriate ESM import or CommonJS require. For Java or .NET, a compilation and package inspection can establish whether the expected class/type and method exist; integration tests should cover their runtime invocation model.

For Python:

python -c "import lambda_function; print(callable(lambda_function.lambda_handler))"

For ESM Node.js:

node --input-type=module -e "import('./index.mjs').then(m => console.log(typeof m.handler))"

These tests are useful only if you execute them against the output directory and module settings that the ZIP includes. A successful test in your source tree is insufficient when your CI job deploys a different ZIP. Follow with listing archive entries and inspecting the uploaded version after deployment.

Proving a production handler exists never needs a destructive payload. Importing an entry module can have side effects from top-level initialization. Use a controlled development environment and test-specific credentials. Static export inspection may be enough to detect the naming defect without calling a database or payment API.

For ESM, the imported namespace must contain the named property handler. For CommonJS, require('./index.cjs').handler should be callable. For Python, callable(lambda_function.lambda_handler) should be true. These observations are a fast filter: they can't guarantee every dependency works under Lambda Linux, but they can catch the exact missing callable before the upload.

  1. Read the configured Handler and Runtime from the specific function version.
  2. Download or inspect the exact deployment artifact, not a local source file.
  3. Confirm that the requested module and export exist in that artifact.
  4. Fix the artifact or configuration in the authoritative deployment system.
  5. Deploy to a diagnostic function or version and invoke once.
  6. Read the new CloudWatch message before shifting production traffic.

Build a reliable ZIP packaging check in CI

If your Lambda keeps returning Runtime.HandlerNotFound after each deployment, the problem may be in the pipeline that packages files. Add a build step that lists the archive, checks the expected top-level files, and asserts the named export exists. Your pipeline should fail before publishing the function if its artifact does not satisfy those simple conditions.

For a Python package, create the ZIP after all dependencies are installed into the intended target directory. Archive from inside that directory so you do not introduce a parent folder. For a Node.js project, build TypeScript first, then package the resulting JavaScript and required package metadata. A CI job that runs zip before compilation can upload stale output while the commit itself looks correct.

A minimal shell sanity check can display the packaging evidence:

unzip -l function.zip | head -50
unzip -p function.zip index.mjs | head -30

Change the example filename to your actual module; the command intentionally fails to show contents if that path is absent. Consider using a test that checks the archive listing programmatically instead of treating visual inspection as the long-term safeguard. For built Java and .NET packages, inspect the compiled assembly or JAR rather than expecting source files.

Fix function aliases and published-version surprises

If your Lambda works when you click Test on $LATEST but fails through the production application, compare the version or alias used by each invocation. Published versions are immutable snapshots of code and configuration. An alias can point to a published version whose handler string still refers to an older export. Updating $LATEST does not alter that published version.

Use aws lambda get-alias --function-name orders-api --name production --region us-east-1 to identify the version behind a named alias. Retrieve that version's configuration using the appropriate qualifier, and compare it with $LATEST. Keep the same Region and account in both commands. A deployment pipeline that publishes a version but forgets to update the alias may leave production on the broken package or keep production on a previously working package while tests exercise something else.

The safe fix is to publish a new version after correcting both code and handler configuration, test it, and shift the intended alias through your release process. If your infrastructure tool owns alias routing, update that configuration there. A manual update-alias command can be overwritten later if your stack is authoritative.

Lambda versions also affect rollback. Repointing an alias to a previous working version can restore traffic when you know the prior artifact and its dependencies remain valid. It does not repair the broken release, so keep the incident open until the packaging or naming mistake is corrected in source and automation.

Jake: "The local test passes. Real shop orders fail."

Ethan: "Which exact version got the real order? That one question stops you chasing a code path production never executed."

Resolve missing modules in layers without masking the handler

Layers can supply dependencies and sometimes reusable code, but they do not automatically make an absent handler export appear in your function's main module. Node.js layers use paths such as nodejs/node_modules, Python layers use python or version-specific site-packages paths, and Java layers can place JAR dependencies under java/lib. Lambda mounts layers under /opt, while ZIP function code is extracted under /var/task.

If your main handler imports code from a layer and an import fails, investigate the layer's exact version, runtime compatibility, and expected directory. For Python, match the function's Python version and Linux compatibility when compiled extensions are involved. For Node.js, distinguish the layer dependency module from the function's own entrypoint export. For Java, confirm the dependency JAR appears where the runtime's classpath can find it.

Changing a layer version may repair an import error, yet it will not correct a handler string that requests orders.handler when your module exports send. Keep the two stages separate in your investigation. Likewise, a Java class supplied through a dependency JAR needs the correct fully qualified class name if it is itself the intended handler.

Before removing layers in production, preserve the configuration and use an isolated diagnostic function or version. A shared layer change can affect many functions. An update that appears to fix one function might expose a different dependency mismatch in another. Record layer ARNs with version numbers when gathering evidence for a support case.

Diagnose Java and .NET compiled artifact mismatches

If Java or .NET reports that a class or type cannot be located, verifying the source code alone is insufficient. Compile and inspect the package that will be uploaded. Java package declarations determine the compiled class path, and .NET assembly metadata determines the names the runtime resolves. A rename in source code may not be reflected in a stale JAR or DLL sitting in your build directory.

For Java, inspect a built JAR with jar tf target/your-app.jar | head or inspect an uber-JAR produced by your configured build tool. Expect class entries such as example/OrderHandler.class for example.OrderHandler. When deploying a ZIP of JAR files under lib, verify those JARs are present and are the intended versions. If more than one JAR contains the same class, review the packaging and classpath behavior.

For .NET, inspect the published output directory for the named assembly, .deps.json, and runtime configuration files. If you deploy a ZIP built from a project directory rather than publish output, the expected assembly might be missing. dotnet lambda deploy-function or a framework-aware deployment tool can build the archive for you. The exact handler string still needs to match its compiled types.

If the error says a named class is present but has no public method with a suitable signature, you have moved beyond locating the assembly. Inspect method visibility, parameters, return type, and runtime handler contract. A method called HandleRequest that is private is not equivalent to a public supported handler. A generic method signature copied from an unrelated sample may also be incompatible.

Changing three package names until one passes teaches you nothing about which was wrong. Retrieve the configured string, inspect the compiled binary, and compare each component. The assembly, namespace, class and method are individual checkpoints. That methodical approach becomes particularly useful after refactoring C# namespaces or moving Java classes into new packages.

Handle security and permissions errors as a different diagnosis

If the configured handler is wrong, giving Lambda broader IAM permissions cannot create the missing export. IAM permissions control what the function may access in AWS; they don't change the names of functions inside deployed code. Likewise, adding memory or increasing the timeout won't generally repair a missing handler symbol. These adjustments often distract from the one string that needs correction.

There are related failures that can occur after a handler is found, however. A function may locate handler and then fail when its code accesses S3, DynamoDB, Secrets Manager, or VPC resources. At that point you should read the new error and address authorization or connectivity. Once logs show the handler has begun running, HandlerNotFound is no longer your problem.

Permissions can affect diagnosis itself. If your role cannot read CloudWatch logs or your execution role cannot create log streams, you may lack normal visibility. That is a logging-permissions issue, not proof that the handler string is valid or invalid. Gather configuration via get-function-configuration and inspect your deployment package while resolving log access separately.

On the packaging side, filesystem permissions may matter for certain executables or dependencies, particularly custom runtimes. Managed Node.js and Python handler modules are found through language module loading conventions. Keep OS execution permissions, native library errors, and HandlerNotFound in separate branches unless the log ties them together.

Use a worked order-notification example to choose the fix

Suppose Jake's shop gets 120 repair bookings in a weekend. Each booking triggers a Lambda that records an order notification. After a TypeScript refactor, the team sees 18 failed invocations with a missing-handler message. These are hypothetical numbers chosen to show the investigative process; they are not measurements of a real service.

The repository contains src/notifications.ts with export const sendOrder = async (...) => .... The build emits dist/notifications.js, and the ZIP contains dist/notifications.js. Meanwhile the Lambda Handler setting remains index.handler. The runtime is looking for a different module and export. Two possible repairs are defensible: update the configured handler to dist/notifications.sendOrder, or change the build so it emits index.js exporting handler. Pick the pattern your deployment tooling intends to maintain.

Before any production change, Jake's team lists the deployed archive and inspects its exports. They modify a development function's handler to match the archive, invoke with a representative event, and verify that CloudWatch now shows handler execution. The production release then publishes a corrected version and changes the alias after an intentional release decision.

The cost of the naming bug is not simply the number of Lambda invocation failures. An order notification may be retried, skipped, or handed to a failure destination depending on the event source. The team checks which 18 orders need follow-up, using their order IDs rather than assuming Lambda automatically recovered them all.

If they instead changed only the Lambda setting in the console, the next CI deployment might restore the old index.handler. Their durable fix is a consistent build artifact and handler setting in the deployment configuration. This is the practical lesson: troubleshoot both what Lambda received and how that artifact was produced.

Build an inspection table for four common deployment mistakes

When you are staring at a failed Lambda in the middle of a deployment, a short symptom table keeps your diagnosis focused. A module path mismatch, a missing export, an incorrect compiled type, and a container CMD mismatch do not demand the same repair. The most useful next step is the observation that distinguishes them. Prefer commands that read current configuration or archive contents before changing settings.

For a ZIP package, use get-function-configuration to read Handler, Runtime, and PackageType. For an image package, inspect ImageConfig and the actual image contents. For TypeScript, list the generated JavaScript files. For Java/.NET, inspect compiled JARs or DLLs. In every case, inspect the exact deployment artifact rather than assuming the repository build output was uploaded unchanged.

If the fix requires re-uploading code, use update-function-code through your normal deployment workflow and wait for the update before invoking. If the artifact is already correct but the handler string is wrong, use update-function-configuration for ZIP-based functions. Replace code and handler configuration in one emergency command only when you know both are defective.

A failure that appears after a runtime upgrade deserves an extra compatibility review: package module semantics and compiled dependency compatibility may differ. Confirm the new runtime, then reproduce handler export resolution using that runtime's module rules. A modern Node.js ESM refactor and an old CommonJS handler assumption can turn a previously working entrypoint into an unresolved export.

Differentiate framework-generated handlers from your own files

If you use AWS SAM, CDK, CloudFormation, Terraform, or a third-party Lambda bundler, the handler path in your project may not correspond directly to a source filename. Frameworks can compile TypeScript, rewrite output paths, copy files, or package a single bundle. Inspect the generated deployment template and ZIP alongside your source configuration.

For SAM, a function's Handler and CodeUri settings work together. CodeUri defines what is packaged, while Handler identifies the callable inside it. For Terraform-managed ZIP deployments, handler must match the produced archive referenced by your function resource. With CDK NodejsFunction and bundling helpers, the construct may generate a wrapper file and handler name; trust the emitted artifact and synthesized configuration rather than guessing from the TypeScript file location.

A common refactor changes the folder that CI archives but not the handler string in infrastructure code. Another changes the named export but leaves a framework setting pointing to handler. A third changes the package's module type and makes CommonJS syntax inappropriate. All three have the same high-level remedy: inspect the emitted bundle, compare its exports to the generated Lambda configuration, and fix the authoritative build source.

Keep package-version and architecture checks in the right stage. If the entrypoint exists and resolves but a dependency cannot load, investigate the dependency instead of changing the handler. If you now see a permission error, the handler was found and ran far enough to access another AWS service.

Ask your pipeline to expose the function name, handler setting, artifact checksum, and release version in its deployment summary. That gives the next developer a deterministic trail from source commit to running Lambda, without relying on a screenshot of a console panel that may have changed since deployment.

When a container override defeats the new Dockerfile

If your image function still reports that its handler is missing after you rebuilt the Docker image, check whether the Lambda function has a configuration override. The image's Dockerfile CMD can be overridden at the function level. A corrected Dockerfile may therefore have no effect when Lambda is still passing an outdated command such as old.handler into the image's entrypoint.

Inspect the image configuration, the function's currently deployed image digest, and the Dockerfile used for that image. Compare the command to the actual files copied under the image's task root. If you use a custom image, inspect the runtime interface client and entrypoint behavior rather than assuming every image obeys the AWS language-base-image contract.

When an override is intentional, update it through the Lambda console's image configuration controls or the --image-config argument to update-function-configuration. For example, an ImageConfig Command array containing index.handler must name a real export in the image. Changing the function's runtime with --runtime is not the repair for an image deployment; the runtime setting belongs to ZIP-based managed-runtime deployments.

If you changed files but reused a local image tag, ensure the actual image was built, pushed to a registry supported by Lambda, and deployed as the function's image. Lambda does not automatically replace a deployed image merely because a registry tag was repointed. Record the image digest that the function received so you know which filesystem layout it is executing.

This is particularly important for teams testing a new image locally and seeing success while production still invokes the previous image. Solve the version mismatch before changing code again. The right handler in the wrong image is still the wrong deployment.

  1. Identify the failing alias or version and preserve current configuration.
  2. Assess the impact on your event source and any queued work.
  3. Test a corrected handler and package in an isolated deployment.
  4. Restore production by a controlled rollout or known-good version.
  5. Investigate and safely reprocess affected events.
  6. Add a build artifact and handler-name gate to CI.

Recover safely when production is already failing

When customer requests are failing right now, choose a restoration path that doesn't destroy evidence or create additional side effects. First record the function ARN, Region, alias, published version, handler configuration, and the first relevant CloudWatch error. Identify whether traffic uses a stable published version or an unpublished $LATEST function. Then decide whether a small handler correction or a rollback to a known working version is safer.

If the last published version served traffic correctly, redirecting an alias back to it can be an effective rollback, provided downstream contracts and dependencies remain compatible. If your traffic invokes $LATEST, there may be no alias to move, so your deployment process might need to restore the prior artifact and matching configuration. Keep snapshots of deployment inputs and their build manifests.

A handler-path problem generally occurs before business logic. Still, any partially failed workflow should be examined according to its trigger's retry behavior. An API caller may retry, an event source may process again, and a scheduled job may require manual reprocessing. Replaying every event blindly can duplicate orders, payments, or emails, so filter first. Use application-level identifiers and idempotency protections.

For a low-risk diagnostic, deploy the suspected correction to a separate development function or isolated version and invoke a non-destructive test event. Confirm the handler is reached and the intended output is returned. Move production deliberately after that observation; record the release decision with the artifact version so the change can be understood later.

Jake's customers don't care whether index.handler or orders.handler was typed in the console. They care that notifications resume and no orders are lost. The technical fix is small; a responsible recovery also includes finding the affected events and handling them safely.

Collect the right evidence when none of the fixes work

If the handler path appears correct in the visible source and an isolated test still fails, assemble a compact evidence bundle rather than sending a support request that contains only Runtime.HandlerNotFound. Include the complete runtime-specific error, a request ID, Region, function ARN, package type, configured handler or image command, relevant version or alias, and a directory listing of the deployed artifact. Share sensitive code or payloads only through approved support channels.

For Node.js, record the module extension and package.json module type. For Python, record the module path and function name. For Java, record whether the handler class uses RequestHandler/RequestStreamHandler or a named method. For .NET, record the assembly, namespace, type, method, and packaging model. For images, record the Dockerfile CMD, Lambda ImageConfig override, and deployed digest.

AWS Support can help investigate service-level behavior and confusing runtime errors. It cannot infer a missing export that was never packaged, and the deployed artifact remains the best evidence for a configuration mismatch. Be ready to explain the most recent deployment change and exactly which isolated comparisons you performed.

Keep the outcome in a deployment test. Once you find that a bundler changed dist/index.js to bundle/app.js, add an assertion that the configured handler matches the output. Once a Java refactor changes a package, add a test for the public compiled handler type. Once a .NET project changes its assembly name, update the function configuration in the same change.

A good incident report is short and reproducible. It says what Lambda tried to load, what the artifact contained, what you changed, and which invocation demonstrated progress. That is more useful than “redeployed and eventually worked.”

Prevent HandlerNotFound in the next release

If you want this error to stay gone, make handler resolution a release gate rather than a production discovery. Every deployment should identify the handler setting, compile and package the code, inspect the emitted paths, and exercise a representative invocation against the resulting function version. The checks are cheap compared with tracing a broken customer workflow after deployment.

For Node.js, prefer a clearly named export and predictable module extension. For TypeScript, have one build command and one artifact directory. For Python, ensure handler modules and imports are rooted correctly. For Java, keep package names and handler interface usage consistent with the config. For .NET, keep the assembly name and full type method string synchronized with the compiled output. For container images, treat CMD and function overrides as versioned configuration alongside image digests.

Use a development alias or separate function as your rehearsal target. Read the current runtime and handler via the CLI, invoke with a non-destructive event, and inspect logs for a successful response. If the function has downstream access requirements, continue testing those after handler resolution; passing the handler load stage is necessary but not sufficient for a fully functioning application.

More memory, a longer timeout, or wider IAM permissions do nothing for a missing handler. They change unrelated aspects of your function while leaving the module/export mismatch intact. Choose the smallest repair supported by the observed error.

Jake's release checklist now has one extra question: does the artifact contain the exact thing this handler string names?

Ethan: "If the string and the package agree, Lambda has a real place to start."

Questions about Lambda handler paths

If your error message names a specific runtime or handler value, use the matching question below to narrow the next action. These answers repeat the necessary fix briefly; the longer sections explain how to apply it safely.

What does Runtime.HandlerNotFound mean in AWS Lambda?

Lambda could not resolve the callable named in the handler configuration. Compare the configured handler string with the deployed module, class, assembly and exported method.

How do I fix Runtime.HandlerNotFound handler lambda_handler?

For Python, ensure the named module contains a callable with the exact function name, such as lambda_function.py defining lambda_handler, and package it at the expected ZIP location.

Why is my Lambda handler undefined or not exported?

The Node.js module may load without a named export matching the Handler setting. Export handler in ESM or CommonJS syntax and inspect the built artifact.

What is the correct Node.js Lambda handler path?

Use a module path and exported function such as index.handler. Keep .mjs, .cjs or .js on the actual file, not in the handler string.

How do I set an AWS Lambda Python handler path?

Use module.function, such as lambda_function.lambda_handler, matching the deployed Python module and callable. Nested module names require a compatible package layout.

Can index.mjs use index.handler in Lambda?

Yes. An ESM file named index.mjs exporting a named function handler uses the Handler setting index.handler.

What is the Lambda Java Class::method handler format?

For a suitable non-interface Java handler use package.Class::method. Classes implementing RequestHandler or RequestStreamHandler normally use the fully qualified class name and handleRequest.

What is the .NET Lambda assembly namespace class method format?

Class-library functions use Assembly::Namespace.Class::Method with the compiled assembly name and public supported method. Executable-assembly handlers use a different configuration.

Why does Lambda say no handler found after deployment?

A deployment may omit the handler file, add an extra ZIP folder, change the compiled output path, or leave the Handler setting pointing at an old export.

How do I fix an AWS Lambda ZIP folder structure problem?

Inspect archive entries and package from the intended output directory. For simple Node and Python ZIPs, place the handler module at the expected archive-relative location.

How do I fix a TypeScript Lambda handler path after build?

Inspect emitted JavaScript and the actual ZIP root. Use dist/orders.handler only if dist/orders.js is inside the archive at that path; otherwise adjust the handler to the packaged layout.

How does Lambda container image CMD select the handler?

AWS language base images use Dockerfile CMD, such as ["index.handler"], to name the callable. A Lambda ImageConfig Command override may replace it.

What is the difference between HandlerNotFound and Unable to import module?

HandlerNotFound points toward a missing configured callable. Unable to import module usually concerns locating or loading a module or dependency. Read the complete runtime-specific log.

Can I fix HandlerNotFound by increasing Lambda timeout or memory?

Usually not. A missing handler is a naming or packaging issue. First inspect the configured callable and the actual deployed artifact.

Why does Lambda work on $LATEST but fail through an alias?

An alias may point to a published version whose immutable code or handler setting differs from $LATEST. Compare the target version before changing production traffic.

How do I change a Lambda handler with AWS CLI?

For ZIP functions, use aws lambda update-function-configuration --function-name NAME --handler module.function, wait for the update, then invoke the intended version or alias.

For readers preparing for an AWS certification

We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.

Exams that test this topic: Developer – Associate (DVA-C03 from December 1, 2026).

Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:

1. What causes Runtime.HandlerNotFound?

The handler setting names a file or function that does not exist or is not exported.

2. How is the handler written for Node.js and Python?

file.functionName, for example index.handler or app.lambda_handler.

3. Which mistake breaks Node.js handlers most often?

Not exporting the function (exports.handler or export const handler).

4. How is the handler set for Java?

As package.Class::method.

5. A TypeScript function fails with this error. What is a common cause?

The handler points to the .ts source instead of the compiled .js output.

6. How do you avoid handler mistakes in deployments?

Define the handler in AWS SAM or CDK alongside the code.

Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.

If your Lambda still will not start, keep the exact error, configured handler, and deployed artifact listing together. An entrypoint failure is usually easier to solve once those three facts agree. I hope the next order or event reaches your actual handler, not another dead-end module name.

📌 If you keep one line from this page

A Lambda handler is an address into your deployed artifact, not a promise about what exists in your source editor.

Revision note. Written October 9, 2026, with the runtime handler formats and the console's index.mjs default in view. The devil is in the details, and here the detail is one string: file, dot, function.

Related