Impossible to delete existing template

Steps to reproduce the error:

  1. Create couple custom templates on the Templates window (/10000/virtual-server/edit_newtmpl.cgi).
  2. Delete the first one remembering it's name.
  3. Edit the second one's name and try to give it the deleted template's name and you will get:
Failed to save server template : A template with the same name already exists

Now time to get hands dirty on CLI. Run virtualmin list-templates to see all created templates are there intact:

virtualmin list-templates
ID                 Description                                                
------------------ ------------------------------------------------------------
0                  Default Settings                                           
1                  Settings For Sub-Domains                                   
135550761415309    First one                                                    
141411764525137    Second one  

Hmm, still there. Let's try to delete the fist one on CLI:

virtualmin delete-template --id 135550761415309
Deleted template First one with ID 135550761415309

Seems successful, but let's check again:

virtualmin list-templates
ID                 Description                                                
------------------ ------------------------------------------------------------
0                  Default Settings                                           
1                  Settings For Sub-Domains                                   
135550761415309    First one                                                    
141411764525137    Second one  

Still there!

Status: 
Closed (fixed)

Comments

Title: Failed to save server template : A template with the same name already exists » Impossible to delete existing template

As a temporary solution for those who are seeing the same issue, you can run:

rm -rf /etc/webmin/virtual-server/templates/135550761415309

Thanks for reporting this - it will be fixed in the next Virtualmin release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.