#4253·semaphore

Problem: migrate --from-boltdb skips every template with "invalid app: ansible"

Author: pavlojsCreated Sep 21, 2026Updated Sep 27, 2026

Issue

semaphore migrate --from-boltdb imports no templates when config.json has no apps section, which is the default. Every template fails with invalid app: ansible (ansible-playbook is in PATH), so all schedules and tasks fail after it and the run ends with Migration failed: failed to import TaskOutput: ..., yet the exit code is 0.

Expected: templates are migrated, as the docs describe.

Reproduced with a BoltDB file from 2.16.51 (7 Ansible templates) and config.json switched to SQLite:

semaphore migrate --from-boltdb /opt/semaphore/semaphore_db.bolt --config /opt/semaphore/config.json --err-log-size 3

Same result when 2.18.30 is first started on the BoltDB file so it upgrades the schema.

Impact

Database

Installation method

Package

Database

SQLite

Browser

No response

Semaphore Version

2.18.30-9dcfe85-1788086235 (community .deb)

Ansible Version

bash
ansible-playbook [core 2.17.14]

Logs & errors

Imported Template                                          7
    Errors: 7
       Unable to restore Template: invalid app: ansible
       Unable to restore Template: invalid app: ansible
       Unable to restore Template: invalid app: ansible
       Unable to restore Template: invalid app: ansible
Imported Schedule                                          4
    Errors: 4
       Unable to restore Schedule: Template key 1 not found
       Unable to restore Schedule: Template key 6 not found
       Unable to restore Schedule: Template key 7 not found
       Unable to restore Schedule: Template key 10 not found
Imported Task                                            610
    Errors: 611
       Unable to restore Task: Template key 1 not found
       Unable to restore Task: Template key 1 not found
       Unable to restore Task: Template key 1 not found
       Unable to restore Task: Template key 1 not found
Migration failed: failed to import TaskOutput: Task key 2147483646 not found

Manual installation - system information

Debian 12 (LXC)

Configuration

No apps section in config.json (the default).

Additional information

migrateBoltDb() calls util.ConfigInit() again at cli/cmd/migrate.go:97, which resets Config.Apps (util/config.go:502) after LookupDefaultApps() already ran in cli/cmd/root.go:330, so only apps declared in config.json are accepted.

Workaround: adding "apps": {"ansible": {}, "bash": {}} to config.json before migrating brought all 7 templates, 4 schedules and 611 tasks across.