You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "hamadodene (via GitHub)" <gi...@apache.org> on 2023/02/09 07:58:16 UTC
[GitHub] [pulsar] hamadodene opened a new issue, #19476: [Bug]
hamadodene opened a new issue, #19476:
URL: https://github.com/apache/pulsar/issues/19476
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Version
**Pulsar version** : 2.9.2
**OS**: CentOS Linux release 7.9.2009 (Core)
### Minimal reproduce step
The problem occurs when you run the create cluster request without specifying the body. For example:
```
curl -X PUT http://host:9372/admin/v2/clusters/examplecluster
```
In the documentation (https://pulsar.apache.org/admin-rest-api/#operation/createCluster), the only required parameter is the cluster name. But checking in the code you can see that the body is also required.
### What did you expect to see?
I expect that since the body is required the API returns me an error.
### What did you see instead?
Instead the api returns me 204.
However, if I try to get that cluster, I get an error:
```
[apache-pulsar-2.9.2]$ curl http://host:9372/admin/v2/clusters/examplecluster
{"reason":"Cluster does not exist"}
```
But if I check the list of available clusters... The cluster I tried to create is also in the cluster list.
```
curl http://host:9372/admin/v2/clusters/
["magnews","examplecluster"]
```
### Anything else?
To solve the problem I passed an empty body to the request.
Something like:
```
curl -H 'Content-Type: application/json' -X PUT -d '{ }' http://host:9372/admin/v2/clusters/examplecluster
```
In this case I have seen that the cluster is created correctly with the default values.
```
curl http://host:9372/admin/v2/clusters/examplecluster
{"brokerClientTlsEnabled":false,"tlsAllowInsecureConnection":false,"brokerClientTlsEnabledWithKeyStore":false,"brokerClientTlsTrustStoreType":"JKS"}
```
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] tisonkun commented on issue #19476: API > The create cluster request returns 204 even if the body is not specified
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #19476:
URL: https://github.com/apache/pulsar/issues/19476#issuecomment-1552338401
> But if I check the list of available clusters... The cluster I tried to create is also in the cluster list.
This behavior cannot be reproduced in master. I tried:
```
$ curl -i -X PUT http://localhost:8080/admin/v2/clusters/examplecluster
HTTP/1.1 500 Cannot invoke "org.apache.pulsar.common.policies.data.ClusterDataImpl.checkPropertiesIfPresent()" because "clusterData" is null
Date: Thu, 18 May 2023 02:59:36 GMT
Content-Type: application/json
Content-Length: 6445
Server: Jetty(9.4.48.v20220622)
...
{"reason":"\n --- An unexpected error occurred in the server ---\n\nMessage:...
$ curl http://localhost:8080/admin/v2/clusters/examplecluster
{"reason":"Cluster does not exist"}
$ curl http://localhost:8080/admin/v2/clusters/
["standalone"]
```
It seems work as expected. Although we may improve a bit to return 400 over 500 in empty body.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] tisonkun commented on issue #19476: API > The create cluster request returns 204 even if the body is not specified
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #19476:
URL: https://github.com/apache/pulsar/issues/19476#issuecomment-1552753992
> There may also be some issues with the doc generated by Swagger
Can you elaborate a bit on what's expected and what you saw actually?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] Technoboy- closed issue #19476: API > The create cluster request returns 204 even if the body is not specified
Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- closed issue #19476: API > The create cluster request returns 204 even if the body is not specified
URL: https://github.com/apache/pulsar/issues/19476
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] Technoboy- commented on issue #19476: API > The create cluster request returns 204 even if the body is not specified
Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- commented on issue #19476:
URL: https://github.com/apache/pulsar/issues/19476#issuecomment-1552742103
There may also be some issues with the doc generated by Swagger
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] github-actions[bot] commented on issue #19476: API > The create cluster request returns 204 even if the body is not specified
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #19476:
URL: https://github.com/apache/pulsar/issues/19476#issuecomment-1465070985
The issue had no activity for 30 days, mark with Stale label.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org