{"action":"created","issue":{"url":"https://api.github.com/repos/tmtsoftware/icd/issues/55","repository_url":"https://api.github.com/repos/tmtsoftware/icd","labels_url":"https://api.github.com/repos/tmtsoftware/icd/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/tmtsoftware/icd/issues/55/comments","events_url":"https://api.github.com/repos/tmtsoftware/icd/issues/55/events","html_url":"https://github.com/tmtsoftware/icd/issues/55","id":303954317,"number":55,"title":"No file or line information when ingesting invalid command with no type specified","user":{"login":"edwardchapin","id":486153,"avatar_url":"https://avatars1.githubusercontent.com/u/486153?v=4","gravatar_id":"","url":"https://api.github.com/users/edwardchapin","html_url":"https://github.com/edwardchapin","followers_url":"https://api.github.com/users/edwardchapin/followers","following_url":"https://api.github.com/users/edwardchapin/following{/other_user}","gists_url":"https://api.github.com/users/edwardchapin/gists{/gist_id}","starred_url":"https://api.github.com/users/edwardchapin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwardchapin/subscriptions","organizations_url":"https://api.github.com/users/edwardchapin/orgs","repos_url":"https://api.github.com/users/edwardchapin/repos","events_url":"https://api.github.com/users/edwardchapin/events{/privacy}","received_events_url":"https://api.github.com/users/edwardchapin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-09T19:30:44Z","updated_at":"2018-03-13T17:42:20Z","closed_at":"2018-03-13T10:10:23Z","author_association":"NONE","body":"This is another validation issue. We had a case where someone forgot to specify the type of an attribute in a command, e.g.,\r\n```\r\nsubsystem = NFIRAOS\r\ncomponent = at\r\n\r\ndescription = Alignment Telescope (AT) Assembly commands.\r\n\r\nreceive = [\r\n  \r\n  {\r\n    name            = init\r\n    description     = \"\"\"Prepares the assembly for operation and reads configuration files.\"\"\"\r\n    args = [\r\n       {\r\n        name        = configName \r\n        description = Name of the configuration file to get from the TMT Configuration Service\r\n      }\r\n    ]\r\n  }\r\n]\r\n```\r\n\r\nIt is missing `type = string` in the argument definition. When I ingest the component directory I get the following exception:\r\n```\r\n$ icd-db -i .\r\njava.lang.NullPointerException\r\n\tat csw.services.icd.IcdValidator$.$anonfun$formatMsg$1(IcdValidator.scala:219)\r\n\tat scala.collection.Iterator$$anon$10.next(Iterator.scala:448)\r\n\tat scala.collection.Iterator.foreach(Iterator.scala:929)\r\n\tat scala.collection.Iterator.foreach$(Iterator.scala:929)\r\n\tat scala.collection.AbstractIterator.foreach(Iterator.scala:1417)\r\n\tat scala.collection.TraversableOnce.addString(TraversableOnce.scala:357)\r\n\tat scala.collection.TraversableOnce.addString$(TraversableOnce.scala:353)\r\n\tat scala.collection.AbstractIterator.addString(Iterator.scala:1417)\r\n\tat scala.collection.TraversableOnce.mkString(TraversableOnce.scala:323)\r\n\tat scala.collection.TraversableOnce.mkString$(TraversableOnce.scala:322)\r\n\tat scala.collection.AbstractIterator.mkString(Iterator.scala:1417)\r\n\tat scala.collection.TraversableOnce.mkString(TraversableOnce.scala:325)\r\n\tat scala.collection.TraversableOnce.mkString$(TraversableOnce.scala:325)\r\n\tat scala.collection.AbstractIterator.mkString(Iterator.scala:1417)\r\n\tat csw.services.icd.IcdValidator$.formatMsg(IcdValidator.scala:220)\r\n\tat csw.services.icd.IcdValidator$.$anonfun$validateResult$1(IcdValidator.scala:195)\r\n\tat scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)\r\n\tat scala.collection.Iterator.foreach(Iterator.scala:929)\r\n\tat scala.collection.Iterator.foreach$(Iterator.scala:929)\r\n\tat scala.collection.AbstractIterator.foreach(Iterator.scala:1417)\r\n\tat scala.collection.IterableLike.foreach(IterableLike.scala:71)\r\n\tat scala.collection.IterableLike.foreach$(IterableLike.scala:70)\r\n\tat scala.collection.AbstractIterable.foreach(Iterable.scala:54)\r\n\tat scala.collection.TraversableLike.map(TraversableLike.scala:234)\r\n\tat scala.collection.TraversableLike.map$(TraversableLike.scala:227)\r\n\tat scala.collection.AbstractTraversable.map(Traversable.scala:104)\r\n\tat csw.services.icd.IcdValidator$.validateResult(IcdValidator.scala:194)\r\n\tat csw.services.icd.IcdValidator$.validate(IcdValidator.scala:182)\r\n\tat csw.services.icd.IcdValidator$.validate(IcdValidator.scala:175)\r\n\tat csw.services.icd.IcdValidator$.$anonfun$validate$1(IcdValidator.scala:98)\r\n\tat scala.collection.immutable.List.map(List.scala:287)\r\n\tat csw.services.icd.IcdValidator$.validate(IcdValidator.scala:86)\r\n\tat csw.services.icd.IcdValidator$.$anonfun$validateRecursive$1(IcdValidator.scala:73)\r\n\tat scala.collection.immutable.List.flatMap(List.scala:335)\r\n\tat csw.services.icd.IcdValidator$.validateRecursive(IcdValidator.scala:73)\r\n\tat csw.services.icd.db.IcdDb.ingest(IcdDb.scala:251)\r\n\tat csw.services.icd.db.IcdDb$.$anonfun$run$1(IcdDb.scala:111)\r\n\tat scala.Option.map(Option.scala:146)\r\n\tat csw.services.icd.db.IcdDb$.run(IcdDb.scala:111)\r\n\tat csw.services.icd.db.IcdDb$.delayedEndpoint$csw$services$icd$db$IcdDb$1(IcdDb.scala:98)\r\n\tat csw.services.icd.db.IcdDb$delayedInit$body.apply(IcdDb.scala:20)\r\n\tat scala.Function0.apply$mcV$sp(Function0.scala:34)\r\n\tat scala.Function0.apply$mcV$sp$(Function0.scala:34)\r\n\tat scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)\r\n\tat scala.App.$anonfun$main$1$adapted(App.scala:76)\r\n\tat scala.collection.immutable.List.foreach(List.scala:389)\r\n\tat scala.App.main(App.scala:76)\r\n\tat scala.App.main$(App.scala:74)\r\n\tat csw.services.icd.db.IcdDb$.main(IcdDb.scala:20)\r\n\tat csw.services.icd.db.IcdDb.main(IcdDb.scala)\r\nfatal: java.lang.NullPointerException\r\n```\r\n\r\nI'm guessing this is similar to #45 and #51. Even if it isn't possible for it to give a more detailed error message (like `Attribute missing type field required by schema at line ...`), it should at least tell us the **file name** (it can be quite hard to find when you are ingesting an entire subsystem, and you have no idea which component the error is in).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/tmtsoftware/icd/issues/comments/372754908","html_url":"https://github.com/tmtsoftware/icd/issues/55#issuecomment-372754908","issue_url":"https://api.github.com/repos/tmtsoftware/icd/issues/55","id":372754908,"user":{"login":"edwardchapin","id":486153,"avatar_url":"https://avatars1.githubusercontent.com/u/486153?v=4","gravatar_id":"","url":"https://api.github.com/users/edwardchapin","html_url":"https://github.com/edwardchapin","followers_url":"https://api.github.com/users/edwardchapin/followers","following_url":"https://api.github.com/users/edwardchapin/following{/other_user}","gists_url":"https://api.github.com/users/edwardchapin/gists{/gist_id}","starred_url":"https://api.github.com/users/edwardchapin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwardchapin/subscriptions","organizations_url":"https://api.github.com/users/edwardchapin/orgs","repos_url":"https://api.github.com/users/edwardchapin/repos","events_url":"https://api.github.com/users/edwardchapin/events{/privacy}","received_events_url":"https://api.github.com/users/edwardchapin/received_events","type":"User","site_admin":false},"created_at":"2018-03-13T17:42:20Z","updated_at":"2018-03-13T17:42:20Z","author_association":"NONE","body":"Thanks, I confirm that this patch works on our end."}}
{"actor":{"display_login":"edwardchapin"}}