Skip to content

[UNFIMP] UNFIMP_port is ignored when UNFIMP_version is set to UDMP-unifiOS #1524

@meeowgler

Description

@meeowgler

What installation are you running?

Production (netalertx) 📦

Is there an existing issue for this?

The issue occurs in the following browsers. Select at least 2.

  • Firefox
  • Chrome
  • Edge
  • Safari (unsupported) - PRs welcome
  • N/A - This is an issue with the backend

Current Behavior

With the Unifi Import plugin, [UNFIMP] UNFIMP_port is ignored when UNFIMP_version is set to UDMP-unifiOS.

You might wonder why UDMP-unifiOS would have a port other than 443. The new self-hosted Unifi OS Server (https://ui.com/download/software/unifi-os-server) presents itself as a UDMP-unifiOS compatible device, but hosts the UI/API on an alternate port.

Expected Behavior

When UNFIMP_port is configured, use this value even when UNFIMP_version is set to UDMP-unifiOS.

Steps To Reproduce

No response

Relevant app.conf settings

docker-compose.yml

Debug or Trace enabled

  • I have read and followed the steps in the wiki link above and provided the required debug logs and the log section covers the time when the issue occurs.

Relevant app.log section

14:25:44 [Plugin utils] ---------------------------------------------
14:25:44 [Plugin utils]  display_name :  UniFi import
14:25:44 [Plugins] CMD: python3 /app/front/plugins/unifi_import/script.py username={username} password={password}  host={host} sites={sites} port={port} verifyssl={verifyssl} version={version} fullimport={fullimport}
14:25:44 [Plugins] Resolving param: {'name': 'port', 'type': 'setting', 'value': 'UNFIMP_port'}
14:25:44 [Plugins] setTyp: {'dataType': 'string', 'elements': [{'elementType': 'input', 'elementOptions': [], 'transformers': []}]}
14:25:44 [Plugins] setTypJSN: {'dataType': 'string', 'elements': [{'elementType': 'input', 'elementOptions': [], 'transformers': []}]}
14:25:44 [Plugins] dType: string
14:25:44 [Plugins] Resolved value: 11443

14:25:45 [UNFIMP] In script
14:25:45 [UNFIMP] Full import needs to be done: config_value: once and lock_file_value: False
14:25:45 [UNFIMP] sites: ['default']
14:25:45 [UNFIMP] site: default
Traceback (most recent call last):
  File "/opt/venv/lib/python3.12/site-packages/urllib3/connection.py", line 204, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/opt/venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 110] Operation timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 488, in _make_request
    raise new_e
  File "/opt/venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 464, in _make_request
    self._validate_conn(conn)
  File "/opt/venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 1093, in _validate_conn
    conn.connect()
  File "/opt/venv/lib/python3.12/site-packages/urllib3/connection.py", line 759, in connect
    self.sock = sock = self._new_conn()
                       ^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/urllib3/connection.py", line 213, in _new_conn
    raise ConnectTimeoutError(
urllib3.exceptions.ConnectTimeoutError: (<HTTPSConnection(host='10.1.30.50', port=443) at 0x7f0f016cfd10>, 'Connection to 10.1.30.50 timed out. (connect timeout=None)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/venv/lib/python3.12/site-packages/requests/adapters.py", line 644, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 841, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/urllib3/util/retry.py", line 535, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='10.1.30.50', port=443): Max retries exceeded with url: /api/auth/login (Caused by ConnectTimeoutError(<HTTPSConnection(host='10.1.30.50', port=443) at 0x7f0f016cfd10>, 'Connection to 10.1.30.50 timed out. (connect timeout=None)'))

Docker Logs

 _   _      _    ___  _           _  __   __

| \ | |    | |  / _ \| |         | | \ \ / /

|  \| | ___| |_/ /_\ \ | ___ _ __| |_ \ V /

| .   |/ _ \ __|  _  | |/ _ \  __| __|/   \

| |\  |  __/ |_| | | | |  __/ |  | |_/ /^\ \

\_| \_/\___|\__\_| |_/_|\___|_|   \__\/   \/

   Network intruder and presence detector.

   https://netalertx.com

Startup pre-checks

--> data migration.sh 

--> capabilities audit.sh 

--> mounts.py 

 Path                     | R | W | Mount | RAMDisk | Performance | DataLoss 

--------------------------+---+---+-------+---------+-------------+----------

 /data                    | ✅| ✅|   ✅  |    ➖   |      ➖     |    ✅     

 /data/db                 | ✅| ✅|   ✅  |    ➖   |      ➖     |    ✅     

 /data/config             | ✅| ✅|   ✅  |    ➖   |      ➖     |    ✅     

 /tmp/run/tmp             | ✅| ✅|   ✅  |    ✅   |      ✅     |    ✅     

 /tmp/api                 | ✅| ✅|   ✅  |    ✅   |      ✅     |    ✅     

 /tmp/log                 | ✅| ✅|   ✅  |    ✅   |      ✅     |    ✅     

 /tmp/run                 | ✅| ✅|   ✅  |    ✅   |      ✅     |    ✅     

 /tmp/nginx/active-config | ✅| ✅|   ✅  |    ✅   |      ✅     |    ✅     

--> first run config.sh 

--> first run db.sh 

--> mandatory folders.sh 

    * Creating NetAlertX log directory.

    * Creating NetAlertX API cache.

    * Creating System services runtime directory.

    * Creating nginx active configuration directory.

    * Creating Plugins log.

    * Creating System services run log.

    * Creating System services run tmp.

    * Creating DB locked log.

    * Creating Execution queue log.

--> apply conf override.sh 

--> writable config.sh 

--> nginx config.sh 

--> expected user id match.sh 

--> host mode network.sh 

--> excessive capabilities.sh 

--> appliance integrity.sh 

══════════════════════════════════════════════════════════════════════════════

⚠️  Warning: Container is running as read-write, not in read-only mode.

    Please mount the root filesystem as --read-only or use read_only: true

    https://docs.netalertx.com/docker-troubleshooting/read-only-filesystem

══════════════════════════════════════════════════════════════════════════════

--> ports available.sh 

APP_CONF_OVERRIDE detected (set from GRAPHQL_PORT)

Starting /usr/sbin/php-fpm83 -y "/services/config/php/php-fpm.conf" -F (tee stderr to app.php_errors.log)

Starting supercronic --quiet "/services/config/cron/crontab" >>"/tmp/log/cron.log" 2>&1 &

Starting python3  -m server > /tmp/log/stdout.log 2> >(tee /tmp/log/stderr.log >&2)

Starting /usr/sbin/nginx -p "/tmp/run/" -c "/tmp/nginx/active-config/nginx.conf" -g "error_log stderr; error_log /tmp/log/nginx-error.log; daemon off;" &

Successfully updated IEEE OUI database (113040 entries)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Waiting for reply⏳Waiting for the original poster to respond, or discussion in progress.Workaround provided ⚒️A workaround for the issue was provided so no further actions will be taken.bug 🐛Something isn't workingwont do 🚫This will not be worked on. I might be open to PRs - check with me before starting work.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions