---
title: Troubleshooting Node.js App and API Protection
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > App and API Protection > Enabling App and API
  Protection > Enabling App and API Protection for Node.js > Troubleshooting
  Node.js App and API Protection
---

# Troubleshooting Node.js App and API Protection

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site). ().
{% /alert %}

{% /callout %}

## Common Issues{% #common-issues %}

### No security signals appearing{% #no-security-signals-appearing %}

If you don't see AAP threat information in the [Trace and Signals Explorer](https://docs.datadoghq.com/security/application_security/troubleshooting) for your Node.js application, follow these steps to troubleshoot the issue:

1. Verify Agent version:

   - Ensure you're running Datadog Agent v7.41.1 or higher.
   - Check Agent status: `datadog-agent status`.

1. Check Node.js tracer version:

   - Confirm you're using Node.js tracer v4.30.0 or higher.
   - Verify the tracer is loaded: `node -e "console.log(require('dd-trace/package.json').version)"`.

1. Verify environment variables:

   - Ensure `DD_APPSEC_ENABLED=true` is set.
   - Check `DD_SERVICE` and `DD_ENV` are properly configured.
   - Verify `DD_APM_ENABLED=true` if using APM features.

1. Check tracer initialization:

   - Ensure `dd-trace/init` is required at the start of your application.
   - Verify the tracer is properly loaded before your application code.

### Application fails to start{% #application-fails-to-start %}

1. Check Node.js version compatibility:

   - Ensure you're using a supported Node.js version (see [compatibility requirements](https://docs.datadoghq.com/security/application_security/setup/nodejs/compatibility)).
   - Verify Node.js version: `node --version`.

1. Check dd-trace installation:

   - Ensure `dd-trace` is properly installed: `npm list dd-trace`.
   - Reinstall if necessary: `npm install dd-trace`.

1. Module loading errors:

   - Check for conflicts with other tracing libraries.
   - Verify the tracer is required before other modules.

### Performance impact{% #performance-impact %}

1. High latency:

   - Check Agent resource usage.
   - Verify network connectivity between Agent and Datadog.
   - Consider adjusting sampling rates.
   - Review [performance considerations](https://docs.datadoghq.com/tracing/trace_collection/compatibility/nodejs/#performance).

1. High memory usage:

   - Monitor Node.js process memory usage.
   - Check for memory leaks in your application.
   - Consider adjusting tracer configuration.

### Configuration issues{% #configuration-issues %}

1. Environment variables not recognized:

   - Ensure environment variables are set before starting the application.
   - Check for typos in environment variable names.
   - Verify that the tracer is initialized with the correct configuration.

1. Tracer initialization problems:

   - Make sure `require('dd-trace/init')` is the first line in your application.
   - Check for syntax errors in your tracer configuration.
   - Verify that the tracer is being imported correctly.

### Still having issues?{% #still-having-issues %}

If you're still experiencing problems:

1. Check the [Application Security Monitoring troubleshooting guide](https://docs.datadoghq.com/security/application_security/troubleshooting).
1. Review the [Node.js tracer documentation](https://docs.datadoghq.com/tracing/trace_collection/compatibility/nodejs/).
1. Enable debug logging: `DD_TRACE_DEBUG=true`.
1. Contact [Datadog support](https://docs.datadoghq.com/help).
