Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected a string but was BEGIN_OBJECT when V1Status deleteResult = api.deleteNamespacedResourceQuota(....) #1364

Closed
cwchoe opened this issue Nov 6, 2020 · 2 comments

Comments

@cwchoe
Copy link

cwchoe commented Nov 6, 2020

The error message is..

[ERROR] [42] 2020-11-06 14:52:59.347 |http-nio-8080-exec-2|ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet]|[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 425 path $.status] with root cause
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 425 path $.status
at com.google.gson.stream.JsonReader.nextString(JsonReader.java:826) ~[gson-2.8.6.jar:?]
at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:402) ~[gson-2.8.6.jar:?]
at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:390) ~[gson-2.8.6.jar:?]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131) ~[gson-2.8.6.jar:?]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222) ~[gson-2.8.6.jar:?]
at com.google.gson.Gson.fromJson(Gson.java:932) ~[gson-2.8.6.jar:?]
at com.google.gson.Gson.fromJson(Gson.java:897) ~[gson-2.8.6.jar:?]
at com.google.gson.Gson.fromJson(Gson.java:846) ~[gson-2.8.6.jar:?]
at io.kubernetes.client.openapi.JSON.deserialize(JSON.java:138) ~[client-java-api-9.0.2.jar:?]
at io.kubernetes.client.openapi.ApiClient.deserialize(ApiClient.java:757) ~[client-java-api-9.0.2.jar:?]
at io.kubernetes.client.openapi.ApiClient.handleResponse(ApiClient.java:958) ~[client-java-api-9.0.2.jar:?]
at io.kubernetes.client.openapi.ApiClient.execute(ApiClient.java:883) ~[client-java-api-9.0.2.jar:?]
at io.kubernetes.client.openapi.apis.CoreV1Api.deleteNamespacedResourceQuotaWithHttpInfo(CoreV1Api.java:22897) ~[client-java-api-9.0.2.jar:?]
at io.kubernetes.client.openapi.apis.CoreV1Api.deleteNamespacedResourceQuota(CoreV1Api.java:22827) ~[client-java-api-9.0.2.jar:?]
at com.skhynix.aip.foundation.wfmanager.taskmgr.runner.Quota.deleteObject(Quota.java:241) ~[classes/:?]
at com.skhynix.aip.foundation.wfmanager.taskmgr.service.GeneralServiceImpl.deleteQuota(GeneralServiceImpl.java:76) ~[classes/:?]

@cwchoe
Copy link
Author

cwchoe commented Nov 6, 2020

Java Client Version is 9.0.2

@brendandburns
Copy link
Contributor

This is a duplicate of #86 please see the detail in that issue. tl; dr; Delete can return multiple types, Swagger can only handle one.

You have two choices, you can catch the exception and handle it, or you can use the GenericAPI to delete objects. There's more details in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants