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

feign.codec.DecodeException while parsing the healthcheck json while getting all VMs deployed on marathon #23

Open
diwakar2015 opened this issue Jul 14, 2015 · 4 comments

Comments

@diwakar2015
Copy link

Hi Mohit,
I am using your 0.4.3-SNAPSHOT marathon-client jar for fetching all the apps deployed on our marathon.

But, I am seeing the following exception while retrieving the all apps.

feign.codec.DecodeException: The JsonDeserializer StringTypeAdapter failed to deserialize json object {"value":"if [ -f /var/www/html/health/active ]; then (exit 0); else (exit 1); fi"} given the type class java.lang.String
at feign.MethodHandler$SynchronousMethodHandler.decode(MethodHandler.java:183)
at feign.MethodHandler$SynchronousMethodHandler.executeAndDecode(MethodHandler.java:151)
at feign.MethodHandler$SynchronousMethodHandler.invoke(MethodHandler.java:105)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:87)
at com.sun.proxy.$Proxy6.getApps(Unknown Source)
at com.verizon.devops.control.webapp.service.MarathonInventoryServiceImpl.getNewAppList(MarathonInventoryServiceImpl.java:119)

while deploying the app,I had put the health check JSON as follows,

"healthChecks": [
{
"path": "/",
"protocol": "COMMAND",
"portIndex": 0,
"command": {
"value": "if [ -f /var/www/html/health/active ]; then (exit 0); else (exit 1); fi"
},
"gracePeriodSeconds": 300,
"intervalSeconds": 5,
"timeoutSeconds": 6,
"maxConsecutiveFailures": 10
}
]

Can you tell me how to fix this?? Red labelled line is causing an issue.
Thanks in advance.

@diwakar2015
Copy link
Author

Now getting issue as:

feign.codec.DecodeException: The JsonDeserializer StringTypeAdapter failed to deserialize json object {"value":"/usr/libexec/mesos/mesos-health-check"} given the type class java.lang.String
at feign.MethodHandler$SynchronousMethodHandler.decode(MethodHandler.java:183)
at feign.MethodHandler$SynchronousMethodHandler.executeAndDecode(MethodHandler.java:151)
at feign.MethodHandler$SynchronousMethodHandler.invoke(MethodHandler.java:105)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:87)
at com.sun.proxy.$Proxy6.getApps(Unknown Source)
at com.verizon.devops.control.webapp.service.MarathonInventoryServiceImpl.getNewAppList(MarathonInventoryServiceImpl.java:119)
at com.verizon.devops.control.webapp.service.MarathonInventoryServiceImpl.getAppList(MarathonInventoryServiceImpl.java:150)
at com.verizon.devops.control.webapp.service.MarathonInventoryServiceImpl.listRunningVms(MarathonInventoryServiceImpl.java:181)
at com.verizon.devops.control.webapp.service.MarathonInventoryServiceImpl.getAllAppList(MarathonInventoryServiceImpl.java:266)
at checkPortConflict.doGet(checkPortConflict.java:38)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: com.google.gson.JsonParseException: The JsonDeserializer StringTypeAdapter failed to deserialize json object {"value":"/usr/libexec/mesos/mesos-health-check"} given the type class java.lang.String
at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:64)
at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:92)
at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:117)
at com.google.gson.ReflectingFieldNavigator.visitFieldsReflectively(ReflectingFieldNavigator.java:63)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:120)
at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:663)
at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:624)
at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:51)
at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:92)
at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:117)
at com.google.gson.ReflectingFieldNavigator.visitFieldsReflectively(ReflectingFieldNavigator.java:63)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:120)
at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:663)
at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:624)
at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:51)
at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:92)
at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:117)
at com.google.gson.ReflectingFieldNavigator.visitFieldsReflectively(ReflectingFieldNavigator.java:63)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:120)
at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
at com.google.gson.Gson.fromJson(Gson.java:551)
at com.google.gson.Gson.fromJson(Gson.java:498)
at com.google.gson.Gson.fromJson(Gson.java:467)
at feign.gson.GsonDecoder.decode(GsonDecoder.java:46)
at feign.MethodHandler$SynchronousMethodHandler.decode(MethodHandler.java:179)
... 32 more
Caused by: java.lang.UnsupportedOperationException
at com.google.gson.JsonElement.getAsString(JsonElement.java:184)
at com.google.gson.DefaultTypeAdapters$StringTypeAdapter.deserialize(DefaultTypeAdapters.java:968)
at com.google.gson.DefaultTypeAdapters$StringTypeAdapter.deserialize(DefaultTypeAdapters.java:960)
at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:51)
... 61 more
GetALLAppList is called
Init method of Marathon Inventory called

init is done....not retrieving the list of vms
feign.codec.DecodeException: The JsonDeserializer StringTypeAdapter failed to deserialize json object {"value":"/usr/libexec/mesos/mesos-health-check"} given the type class java.lang.String
at feign.MethodHandler$SynchronousMethodHandler.decode(MethodHandler.java:183)
at feign.MethodHandler$SynchronousMethodHandler.executeAndDecode(MethodHandler.java:151)
at feign.MethodHandler$SynchronousMethodHandler.invoke(MethodHandler.java:105)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:87)
at com.sun.proxy.$Proxy6.getApps(Unknown Source)
at com.verizon.devops.control.webapp.service.MarathonInventoryServiceImpl.getNewAppList(MarathonInventoryServiceImpl.java:119)
at com.verizon.devops.control.webapp.service.MarathonInventoryServiceImpl.getAppList(MarathonInventoryServiceImpl.java:150)
at com.verizon.devops.control.webapp.service.MarathonInventoryServiceImpl.listRunningVms(MarathonInventoryServiceImpl.java:181)
at com.verizon.devops.control.webapp.service.MarathonInventoryServiceImpl.getAllAppList(MarathonInventoryServiceImpl.java:266)
at com.verizon.devops.control.webapp.service.GetAppDetails.getAppList(GetAppDetails.java:19)
at com.verizon.devops.control.webapp.service.GetAppDetails.getAllAppInfo(GetAppDetails.java:34)
at org.apache.jsp.usedPort_jsp._jspService(usedPort_jsp.java:178)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: com.google.gson.JsonParseException: The JsonDeserializer StringTypeAdapter failed to deserialize json object {"value":"/usr/libexec/mesos/mesos-health-check"} given the type class java.lang.String
at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:64)
at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:92)
at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:117)
at com.google.gson.ReflectingFieldNavigator.visitFieldsReflectively(ReflectingFieldNavigator.java:63)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:120)
at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:663)
at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:624)
at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:51)
at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:92)
at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:117)
at com.google.gson.ReflectingFieldNavigator.visitFieldsReflectively(ReflectingFieldNavigator.java:63)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:120)
at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:663)
at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:624)
at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:51)
at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:92)
at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:117)
at com.google.gson.ReflectingFieldNavigator.visitFieldsReflectively(ReflectingFieldNavigator.java:63)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:120)
at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
at com.google.gson.Gson.fromJson(Gson.java:551)
at com.google.gson.Gson.fromJson(Gson.java:498)
at com.google.gson.Gson.fromJson(Gson.java:467)
at feign.gson.GsonDecoder.decode(GsonDecoder.java:46)
at feign.MethodHandler$SynchronousMethodHandler.decode(MethodHandler.java:179)
... 38 more
Caused by: java.lang.UnsupportedOperationException
at com.google.gson.JsonElement.getAsString(JsonElement.java:184)
at com.google.gson.DefaultTypeAdapters$StringTypeAdapter.deserialize(DefaultTypeAdapters.java:968)
at com.google.gson.DefaultTypeAdapters$StringTypeAdapter.deserialize(DefaultTypeAdapters.java:960)
at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:51)
... 67 more

@sumannewton
Copy link

@diwakar2015 Issue is fixed in my local repo. Yet to be merged by mohit.

@diwakar2015
Copy link
Author

Thanks

@dianaeftaiha
Copy link

I'm getting a very similar error to the one in your original question. Any chance you remember what the deal was 8 years later? @diwakar2015

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

3 participants