[ 
https://issues.apache.org/jira/browse/IGNITE-25121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vadim Pakhnushev updated IGNITE-25121:
--------------------------------------
    Description: 
When running {{cluster init}} command on a cluster which is already in process 
of initializing, the error message is {{"REST services are unavailable during 
cluster initialization"}}
This is due to the 409 error code returned from the REST endpoint.
We could detect that and show the more user-friendly message.
{noformat}
org.apache.ignite.internal.cli.core.exception.IgniteCliApiException: 
org.apache.ignite.rest.client.invoker.ApiException: Message: Conflict           
                 
HTTP response code: 409                                                         
                                                                                
      
HTTP response body: {"title":"REST temporarily 
unavailable","status":409,"detail":"REST services are unavailable during 
cluster initialization"}                      
HTTP response headers: {connection=[keep-alive], content-length=[124], 
content-type=[application/problem+json]}                                        
               
        at 
org.apache.ignite.internal.cli.call.cluster.ClusterInitCall.execute(ClusterInitCall.java:47)
        at 
org.apache.ignite.internal.cli.call.cluster.ClusterInitCall.execute(ClusterInitCall.java:24)
        at 
org.apache.ignite.internal.cli.core.call.SingleCallExecutionPipeline.runPipelineInternal(SingleCallExecutionPipeline.java:46)
        at 
org.apache.ignite.internal.cli.core.call.AbstractCallExecutionPipeline.runPipeline(AbstractCallExecutionPipeline.java:75)
        at 
org.apache.ignite.internal.cli.commands.BaseCommand.runPipeline(BaseCommand.java:80)
        at 
org.apache.ignite.internal.cli.commands.cluster.init.ClusterInitCommand.call(ClusterInitCommand.java:40)
        at 
org.apache.ignite.internal.cli.commands.cluster.init.ClusterInitCommand.call(ClusterInitCommand.java:25)

{noformat}

  was:
When running {{cluster init}} command, the underlying REST sometimes return 409.
{noformat}
org.apache.ignite.internal.cli.core.exception.IgniteCliApiException: 
org.apache.ignite.rest.client.invoker.ApiException: Message: Conflict           
                 
HTTP response code: 409                                                         
                                                                                
      
HTTP response body: {"title":"REST temporarily 
unavailable","status":409,"detail":"REST services are unavailable during 
cluster initialization"}                      
HTTP response headers: {connection=[keep-alive], content-length=[124], 
content-type=[application/problem+json]}                                        
               
        at 
org.apache.ignite.internal.cli.call.cluster.ClusterInitCall.execute(ClusterInitCall.java:47)
        at 
org.apache.ignite.internal.cli.call.cluster.ClusterInitCall.execute(ClusterInitCall.java:24)
        at 
org.apache.ignite.internal.cli.core.call.SingleCallExecutionPipeline.runPipelineInternal(SingleCallExecutionPipeline.java:46)
        at 
org.apache.ignite.internal.cli.core.call.AbstractCallExecutionPipeline.runPipeline(AbstractCallExecutionPipeline.java:75)
        at 
org.apache.ignite.internal.cli.commands.BaseCommand.runPipeline(BaseCommand.java:80)
        at 
org.apache.ignite.internal.cli.commands.cluster.init.ClusterInitCommand.call(ClusterInitCommand.java:40)
        at 
org.apache.ignite.internal.cli.commands.cluster.init.ClusterInitCommand.call(ClusterInitCommand.java:25)

{noformat}


> Improve cluster init command error handling
> -------------------------------------------
>
>                 Key: IGNITE-25121
>                 URL: https://issues.apache.org/jira/browse/IGNITE-25121
>             Project: Ignite
>          Issue Type: Bug
>          Components: cli
>            Reporter: Vadim Pakhnushev
>            Assignee: Vadim Pakhnushev
>            Priority: Major
>
> When running {{cluster init}} command on a cluster which is already in 
> process of initializing, the error message is {{"REST services are 
> unavailable during cluster initialization"}}
> This is due to the 409 error code returned from the REST endpoint.
> We could detect that and show the more user-friendly message.
> {noformat}
> org.apache.ignite.internal.cli.core.exception.IgniteCliApiException: 
> org.apache.ignite.rest.client.invoker.ApiException: Message: Conflict         
>                    
> HTTP response code: 409                                                       
>                                                                               
>           
> HTTP response body: {"title":"REST temporarily 
> unavailable","status":409,"detail":"REST services are unavailable during 
> cluster initialization"}                      
> HTTP response headers: {connection=[keep-alive], content-length=[124], 
> content-type=[application/problem+json]}                                      
>                  
>       at 
> org.apache.ignite.internal.cli.call.cluster.ClusterInitCall.execute(ClusterInitCall.java:47)
>       at 
> org.apache.ignite.internal.cli.call.cluster.ClusterInitCall.execute(ClusterInitCall.java:24)
>       at 
> org.apache.ignite.internal.cli.core.call.SingleCallExecutionPipeline.runPipelineInternal(SingleCallExecutionPipeline.java:46)
>       at 
> org.apache.ignite.internal.cli.core.call.AbstractCallExecutionPipeline.runPipeline(AbstractCallExecutionPipeline.java:75)
>       at 
> org.apache.ignite.internal.cli.commands.BaseCommand.runPipeline(BaseCommand.java:80)
>       at 
> org.apache.ignite.internal.cli.commands.cluster.init.ClusterInitCommand.call(ClusterInitCommand.java:40)
>       at 
> org.apache.ignite.internal.cli.commands.cluster.init.ClusterInitCommand.call(ClusterInitCommand.java:25)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to