Skip to content

[BUG] swag-auto-uptime-kuma constraint failed: monitor.conditions #1095

@bondskin

Description

@bondskin

Is there an existing issue for this?

  • I have searched the existing issues

Name of mod

Hi,

I am not sure of the SWAG mod swag-auto-uptime-kuma is still actively maintained, but I am not able to get it running in combination with KUMA 2.0.2

Is the v2 of KUMA the issue here?

Name of base container

image: lscr.io/linuxserver/swag:latest

Current Behavior

Applying the maxmind mod...
swag | [mod-auto-uptime-kuma] Executing SWAG auto-uptime-kuma mod
swag | Applied the maxmind mod
swag | [mod-auto-uptime-kuma] The following notifications are enabled by default: ['2:gmail']
swag | [mod-auto-uptime-kuma] Adding Monitor 'Crowdsec' for container 'crowdsec'
swag | Traceback (most recent call last):
swag | File "/app/auto-uptime-kuma.py", line 127, in
swag | add_or_update_monitors(dockerService, configService, uptimeKumaService)
swag | File "/app/auto-uptime-kuma.py", line 23, in add_or_update_monitors
swag | uptime_kuma_service.create_monitor(container_name, container_config)
swag | File "/app/auto_uptime_kuma/uptime_kuma_service.py", line 135, in create_monitor
swag | monitor = self.api.add_monitor(**monitor_data)
swag | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
swag | File "/lsiopy/lib/python3.12/site-packages/uptime_kuma_api/api.py", line 1472, in add_monitor
swag | return self._call('add', data)
swag | ^^^^^^^^^^^^^^^^^^^^^^^
swag | File "/lsiopy/lib/python3.12/site-packages/uptime_kuma_api/api.py", line 550, in _call
swag | raise UptimeKumaException(r.get("msg"))
swag | uptime_kuma_api.exceptions.UptimeKumaException: insert into monitor (accepted_statuscodes_json, auth_method, body, conditions, database_connection_string, description, dns_resolve_server, dns_resolve_type, expiry_notification, headers, hostname, http_body_encoding, ignore_tls, interval, kafka_producer_brokers, kafka_producer_sasl_options, maxredirects, maxretries, method, mqtt_password, mqtt_success_message, mqtt_topic, mqtt_username, name, packet_size, parent, port, proxy_id, rabbitmq_nodes, resend_interval, retry_interval, timeout, type, upside_down, url, user_id) values ('["200-299"]', '', NULL, NULL, NULL, 'Automatically generated by SWAG auto-uptime-kuma', '1.1.1.1', 'A', false, NULL, NULL, 'json', false, 60, NULL, NULL, 10, 1, 'GET', '', '', '', '', 'Crowdsec', 56, NULL, NULL, NULL, NULL, 0, 60, 48, 'http', false, 'https://crowdsec.skynet22.org', 1) - SQLITE_CONSTRAINT: NOT NULL constraint failed: monitor.conditions
swag | s6-rc: warning: unable to start service init-mod-swag-auto-uptime-kuma-install: command exited 1
swag | /run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
swag | /run/s6/basedir/scripts/rc.init: fatal: stopping the container.

Expected Behavior

Monitors being added.

Steps To Reproduce

See my config below.

Environment

- OS: Debian Trixix
- How docker service was installed: compose

label example:

labels:
  - "swag.uptime-kuma.enabled=true"
  - "swag.uptime-kuma.monitor.name=influxdb"

CPU architecture

x86-64

Docker creation

SWAG
...
... linuxserver/mods:universal-docker|linuxserver/mods:swag-auto-uptime-kuma ...
 - DOCKER_HOST=tcp://socket-proxy:2375
      - UPTIME_KUMA_URL=http://192.168.2.11:3001
      - UPTIME_KUMA_USERNAME=admin
      - UPTIME_KUMA_PASSWORD=xxx

Container logs

socket-proxy:
[06/Dec/2025:12:42:33.654] proxy docker/socket 0/0/0/1/1 200 7870 - - ---- 1/1/0/0/0 0/0 "GET /v1.52/containers/d7082cbc58742efc211f0c0361d69d4880c26c5a356ce8714f5b9f2889ac1e41/json HTTP/1.1"


SWAG:
Applying the maxmind mod...
swag  | [mod-auto-uptime-kuma] Executing SWAG auto-uptime-kuma mod
swag  | Applied the maxmind mod
swag  | [mod-auto-uptime-kuma] The following notifications are enabled by default: ['2:gmail']
swag  | [mod-auto-uptime-kuma] Adding Monitor 'Crowdsec' for container 'crowdsec'
swag  | Traceback (most recent call last):
swag  |   File "/app/auto-uptime-kuma.py", line 127, in <module>
swag  |     add_or_update_monitors(dockerService, configService, uptimeKumaService)
swag  |   File "/app/auto-uptime-kuma.py", line 23, in add_or_update_monitors
swag  |     uptime_kuma_service.create_monitor(container_name, container_config)
swag  |   File "/app/auto_uptime_kuma/uptime_kuma_service.py", line 135, in create_monitor
swag  |     monitor = self.api.add_monitor(**monitor_data)
swag  |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
swag  |   File "/lsiopy/lib/python3.12/site-packages/uptime_kuma_api/api.py", line 1472, in add_monitor
swag  |     return self._call('add', data)
swag  |            ^^^^^^^^^^^^^^^^^^^^^^^
swag  |   File "/lsiopy/lib/python3.12/site-packages/uptime_kuma_api/api.py", line 550, in _call
swag  |     raise UptimeKumaException(r.get("msg"))
swag  | uptime_kuma_api.exceptions.UptimeKumaException: insert into `monitor` (`accepted_statuscodes_json`, `auth_method`, `body`, `conditions`, `database_connection_string`, `description`, `dns_resolve_server`, `dns_resolve_type`, `expiry_notification`, `headers`, `hostname`, `http_body_encoding`, `ignore_tls`, `interval`, `kafka_producer_brokers`, `kafka_producer_sasl_options`, `maxredirects`, `maxretries`, `method`, `mqtt_password`, `mqtt_success_message`, `mqtt_topic`, `mqtt_username`, `name`, `packet_size`, `parent`, `port`, `proxy_id`, `rabbitmq_nodes`, `resend_interval`, `retry_interval`, `timeout`, `type`, `upside_down`, `url`, `user_id`) values ('["200-299"]', '', NULL, NULL, NULL, 'Automatically generated by SWAG auto-uptime-kuma', '1.1.1.1', 'A', false, NULL, NULL, 'json', false, 60, NULL, NULL, 10, 1, 'GET', '', '', '', '', 'Crowdsec', 56, NULL, NULL, NULL, NULL, 0, 60, 48, 'http', false, 'https://crowdsec.skynet22.org', 1) - SQLITE_CONSTRAINT: NOT NULL constraint failed: monitor.conditions
swag  | s6-rc: warning: unable to start service init-mod-swag-auto-uptime-kuma-install: command exited 1
swag  | /run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
swag  | /run/s6/basedir/scripts/rc.init: fatal: stopping the container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions