Skip to content

Long response time on /api/v2/firewall/nat/port_forwards #749

@mike-perdide

Description

@mike-perdide

Describe the bug
When calling GET /api/v2/firewall/nat/port_forwards, I get a 504 response, with indications of a timeout in the logs.

To Reproduce
Steps to reproduce the behavior:

  1. Configure 200 port forward rules on the pfsense
  2. Make a GET /api/v2/firewall/nat/port_forwards to the pfsense API
  3. Wait for it to complete
  4. See error in the logs after a few minutes

Expected behavior
The call returns the list of port forwards in a timely fashion, ideally a few seconds.

Screenshots or Response

When calling GET /api/v2/firewall/nat/port_forwards, the call hangs for a few minutes, then returns a 504 response, with html code indicating a PHP crash. In the logs, I can see:

... upstream timed out (60: Operation timed out) while reading response header from upstream, client: REDACTED, server: , request: "GET /api/v2/firewall/nat/port_forwards HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.socket", host: "REDACTED

With additional debug, I can see that the call takes 12 minutes to return, which is too long for nginx timeout setting.

pfSense Version & Package Version:

  • pfSense Version: 24.11
  • Package Version v2.6.0

Affected Endpoints:

  • URL: /api/v2/firewall/nat/port_forwards

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtroubleshootingIssues that are troubleshooting requests or need troubleshooting before proceeding

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions