icingaweb2-module-director icon indicating copy to clipboard operation
icingaweb2-module-director copied to clipboard

Unable to clone single service

Open mskrgulja opened this issue 1 year ago • 4 comments

Expected Behavior

Cloning a single service should be successful.

Current Behavior

When cloning a single service the operation fails, with the error message: "Trying to recreate icinga_service ("{"host_id":"1","object_name":"test2"}", id=180) (DbObject.php:928)" It seems the Director is trying to clone a service to the new one but with same ID as the cloned one is and it throws Duplicate ID exception there , at least when looking into the DbObject.php line:930: image

Possible Solution

Steps to Reproduce (for bugs)

  1. Go to: Icinga Director > Services > Single Services image

  2. Select a service there and click on Clone image

  3. Enter a new service name and click Clone and there the error message will appear image

Your Environment

  • Director version (System - About): 1.10.2
  • Icinga Web 2 version and modules (System - About): 2.11.4
  • Icinga 2 version (icinga2 --version): r2.13.5-1
  • Operating System and version: CentOS Linux release 7.9.2009
  • Webserver, PHP versions: 7.3.33

mskrgulja avatar Aug 31 '23 11:08 mskrgulja

I tried that like ten times and couldn't reproduce the issue. Things you can try since it seems you are on the beginning on your journey with icinga director.

  • delete the host and the host template.
  • create a new host template
  • create a host using the host-template
  • assign a service to the host.
  • clone that service

moreamazingnick avatar Sep 04 '23 07:09 moreamazingnick

Hey @moreamazingnick, Thank you for your answer. The screenshots are from our TEST Icinga and we have this exact issue on our PROD icinga (same versions)..

mskrgulja avatar Sep 04 '23 08:09 mskrgulja

I tried to do everything @moreamazingnick recommended, but the issue still remains.

mskrgulja avatar Sep 05 '23 05:09 mskrgulja

I tried as well, with MariaDB, PostreSQL - works as expected

Thomas-Gelf avatar Oct 11 '23 10:10 Thomas-Gelf