semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Problem: New Scheduled Task Variables Not getting set

Open invaderb opened this issue 1 month ago • 4 comments

Issue

Not sure if anyone else is having this issue but I updated from semaphoreUI 2.15 to 2.16-latest to get the new variables feature in scheduled jobs however none of the variables that are set are getting passed to the playbook.

 9:46:02 AM
TASK [Display variable info] ***************************************************
9:46:02 AM
[ERROR]: Task failed: Finalization of task args for 'ansible.builtin.debug' failed: Error while resolving value for 'msg': 'app_name' is undefined
9:46:02 AM
9:46:02 AM
Task failed.
9:46:02 AM
Origin: /tmp/semaphore/project_3/repository_2_template_5/playbooks/set-ec2-state.yaml:17:7
9:46:02 AM
9:46:02 AM
15
9:46:02 AM
16   tasks:
9:46:02 AM
17     - name: Display variable info
9:46:02 AM
         ^ column 7
9:46:02 AM
9:46:02 AM
<<< caused by >>>
9:46:02 AM
9:46:02 AM
Finalization of task args for 'ansible.builtin.debug' failed.
9:46:02 AM
Origin: /tmp/semaphore/project_3/repository_2_template_5/playbooks/set-ec2-state.yaml:18:7
9:46:02 AM
9:46:02 AM
16   tasks:
9:46:02 AM
17     - name: Display variable info
9:46:02 AM
18       debug:
9:46:02 AM
         ^ column 7
9:46:02 AM
9:46:02 AM
<<< caused by >>>
9:46:02 AM
9:46:02 AM
Error while resolving value for 'msg'.
9:46:02 AM
Origin: /tmp/semaphore/project_3/repository_2_template_5/playbooks/set-ec2-state.yaml:19:14
9:46:02 AM
9:46:02 AM
17     - name: Display variable info
9:46:02 AM
18       debug:
9:46:02 AM
19         msg: |
9:46:02 AM
                ^ column 14
9:46:02 AM
9:46:02 AM
<<< caused by >>>
9:46:02 AM
9:46:02 AM
'app_name' is undefined
9:46:02 AM
Origin: /tmp/semaphore/project_3/repository_2_template_5/playbooks/set-ec2-state.yaml:13:15
9:46:02 AM
9:46:02 AM
11     
9:46:02 AM
12     # Working directory (same as your main deployment playbook)
9:46:02 AM
13     tofu_dir: "{{ terraform_working_dir | default(['/var/semaphore/terraform', app_name, env_name] | join('/')) }}"
9:46:02 AM
                 ^ column 15
9:46:02 AM
9:46:02 AM
fatal: [localhost]: FAILED! => {"msg": "Task failed: Finalization of task args for 'ansible.builtin.debug' failed: Error while resolving value for 'msg': 'app_name' is undefined"}
Image

Impact

Ansible (task execution)

Installation method

Package

Database

SQLite

Browser

Firefox

Semaphore Version

2.16.43-5507a11-1762372202

Ansible Version

ansible [core 2.19.4]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/braydonh/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/braydonh/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  pyyaml version = 6.0.1 (with libyaml v0.2.5)

Logs & errors

No response

Manual installation - system information

No response

Configuration

No response

Additional information

No response

invaderb avatar Nov 19 '25 16:11 invaderb

Same for me. If you edit the schedule again, the variables are empty aswell. I also haven't found anything in the DB (MariaDB) where the variables could get saved. Maybe that's the problem

cr4ckDe avatar Nov 27 '25 19:11 cr4ckDe

@cr4ckDe interesting my variables are getting saved if I edit the scheduled job, however looking in the database there is a column in projuct__schedule called task_params_id which is null for that record which is foriegn key'd to project__task_params which is completely empty which makes no sense 🤷

invaderb avatar Dec 01 '25 16:12 invaderb

Oh I figured out it's auto-filling with default values from the template

invaderb avatar Dec 01 '25 17:12 invaderb

duplicate of #3304

m4l0n avatar Dec 08 '25 02:12 m4l0n