dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
865 stars 467 forks source link

Stupid issue causing a site delete to fail - unpublishing an archived template #29341

Closed wezell closed 3 weeks ago

wezell commented 3 months ago

Parent Issue

No response

Problem Statement

Trying to delete an unused site and it is failing.

Cannot unpublish an archived template. Trying to delete a site and it is failing with this error:

[23/07/24 19:49:56:338 GMT] ERROR business.HostAPIImpl: An error occurred when User 'user-0f978bae-b89d-4685-b4c3-ae3ec2e8cc2c' tried to delete Site 'demo.dotcms.com': Template can not be unpublished because is archived
com.dotmarketing.business.DotStateException: Template can not be unpublished because is archived
    at com.dotmarketing.portlets.templates.business.TemplateAPIImpl.unpublishTemplate(TemplateAPIImpl.java:471) ~[classes/:?]
    at com.dotmarketing.portlets.contentlet.business.HostFactoryImpl.deleteSite(HostFactoryImpl.java:536) ~[classes/:?]
    at com.dotmarketing.portlets.contentlet.business.HostFactoryImpl.innerDeleteSite(HostFactoryImpl.java:433) ~[classes/:?]
    at com.dotmarketing.portlets.contentlet.business.HostFactoryImpl$1DeleteSiteThread.call(HostFactoryImpl.java:668) ~[classes/:?]
    at com.dotmarketing.portlets.contentlet.business.HostFactoryImpl$1DeleteSiteThread.call(HostFactoryImpl.java:664) ~[classes/:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
    at java.lang.Thread.run(Thread.java:829) [?:?]

Steps to Reproduce

Acceptance Criteria

Unpublish should be idempotent and not care about archived state or not.

dotCMS Version

24.x

Proposed Objective

Reliability

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

josemejias11 commented 2 months ago

Approved: Tested on trunk_e622545, Docker, macOS 14.5, FF v126.0.1