Skip to content

[Bug] Add task in Alarm List fails with TypeError when accessing SSL push template list #267

Description

@rickydev254

Environment

  • aaPanel version: 8.0.1
  • OS: Debian 13 (Trixie)
  • Python version: 3.12.3
  • Browser: Firefox 140.0

Steps to reproduce

  1. Go to Panel Settings → Alarm→Alarm List→Add task

Expected behavior
Add task configuration should:

Allow the user to enable and save alarm settings

Actual behavior

  • The panel throws a 500 error with the message: An error occurred while the panel was running!
  • The template list fails to load
  • No alarm can be configured

Error:
TypeError: string indices must be integers, not 'str'

File "/www/server/panel/mod/base/push_mod/ssl_push.py", line 136, in filter_template
items = [{"title": i["domain"], "value": i["domain"]} for i in domain_list]
~^^^^^^^^^^
TypeError: string indices must be integers, not 'str'

Root cause
In ssl_push.py at line 136, the code assumes domain_list is always a list of dictionaries with a "domain" key:

items = [{"title": i["domain"], "value": i["domain"]} for i in domain_list

However, on aaPanel 8.0.1 with Python 3.12 on Debian 13, domain_list is returned as a plain list of strings, causing the TypeError when string indexing is attempted with "domain".

Proposed fix

Add an isinstance check to handle both string and dict formats gracefully:

    items = [{"title": (i if isinstance(i, str) else i["domain"]), "value": (i if isinstance(i, str) else i["domain"])} for i in domain_list]

Impact
The alarm/push notification feature is completely unusable. Any attempt to push task templates results in a panel-level exception, preventing users from configuring any monitoring alerts.

Notes

  • Reproduced consistently on Debian 13 with Python 3.12.3
  • The proposed fix was verified locally and resolves the error without any side effects

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions