[ 
https://issues.apache.org/jira/browse/SLING-13408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18140187#comment-18140187
 ] 

Bhavik Kothari commented on SLING-13408:
----------------------------------------

Hi [~joerghoh]

I looked into this issue and identified the root cause:

Root Cause
In RepositoryService, the drop() method calls executeBulkAction("delete", ...), 
targeting: POST https://repository.apache.org/service/local/staging/bulk/delete

Sonatype Nexus 2 has no /staging/bulk/delete endpoint (only bulk/drop, 
bulk/promote, and bulk/close), so Nexus rejects the request as unauthorized 
with HTTP 403

In the test suite, this was previously masked because MockNexus accepted any 
arbitrary path prefix under /service/local/staging/bulk/ and the unit test 
asserted "delete".


Fix
Updated RepositoryService.drop() to use the bulk action "drop" (POST 
.../staging/bulk/drop).
Updated RepositoryServiceTest and MockNexus accordingly.

I have opened a PR with fix: 
https://github.com/apache/sling-org-apache-sling-committer-cli/pull/62

Could you please review when you get a chance?

> Cannot cancel release via committer cli
> ---------------------------------------
>
>                 Key: SLING-13408
>                 URL: https://issues.apache.org/jira/browse/SLING-13408
>             Project: Sling
>          Issue Type: Bug
>          Components: Committer CLI
>            Reporter: Joerg Hoh
>            Priority: Major
>
> {noformat}
> $ sling-commiter-cli release drop -r 3134 -x AUTO
> Dropping staging repository orgapachesling-3134...
> Failed executing command
> java.io.IOException: Unexpected status 403 for staging bulk/delete on 
> orgapachesling-3134
>       at 
> org.apache.sling.cli.impl.nexus.RepositoryService.executeBulkAction(RepositoryService.java:162)
>       at 
> org.apache.sling.cli.impl.nexus.RepositoryService.drop(RepositoryService.java:140)
>       at 
> org.apache.sling.cli.impl.release.DropCommand.perform(DropCommand.java:79)
>       at 
> org.apache.sling.cli.impl.release.DropCommand.perform(DropCommand.java:33)
>       at 
> org.apache.sling.cli.impl.release.AbstractStagingRepositoryCommand.call(AbstractStagingRepositoryCommand.java:68)
>       at 
> org.apache.sling.cli.impl.release.AbstractStagingRepositoryCommand.call(AbstractStagingRepositoryCommand.java:40)
>       at picocli.CommandLine.executeUserObject(CommandLine.java:1701)
>       at picocli.CommandLine.access$900(CommandLine.java:146)
>       at picocli.CommandLine$RunLast.handle(CommandLine.java:2059)
>       at picocli.CommandLine$RunLast.handle(CommandLine.java:2026)
>       at 
> picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1893)
>       at picocli.CommandLine.execute(CommandLine.java:1822)
>       at 
> org.apache.sling.cli.impl.CommandProcessor.runCommand(CommandProcessor.java:131)
>       at 
> org.apache.sling.cli.impl.ExecutionTrigger.lambda$activate$0(ExecutionTrigger.java:35)
>       at java.base/java.lang.Thread.run(Unknown Source)
> {noformat}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to