Skip to content

Problem: Issue starting Semaphore server after v2.14.0 #2980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
guyke01 opened this issue Apr 29, 2025 · 6 comments
Open

Problem: Issue starting Semaphore server after v2.14.0 #2980

guyke01 opened this issue Apr 29, 2025 · 6 comments
Assignees
Milestone

Comments

@guyke01
Copy link

guyke01 commented Apr 29, 2025

Issue

After upgrading to version v2.14.0 or higher the Semaphore server is not booting anymore. The following error is being generated in the logs:

cannot assign value of type string to map element of type null

After reverting to v2.13.15 the container boots again but due to the DB migration some things don't work.

Impact

Docker

Installation method

Docker

Database

MySQL

Browser

Microsoft Edge

Semaphore Version

2.14.0 / 2.14.1 / 2.14.3 / 2.14.4

Ansible Version

Logs & errors

Pinging database on mysql port 3306...
No additional python dependencies to install
Starting semaphore server
Loading config
Validating config
panic: cannot assign value of type string to map element of type null
goroutine 1 [running]:
github.com/semaphoreui/semaphore/cli/cmd.createStoreWithMigrationVersion({0xda8a64, 0x4}, 0x0, 0x0)
github.com/semaphoreui/semaphore/cli/cmd.createStore(...)
	/go/src/semaphore/cli/cmd/root.go:185 +0xd7
	/go/src/semaphore/cli/cmd/root.go:194
github.com/semaphoreui/semaphore/cli/cmd.runService()
	/go/src/semaphore/cli/cmd/root.go:64 +0x45
github.com/semaphoreui/semaphore/cli/cmd.init.func9(0xc0000fd000?, {0xda8aa4?, 0x4?, 0xda8aa8?})
	/go/src/semaphore/cli/cmd/server.go:18 +0xf
github.com/spf13/cobra.(*Command).execute(0x2298ca0, {0xc00012e580, 0x2, 0x2})
github.com/spf13/cobra.(*Command).ExecuteC(0x2297c20)
	/go/src/semaphore/vendor/github.com/spf13/cobra/command.go:1019 +0xa7b
	/go/src/semaphore/vendor/github.com/spf13/cobra/command.go:1148 +0x40c
github.com/spf13/cobra.(*Command).Execute(...)
	/go/src/semaphore/vendor/github.com/spf13/cobra/command.go:1071
github.com/semaphoreui/semaphore/cli/cmd.Execute()
main.main()
	/go/src/semaphore/cli/cmd/root.go:57 +0xc5
	/go/src/semaphore/cli/main.go:8 +0xf

Manual installation - system information

No response

Configuration

docker-compose.yml

services:
  mysql:
    restart: unless-stopped
    image: mysql:8.0
    hostname: mysql
    container_name: semaphore_db
    volumes:
      - /opt/semaphore/db:/var/lib/mysql
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
      MYSQL_DATABASE: REDACTED
      MYSQL_USER: REDACTED
      MYSQL_PASSWORD: REDACTED
    networks:
      ansible:
        ipv4_address: 172.22.54.11

  semaphore:
    restart: unless-stopped
    ports:
      - 3000:3000
    image: semaphoreui/semaphore:v2.14.0
    container_name: semaphore_server
    environment:
      SEMAPHORE_DB_USER: REDACTED
      SEMAPHORE_DB_PASS: REDACTED
      SEMAPHORE_DB_HOST: mysql # for postgres, change to: postgres
      SEMAPHORE_DB_PORT: 3306 # change to 5432 for postgres
      SEMAPHORE_DB_DIALECT: mysql # for postgres, change to: postgres
      SEMAPHORE_DB: REDACTED
      SEMAPHORE_PLAYBOOK_PATH: /tmp/semaphore/
      SEMAPHORE_ADMIN_PASSWORD: REDACTED
      SEMAPHORE_ADMIN_NAME: REDACTED
      SEMAPHORE_ADMIN_EMAIL: REDACTED
      SEMAPHORE_ADMIN: REDACTED
      SEMAPHORE_SCHEDULE_TIMEZONE: Europe/Amsterdam
    depends_on:
      - mysql # for postgres, change to: postgres
    volumes:
      - /opt/semaphore/inventory/:/inventory:ro
      #- /opt/semaphore/config/config.json:/etc/semaphore/config.json:ro
    networks:
      ansible:
        ipv4_address: 172.22.54.10

networks:
  ansible:
    ipam:
      config:
        - subnet: 172.22.54.0/24

config.json

