Skip to content

[Bug]: Duplicate key error when adding permission template #942

@gbeine

Description

@gbeine

Describe the problem

Adding a new permission template ends with

Jan 05 09:58:28 host25 poweradmin[695995]: {"level":"info","ts":1767603508.197411,"logger":"frankenphp","msg":"SQLSTATE[23505]: Unique violation: 7 ERROR:  duplicate key value violates unique constraint \"perm_templ_pkey\"\nDETAIL:  Key (id)=(4) already exists.","syslog_level":"notice"}
Jan 05 09:58:28 host25 poweradmin[695995]: {"level":"info","ts":1767603508.1974385,"logger":"frankenphp","msg":"#0 /app/lib/Infrastructure/Repository/DbPermissionTemplateRepository.php(49): PDOStatement->execute(Array)\n#1 /app/lib/Application/Controller/AddPermTemplController.php(71): Poweradmin\\Infrastructure\\Repository\\DbPermissionTemplateRepository->addPermissionTemplate(Array)\n#2 /app/lib/Application/Controller/AddPermTemplController.php(56): Poweradmin\\Application\\Controller\\AddPermTemplController->handleFormSubmission()\n#3 /app/lib/Application/Routing/SymfonyRouter.php(166): Poweradmin\\Application\\Controller\\AddPermTemplController->run()\n#4 /app/index.php(43): Poweradmin\\Application\\Routing\\SymfonyRouter->process()\n#5 {main}","syslog_level":"notice"}

Steps to reproduce

  1. Go to "Users" -> "Add permission template"
  2. Enter name and select permissions
  3. Click on "Add template"
  4. Feedback in browser is 'An error occurred while processing the request.', log shows message above

Version: Poweradmin v4.1.0, installed via docker.io/poweradmin/poweradmin:latest

Poweradmin version

4.1.0

Database

PostgreSQL

Additional information (optional)

No response

Metadata

Metadata

Assignees

Labels

coreCore FeaturesinfraPerformance & Infrastructure

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions