+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Serious error: A template with the same name already exists.

Serious error: A template with the same name already exists.

20 posts, 0 answered
  1. stephen@scizzortell.com
    stephen@scizzortell.com avatar
    3 posts
    Registered:
    15 May 2007
    17 May 2007
    Link to this post
    As odd as it sounds, I added a new folder in "Files," and now every time I try to access <MySite>/Sitefinity/Default.aspx, an exception is thrown "A template with the same name already exists" traced to Telerik.Cms.Data.PageTemplate.CheckNames()

    And now I can't do anything with the site in question since I can't access Default.aspx.

    Any help?
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    17 May 2007
    Link to this post
    Hi Stephen,

    Most likely you have duplicated a page template and then you have put a master page in App_Master folder with the same name. Please remove any master pages you have added to this folder and restart your application. If the application starts normally you need to either delete your duplicated templates or rename the matching master pages.

    This is a bug we just discovered. Thank you for reporting it we will fix it for the service pack.
    Please let us know if this workaround solves the problem.

    Thanks in advance,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Patrick
    Patrick avatar
    7 posts
    Registered:
    30 Sep 2008
    08 Jan 2009
    Link to this post
    Hi,

    I installed the trial version of sitefinity and setup a website.
    Changed to the community version but using the same database.

    Now when I edit a template I receive the following error:

    Exception Type: System.ArgumentException

    Message: A template with the same name already exists.

    Source: Telerik.Cms.Data

    Stack Trace:
       at Telerik.Cms.Data.PageTemplate.CheckNames()
       at Telerik.Cms.Data.PageTemplate.VerifyObject()
       at Nolics.ORMapper.Base.OdbClassHelper.VerifyClass(IOdbClass cl)
       at Telerik.Cms.Data.PageBase.Nolics.ORMapper.Base.IOdbClass.BeginCommit()
       at Nolics.ORMapper.Base.Transaction.Commit(Boolean fCleanIfSuccess)
       at Nolics.ORMapper.Base.Transaction.Commit()
       at Telerik.Cms.Data.StagedPage.Publish()
       at Telerik.Cms.Data.StagedPage.CheckIn()
       at Telerik.Cms.Web.UI.ToolBar.Button_Command(Object sender, CommandEventArgs e)
       at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
       at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    -
    Any clue to solve this? As now I can not edit the template!!!

    Regards,
    Patrick

  4. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    09 Jan 2009
    Link to this post
    Hello Patrick,

    Thank you for reporting this issue.
    We recently received a report for the same error with the same stack trace. Unfortunately, we were not able to reproduce it locally or get the damaged database.
    Is it possible for you to send us your database and the ~/App_Master folder, so we could investigate them locally?
    You can do this by opening a new support ticket or send the files to vladimir.vasilev@telerik.com.

    Thanks in advance.

    Kind regards,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Doug Odegaard
    Doug Odegaard avatar
    6 posts
    Registered:
    27 Oct 2004
    21 Jan 2009
    Link to this post
    I have the exact same problem....have you had any insight into this or should I submit a support ticket.  Basically even renaming the Master page before upload causes an issue.  The problem for us is when dragging on a SiteTabStrip it throws the following stack trace....help!

     

    Server Error in '/alps3.5' Application.

    A template with the same name already exists.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: A template with the same name already exists.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [ArgumentException: A template with the same name already exists.]
       Telerik.Cms.Data.PageTemplate.CheckNames() +526
       Telerik.Cms.Data.PageTemplate.VerifyObject() +20
       Nolics.ORMapper.Base.OdbClassHelper.VerifyClass(IOdbClass cl) +41
       Telerik.Cms.Data.PageBase.Nolics.ORMapper.Base.IOdbClass.BeginCommit() +12
       Nolics.ORMapper.Base.Transaction.Commit(Boolean fCleanIfSuccess) +849
       Nolics.ORMapper.Base.Transaction.Commit() +10
       Telerik.Cms.Data.StagedPage.Publish() +426
       Telerik.Cms.Data.StagedPage.CheckIn() +400
       Telerik.Cms.Web.UI.ToolBar.Button_Command(Object sender, CommandEventArgs e) +123
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +108
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
       System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    
  6. Patrick
    Patrick avatar
    7 posts
    Registered:
    30 Sep 2008
    21 Jan 2009
    Link to this post

    Hi Doug,

     

    I have opened a support ticket and the last response was:

    "Try removing the problematic template using windows explorer. Restart IIS. Then, re upload the template and try to edit it. If you use Sitefinity backend, all references to your pages that use this template will be lost"

    Still, I do receive the error.

    For us is dragging a generic content that causes the error to occur.

    Regards,

    Patrick

  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    21 Jan 2009
    Link to this post
    Hi Patrick,

    We have already sent a reply to your support ticket.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Doug Odegaard
    Doug Odegaard avatar
    6 posts
    Registered:
    27 Oct 2004
    21 Jan 2009
    Link to this post
    OK...this is definitely a bug and will offer steps to recreate it.  Thanks Patrick for your response.  It helped me to see how to recreate it.

    Upload a new template
    Attempt to add a control like SiteTabStrip in my case
    Get the error "A template already exists...." or as noted in previous post

    So what I did to fix my issue was the following.  Much trial and error to get it to work.

    1. Remove Template
    2. Restart IIS App Pool and Website.  Did not restart all of IIS
    3. Login to Admin Console
    4. Upload Template (I saw the "Template Saved" message this time as I had not before
    5. Changed Theme and Dragged on SiteTabStrip
    6. Edited SiteTabStrip to remove Default skin property
    7. Saved and got the "A template with this same name already exists" as before
    8. Went into the Windows Explorer and removed the template.
    9. Saved it but got the message "Template Master Page is missing"
    10. Restored the .master page to the directory
    11. Refreshed the page and the SiteTabStrip with my changed were persisted and the template was successfully saved

    It appears that removing the .master page during the "Save" operation allows it to go to the database but bombs the site until the .master page is restored.  So I think the error is real and needs to be corrected in the SF codebase.

    Telerik support: if you need me to submit anything let me know.

    Thanks in advance and glad to have it working again
  9. Michael
    Michael avatar
    17 posts
    Registered:
    12 Oct 2008
    27 Jan 2009
    Link to this post
    This fix only works if I want to tweak a control already on my template.  In my scenario, I cannot add any new controls after adding the tab strip (I also removed the default skin).

    I tried removing the tab strip control, and that also fails with the same error.  This is so frustrating, as I am coming up on a deadline to present the site to a client, and the whole thing is broken.

    How can I fix this?  Should I reinstall the whole thing?  start a new site?

    Deleting and adding the templates back does not work.

    What database table holds info on the templates?  I would liek to look at the raw data to see what's there.
  10. Patrick
    Patrick avatar
    7 posts
    Registered:
    30 Sep 2008
    27 Jan 2009
    Link to this post
    Hi Michael,

    I just uploaded my database and complete site to telerik support. No solutions as of yet, but they are working on it.
    As soon as I have a solution or workaround I'll post it here for others to tackle this one too.

    Regards,
    Patrick
  11. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    27 Jan 2009
    Link to this post
    Thank you Patrick,

    We will investigate your project and will post the result here.

    Kind regards,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  12. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    29 Jan 2009
    Link to this post
    Hi,

    We successfully reproduced the exception with the Patrick's project. We localized the error, but we didn't manage to find what exactly is causing it, because it comes from the Nolics database classes.
    However, we made appropriate changes by re-implementing that functionality, so the fix will be available in the upcoming release.

    We are sorry for the inconvenience and thank you for the assistance.

    All the best,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  13. James Reategui
    James Reategui avatar
    22 posts
    Registered:
    14 Oct 2008
    12 Feb 2009
    Link to this post
    BTW this error still comes up in 3.6 Beta.

    It appears to only occurr after adding the Site Tabstrip control to a template.
  14. Michael
    Michael avatar
    17 posts
    Registered:
    12 Oct 2008
    12 Feb 2009
    Link to this post
    BTW, this error only happens after the addition of TabStrip in 3.5.x.
  15. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    12 Feb 2009
    Link to this post
    Hi Michael,

    The problem will be fixed in the official release of 3.6. Version 3.6 will be available for downloading within next 2 days.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  16. Michael
    Michael avatar
    17 posts
    Registered:
    12 Oct 2008
    13 Feb 2009
    Link to this post
    I upgraded this morning (to 3.6) and the upgrade actually breaks all page functionality (I presume for sites afflicted with the bug outlined above).

    To get around this issue, I deleted all references to pages and templates that I created in the following tables:

    sf_PageContentBase (I left "Default.Master")
    sf_CmsTemplContent (I left the reference to Default.Master)
    sf_CmsRootPage
    sf_PageBase (I left "root" and "Default")

    I hope this helps others.  My site was small (very few pages) and so it will be easy to recreate. But, I don't envy the task for anyone with a larger site map.

    Mike
  17. Patrick
    Patrick avatar
    7 posts
    Registered:
    30 Sep 2008
    16 Feb 2009
    Link to this post
    Did the upgrade and fortunately did not run into the issues Michael described.

    Finally, I can edit the templates again without any errors!

    Regards,
    Patrick
  18. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    17 Feb 2009
    Link to this post
    Hello,

    Thank you both for following up.

    Michael, we would be glad to find out the reason for this behavior. If you find a constant way to reproduce ti, please contact us. I believe that you will not face this problem with a fresh project though.

    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  19. Michael
    Michael avatar
    17 posts
    Registered:
    12 Oct 2008
    17 Feb 2009
    Link to this post
    Please see my last forum post in this thread for more info on this.  You are correct that a fresh install does not produce this problem. 

    It would seem that my DB was not upgraded properly, for whatever reason, using the patch.  I think this is to blame for error I received above, as well as the subsequent error referenced in the thread link above.

    I am sorry that I don't have time to try to reproduce this again.

    Mike
  20. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    17 Feb 2009
    Link to this post
    Hi,

    Don't worry about this, Michael. We will have this in mind and will try to see the history of the thread in order to understand the reason for the issue.
    I am glad you have it working anyway!

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
20 posts, 0 answered