{
"ldap_enable": true,
"ldap_needtls": true,
"ldap_binddn": "REDACTED",
"ldap_bindpassword": "REDACTED",
"ldap_server": "domain.local:636",
"ldap_searchdn": "REDACTED",
"ldap_searchfilter": "(&(sAMAccountName=%s)(memberOf:1.2.840.113556.1.4.1941:=CN=GROUP))",
"ldap_mappings": {
"dn": "distinguishedName",
"mail": "mail",
"uid": "sAMAccountName",
"cn": "cn"
},
"access_key_encryption": "REDACTED=",
"cookie_encryption": "REDACTED",
"cookie_hash": "REDACTED",
"concurrency_mode": "node",
"max_parallel_tasks": 4
}

Additional information

No response

@fiftin fiftin self-assigned this Apr 29, 2025
@fiftin fiftin added this to the 2.14 milestone Apr 29, 2025
@fiftin
Copy link
Collaborator

fiftin commented Apr 29, 2025

Hi @guyke01 please try https://github.com/semaphoreui/semaphore/releases/tag/v2.14.5

I hope it solves the issue, but I'm not sure.

@guyke01
Copy link
Author

guyke01 commented Apr 29, 2025

Hi @fiftin I've used the tag v2.14.5 and started the container but got the same error

Pinging database on mysql port 3306...
No additional python dependencies to install
panic: cannot assign value of type string to map element of type null
Starting semaphore server
Loading config
Validating config
goroutine 1 [running]:
github.com/semaphoreui/semaphore/cli/cmd.createStoreWithMigrationVersion({0xda7be4, 0x4}, 0x0, 0x0)
	/go/src/semaphore/cli/cmd/root.go:185 +0xd7
github.com/semaphoreui/semaphore/cli/cmd.createStore(...)
	/go/src/semaphore/cli/cmd/root.go:194
github.com/semaphoreui/semaphore/cli/cmd.runService()
	/go/src/semaphore/cli/cmd/root.go:64 +0x45
github.com/semaphoreui/semaphore/cli/cmd.init.func9(0xc0000fd000?, {0xda7c24?, 0x4?, 0xda7c28?})
github.com/spf13/cobra.(*Command).execute(0x2296ca0, {0xc00012e580, 0x2, 0x2})
	/go/src/semaphore/vendor/github.com/spf13/cobra/command.go:1019 +0xa7b
	/go/src/semaphore/cli/cmd/server.go:18 +0xf
github.com/spf13/cobra.(*Command).Execute(...)
	/go/src/semaphore/vendor/github.com/spf13/cobra/command.go:1148 +0x40c
github.com/spf13/cobra.(*Command).ExecuteC(0x2295c20)
	/go/src/semaphore/vendor/github.com/spf13/cobra/command.go:1071
github.com/semaphoreui/semaphore/cli/cmd.Execute()
	/go/src/semaphore/cli/cmd/root.go:57 +0xc5
main.main()
	/go/src/semaphore/cli/main.go:8 +0xf

@fiftin
Copy link
Collaborator

fiftin commented Apr 29, 2025

@guyke01 can you check database table option? Do you something strange in it?

@guyke01
Copy link
Author

guyke01 commented Apr 29, 2025

@fiftin this is the export of the option table

+--------------------------+---------------+
| key                      | value         |
+--------------------------+---------------+
| apps.ansible.active      | true          |
| apps.powershell.active   | true          |
| apps.powershell.icon     | powershell    |
| apps.powershell.order    | 0             |
| apps.powershell.priority | 0             |
| apps.powershell.title    | Powershell    |
| apps.python.active       | false         |
| apps.python.args         | null          |
| apps.python.color        |               |
| apps.python.dark_color   |               |
| apps.python.icon         | python        |
| apps.python.order        | 0             |
| apps.python.path         | python        |
| apps.python.title        | Python Script |
| apps.terraform.active    | false         |
| apps.tofu.active         | false         |
+--------------------------+---------------+

I see there is a value null in the key apps.python.args. After i delete the value the following error appears:

panic: cannot assign value of type string to map element of type

Is there something i need to delete in the table?

@guyke01
Copy link
Author

guyke01 commented Apr 29, 2025

After i deleted the row apps.python.args the container started again and works now. The issue is solved!

@fiftin
Copy link
Collaborator

fiftin commented Apr 29, 2025

Thank you @guyke01 !
It is really helpful answer! null string shouldn't be parsed as null. I will try to reproduce soon.

And I fixed another issue with nullable value column (now it not null), haha ))

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

No branches or pull requests

2 participants