Skip to content

[HELP] UI Crash "Cannot read properties of null (reading 'map')" when using "Pick from Docker Containers" #954

@khannhub

Description

@khannhub

What happened?
When trying to create a new Proxy Rule, clicking the "Pick from Docker Containers" button causes the UI to fail and throws a JavaScript error in the browser console. The list of containers never renders.

The error in the console is:
TypeError: Cannot read properties of null (reading 'map') at processDockerData.

Describe what have you tried

  1. Checked docker-socket-proxy permissions. I have verified that Zoraxy has full access to CONTAINERS, IMAGES, NETWORKS, etc.
  2. Verified the backend API is working. A manual request to https://[zoraxy-url]/api/docker/containers returns a 200 OK and a valid JSON list of all my containers.
  3. Compared environments: This setup works fine on my remote production server but crashes on my local development environment (Docker Desktop on macOS) using the exact same Compose configuration.

Technical Analysis (Potential Cause)
I investigated the JSON response from /api/docker/containers on the machine where it crashes.
Several containers (e.g., authentik-worker, cloudflared, those who don't have mapped ports to host, only have exposed ports to docker network) have "Ports": null instead of an empty array [].

JSON Response from /api/docker/containers endpoint

{
  "containers": [
    {
      "Id": "...",
      "Names": ["/authentik-worker"],
      "Image": "authentik/server:2025.10",
      "ImageID": "sha256:...",
      "Command": "dumb-init -- ak worker",
      "Created": "...",
      "Ports": null,
    }
  ]
}

Stack Trace:

jquery-3.6.0.min.js:2 TypeError: Cannot read properties of null (reading 'map')
    at <anonymous>:172:43
    at Array.forEach (<anonymous>)
    at processDockerData (<anonymous>:133:20)
    at getDockerContainers (<anonymous>:100:13)

Describe the networking setup you are using

  • Are you using the docker build of Zoraxy? Yes
  • Zoraxy version? zoraxydocker/zoraxy:v3.3.0 (Image ID: sha256:1d88ee9f6ded9db63757e8f9336c5715fc529496c7e8b0b3c17f7706f57e3a5a)
  • Are you using Cloudflare? Yes (Cloudflared Tunnel)
  • Host OS: macOS
    • Docker Desktop: 4.55.0
    • Docker Engine: 29.1.3
    • Docker Compose: v2.40.3-desktop.1
  • Docker Socket Proxy: Zoraxy is running behind tecnativa/docker-socket-proxy with the following permissions enabled. Here is the docker-compose.yaml file:
environment:
  LOG_LEVEL: info
  INFO: 1
  PING: 1
  EVENTS: 1
  VERSION: 1
  NETWORKS: 1
  CONTAINERS: 1

Additional context
I suspect that the frontend processDockerData function assumes Ports is always an array and attempts to .map() it without checking if it is null first.

Here is the additional screenshot where the error pops up:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions