{"action":"created","issue":{"url":"https://api.github.com/repos/ligaDATA/Kamanja/issues/741","labels_url":"https://api.github.com/repos/ligaDATA/Kamanja/issues/741/labels{/name}","comments_url":"https://api.github.com/repos/ligaDATA/Kamanja/issues/741/comments","events_url":"https://api.github.com/repos/ligaDATA/Kamanja/issues/741/events","html_url":"https://github.com/ligaDATA/Kamanja/issues/741","id":105885259,"number":741,"title":"REST API heartbeat can't get by node id","user":{"login":"ligadata-william","id":8701919,"avatar_url":"https://avatars.githubusercontent.com/u/8701919?v=3","gravatar_id":"","url":"https://api.github.com/users/ligadata-william","html_url":"https://github.com/ligadata-william","followers_url":"https://api.github.com/users/ligadata-william/followers","following_url":"https://api.github.com/users/ligadata-william/following{/other_user}","gists_url":"https://api.github.com/users/ligadata-william/gists{/gist_id}","starred_url":"https://api.github.com/users/ligadata-william/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ligadata-william/subscriptions","organizations_url":"https://api.github.com/users/ligadata-william/orgs","repos_url":"https://api.github.com/users/ligadata-william/repos","events_url":"https://api.github.com/users/ligadata-william/events{/privacy}","received_events_url":"https://api.github.com/users/ligadata-william/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ligaDATA/Kamanja/labels/Bug","name":"Bug","color":"fc2929"},{"url":"https://api.github.com/repos/ligaDATA/Kamanja/labels/P2","name":"P2","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"ligadata-dan","id":9681776,"avatar_url":"https://avatars.githubusercontent.com/u/9681776?v=3","gravatar_id":"","url":"https://api.github.com/users/ligadata-dan","html_url":"https://github.com/ligadata-dan","followers_url":"https://api.github.com/users/ligadata-dan/followers","following_url":"https://api.github.com/users/ligadata-dan/following{/other_user}","gists_url":"https://api.github.com/users/ligadata-dan/gists{/gist_id}","starred_url":"https://api.github.com/users/ligadata-dan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ligadata-dan/subscriptions","organizations_url":"https://api.github.com/users/ligadata-dan/orgs","repos_url":"https://api.github.com/users/ligadata-dan/repos","events_url":"https://api.github.com/users/ligadata-dan/events{/privacy}","received_events_url":"https://api.github.com/users/ligadata-dan/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-09-10T19:50:36Z","updated_at":"2015-10-15T17:25:01Z","closed_at":null,"body":"When I perform the following curl command:\r\n```\r\ncurl -k -X POST https://localhost:8081/api/heartbeat -d []\r\n```\r\nI receive the following:\r\n```\r\n{\r\n  \"APIResults\" : {\r\n    \"Status Code\" : 0,\r\n    \"Function Name\" : \"GetHeartbeat\",\r\n    \"Result Data\" : \"[{\\\"Name\\\":\\\"1\\\",\\\"UniqueId\\\":252,\\\"LastSeen\\\":\\\"2015-09-10 12:46:35\\\",\\\"StartTime\\\":\\\"2015-09-10 12:25:39\\\",\\\"Components\\\":[],\\\"Metrics\\\":[]}]\",\r\n    \"Result Description\" : \"Heartbeats fetched successfully\"\r\n  }\r\n```\r\nwhich is expected behavior.\r\n\r\nHowever, when I run\r\n```\r\ncurl -k -X POST https://localhost:8081/api/heartbeat -d [\"1\"]\r\n```\r\nThe client hangs and the service throws the following exception:\r\n```\r\njava.lang.ClassCastException: scala.math.BigInt cannot be cast to java.lang.String\r\n\tat com.ligadata.MetadataAPI.MonitorAPIImpl$$anonfun$getHeartbeatInfo$2.apply(MonitorAPIImpl.scala:75)\r\n\tat scala.collection.immutable.List.foreach(List.scala:318)\r\n\tat com.ligadata.MetadataAPI.MonitorAPIImpl$.getHeartbeatInfo(MonitorAPIImpl.scala:75)\r\n\tat com.ligadata.MetadataAPI.MetadataAPIImpl$.getHealthCheck(MetadataAPIImpl.scala:150)\r\n\tat com.ligadata.metadataapiservice.GetHeartbeatService.process(GetHeartbeatService.scala:44)\r\n\tat com.ligadata.metadataapiservice.GetHeartbeatService$$anonfun$receive$1.applyOrElse(GetHeartbeatService.scala:32)\r\n\tat akka.actor.Actor$class.aroundReceive(Actor.scala:465)\r\n\tat com.ligadata.metadataapiservice.GetHeartbeatService.aroundReceive(GetHeartbeatService.scala:22)\r\n\tat akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)\r\n\tat akka.actor.ActorCell.invoke(ActorCell.scala:487)\r\n\tat akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)\r\n\tat akka.dispatch.Mailbox.run(Mailbox.scala:220)\r\n\tat akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)\r\n\tat scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)\r\n\tat scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)\r\n\tat scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)\r\n\tat scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)\r\n```\r\nSimilarly, removing the quotes and running the command as such\r\n```\r\ncurl -k -X POST https://localhost:8081/api/heartbeat -d [1]\r\n```\r\nresults in the same exception."},"comment":{"url":"https://api.github.com/repos/ligaDATA/Kamanja/issues/comments/148465247","html_url":"https://github.com/ligaDATA/Kamanja/issues/741#issuecomment-148465247","issue_url":"https://api.github.com/repos/ligaDATA/Kamanja/issues/741","id":148465247,"user":{"login":"ligadata-dan","id":9681776,"avatar_url":"https://avatars.githubusercontent.com/u/9681776?v=3","gravatar_id":"","url":"https://api.github.com/users/ligadata-dan","html_url":"https://github.com/ligadata-dan","followers_url":"https://api.github.com/users/ligadata-dan/followers","following_url":"https://api.github.com/users/ligadata-dan/following{/other_user}","gists_url":"https://api.github.com/users/ligadata-dan/gists{/gist_id}","starred_url":"https://api.github.com/users/ligadata-dan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ligadata-dan/subscriptions","organizations_url":"https://api.github.com/users/ligadata-dan/orgs","repos_url":"https://api.github.com/users/ligadata-dan/repos","events_url":"https://api.github.com/users/ligadata-dan/events{/privacy}","received_events_url":"https://api.github.com/users/ligadata-dan/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T17:25:01Z","updated_at":"2015-10-15T17:25:01Z","body":"@ligadata-william \r\n\r\nI actually just found out that for CURL you actually have to excape DOUBLE QUOTES...  so the query you need to issue is \r\n\r\ncurl -k -X POST https://localhost:8081/api/heartbeat -d [\\\"1\\\"]\r\n\r\nI will add some exception processing to this code tough, to make sure we don't shut down the Service.  I will submit a pull request with the defensive code."}}