Repository navigation
Description
Problem Statement
Content Drive's bulk folder duplicate (#37062) limits one run to 50 folders (FOLDER_BULK_DUPLICATE_MAX_PATHS, default 50, advertised to clients as folderBulkDuplicate.maxPaths on /api/v1/appconfiguration). The UI and the dedicated endpoint POST /api/v1/assets/folders/_bulkduplicate both enforce it: more than 50 paths is refused with 400 OVER_MAX_PATHS.
_bulkduplicate validates the request and then puts it on the folderBulkDuplicate job queue (FolderBulkDuplicateHelper.java:110). The generic job-queue endpoint POST /api/v1/jobs/{queueName} can put a job on that same queue directly, and nothing on that path checks the limit:
- The 50-path check lives only in
FolderBulkDuplicateHelper.submit, which the generic endpoint never calls. FolderBulkDuplicateProcessordoes not implementValidator, so the job framework has nothing to check either. OnlyBulkRefreshContentletsProcessorandImportContentletsProcessorimplement it today.
Impact:
- Any logged-in back-end user can queue an unbounded number of folder duplicates in one request. Anonymous and front-end users are still refused (401).
- Each folder still goes through its own permission check, so this does not let anyone copy what they could not copy before. The risk is load: every folder copy is a long database transaction, and runs into the same parent wait for each other.
- Normal authors don't hit it: the UI never sends more than 50. It takes a hand-written API call.
Probably affected too (not verified): the folder bulk delete (#37063) and bulk upload (#37166) queues follow the same pattern. Their limits are checked only in their own endpoints, and their processors (FolderBulkDeleteProcessor, BulkUploadProcessor) do not implement Validator.
Steps to Reproduce
- On a site, create 51 folders, e.g.
//demo.dotcms.com/qa-bulkdup-max/f01/…f51/. - Confirm the advertised limit:
GET /api/v1/appconfiguration→folderBulkDuplicate.maxPaths: 50. - Submit all 51 through the dedicated endpoint:
Result:
curl -u admin@dotcms.com:admin -X POST http://localhost:8080/api/v1/assets/folders/_bulkduplicate \ -H 'Content-Type: application/json' -d '{"assetPaths": ["//demo.dotcms.com/qa-bulkdup-max/f01/", "…", "//demo.dotcms.com/qa-bulkdup-max/f51/"]}'
400,errorCode: OVER_MAX_PATHS, "selection exceeds the maximum of 50 paths". Correct. - Submit the same body to the generic job-queue endpoint:
Result:
curl -u admin@dotcms.com:admin -X POST http://localhost:8080/api/v1/jobs/folderBulkDuplicate \ -H 'Content-Type: application/json' -d '{"assetPaths": ["//demo.dotcms.com/qa-bulkdup-max/f01/", "…", "//demo.dotcms.com/qa-bulkdup-max/f51/"]}'
200with ajobId. The job endsSUCCESSwithprocessed: 51, and all 51 folders are duplicated (f01_copy…f51_copy).
Side note: sending the same folder 3 times through the generic endpoint produced a single copy, but the job reported total: 3.
Acceptance Criteria
- A
folderBulkDuplicatejob with more paths thanFOLDER_BULK_DUPLICATE_MAX_PATHSis refused, however it is submitted:_bulkduplicateandPOST /api/v1/jobs/folderBulkDuplicategive the same answer for the same body. - The rest of
_bulkduplicate's submit-time validation also applies on every path (empty or malformedassetPaths). - Decide where the check lives, and record why:
- Option A — the processor implements
Validatorwith the same rules as the endpoint. Every way of creating the job is covered, followingImportContentletsProcessorandBulkRefreshContentletsProcessor. - Option B — the generic
/api/v1/jobs/{queueName}endpoint refuses domain queues that have their own dedicated endpoint (folderBulkDuplicate, folder bulk delete,assetBulkUpload), so they can only be created through the endpoint that validates them.
- Option A — the processor implements
- The job's reported
totalmatches the number of distinct folders it actually processes. - Check whether the folder bulk delete and bulk upload queues have the same bypass, and fix them the same way if they do (or open follow-up tickets).
- A test proves the limit cannot be skipped through the generic endpoint.
dotCMS Version
Latest from main: dotcms/dotcms:trunk_d4a354c (2026-10-02), which includes #37760 and #37761.
Severity
Medium - Some functionality impacted
Links
- Found during QA of Content Drive: folder copy, async job endpoint and frontend wiring #37062 (backend feat(content-drive): bulk folder duplicate backend (#37062) #37760).
- Related: Content Drive: bulk folder delete, async job endpoint and frontend wiring #37063 (bulk delete), Content Drive: bulk file upload (multi-file selection uploads only the first file) #37166 (bulk upload).
- NA (no Freshdesk ticket)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
docs(job-queue): declare each queue's entry point and enforce it at s…
github-actions commentedon Oct 6, 2026
PRs linked to this issue
docs(job-queue): name the admin and portlet gates, list both maintena…
ihoffmann-dot commentedon Oct 8, 2026
Handover: status of the fix for #37883
I am moving to another project. This is where the work stands so the team can pick it up.
Spec (PR 1): #37906, approved by @fabrizzio-dotCMS. Decisions: the generic endpoint refuses queues that have a dedicated endpoint (
403, message names the endpoint); every queue declares its entry point; plugin queues stay generic.Implementation: branch
issue-37883-job-queue-entry-points, off the spec branch. No PR is open yet for it. It has two commits on top of the spec: failing tests first (48d4ad83), then the fix (c6fc3ba4).Done
@JobQueueEntryPoint("<queue>")on the REST method of each dedicated endpoint (bulk duplicate, bulk delete, bulk upload, maintenance_fixand_clean).@Queue(genericEntry = true)on the queues fed by the generic endpoint (importContentlets,bulkRefreshContentlets,failSuccess,demo).JobQueueEntryPointsbuilds the answer from the Jandex index; the route in the message is read from the annotated method's own@Path. A queue not in the index (plugin, or registered by name at runtime) is treated as generic and logs one warning. With no index it fails closed.JobQueueHelper.assertGenericEntryis called by bothcreateJobmethods ofJobQueueResource(JSON and/upload) before anything is created.openapi.yamlregenerated.JobQueueEntryPointsTest(7),JobQueueEntryPointsCoverageTest(2, indexes the compiled classes and asserts each core queue declares exactly one entry point),JobQueueDomainQueuesBypassIntegrationTest(8, registered inJunit5Suite1). Regression run green:FolderBulkDuplicateResourceIT,FolderBulkDeleteResourceIT,BulkUploadResourceIT,MaintenanceResourceIntegrationTest,JobQueueHelperIntegrationTest.mainbefore the fix: the generic endpoint created jobs on all five queues for a back-end user with no admin role and no Maintenance portlet. The dedicated maintenance endpoints require admin and the portlet (MaintenanceResource.assertBackendUser), so this is wider than a missing portlet. Severity of this issue can be set from that.Deliberately not done (cut to keep this short)
JobQueueManagerAPIImpl.start()that refuses to start the queue manager when a core queue does not have exactly one declaration. The build-time coverage test is the only guard today. The spec still says "fails startup"; that is not true at runtime yet. Either implement it, or change the spec wording to "the build fails".InitServlet.init()does whenstart()throws (InitServlet.java:233), which matters for the item above.docs/backend/, and the ADR proposed in the plan ("every job queue declares its entry point, and the framework enforces it"), to be written indotCMS/platform-adrs./speckit-convergeand opening PR 2. Its description should state the rollback assessment: REST contract change,200to403on five queues, expected rollback safe (no response shape added).Things to know
plan.md,research.md,tasks.mdandquickstart.mdare gitignored in this repo, so they are not on the branch. The decisions above are the substance; nothing else is needed to continue.JobQueueHelperIntegrationTestfailed on its first attempt in one combined run (relation "cms_role" does not exist) and passed on rerun: it does not initialize the test database itself, so it flakes when it runs first. Not related to this change../mvnw verify -pl :dotcms-core,:dotcms-integration -Ddocker.skip -Dcoreit.test.skip=false -Dit.test=JobQueueDomainQueuesBypassIntegrationTest -Dtest=JobQueueEntryPointsTest -DfailIfNoTests=false -Dmaven.build.cache.enabled=false, and confirmTests run: Nindotcms-integration/target/failsafe-reports.fix(job-queue): generic job endpoint refuses queues that have a dedic…
test(job-queue): failing test for core queue declaring no entry point (…
fix(job-queue): refuse a core queue that declares no entry point (#37883
docs(job-queue): spec says an undeclared core queue is refused at run…
rjvelazco commentedon Oct 15, 2026
Passed QA
dotcms/dotcms:trunk_aa3d6a7]Video
video.mov