{"record":{"id":"ae837e530658d462","repo":"xai-org/x-algorithm","slug":"argument-entity-type-must-be-provided-support-ae837e","errorCode":null,"errorMessage":"Argument [--entity-type] must be provided. Supported options [${EntityType.SemanticCore.name}, ${EntityType.Hashtag.name}]","messagePattern":"Argument \\[--entity-type\\] must be provided\\. Supported options \\[(.+?), (.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"simclusters/simclusters_v2/scalding/embedding/common/EntityEmbeddingUtil.scala","lineNumber":61,"sourceCode":"    val SixtyDays: Value = Value(60)\n  }\n\n  case class EntityEmbeddingsJobConfig(\n    topK: Int,\n    halfLife: HalfLifeScores.HalfLifeScoresType,\n    modelVersion: ModelVersion,\n    entityType: EntityType,\n    isAdhoc: Boolean)\n\n  object EntityEmbeddingsJobConfig {\n\n    def apply(args: Args, isAdhoc: Boolean): EntityEmbeddingsJobConfig = {\n\n      val entityTypeArg =\n        EntityType.valueOf(args.getOrElse(\"entity-type\", default = \"\")) match {\n          case Some(entityType) => entityType\n          case _ =>\n            throw new IllegalArgumentException(\n              s\"Argument [--entity-type] must be provided. Supported options [\" +\n                s\"${EntityType.SemanticCore.name}, ${EntityType.Hashtag.name}]\")\n        }\n\n      EntityEmbeddingsJobConfig(\n        topK = args.getOrElse(\"top-k\", default = \"100\").toInt,\n        halfLife = HalfLifeScores(args.getOrElse(\"half-life\", default = \"14\").toInt),\n        modelVersion = ModelVersions.toModelVersion(\n          args.getOrElse(\"model-version\", ModelVersions.Model20M145K2020)\n        ),\n        entityType = entityTypeArg,\n        isAdhoc = isAdhoc\n      )\n    }\n  }\n}\n","sourceCodeStart":43,"sourceCodeEnd":78,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/simclusters/simclusters_v2/scalding/embedding/common/EntityEmbeddingUtil.scala#L43-L78","documentation":"EntityEmbeddingUtil.EntityEmbeddingsJobConfig.apply parses the --entity-type argument with EntityType.valueOf. If the arg is missing (default \"\") or not a recognized EntityType name, valueOf returns None and this IllegalArgumentException is thrown listing the valid options.","triggerScenarios":"Running an embedding job without --entity-type, or with a value like 'hashtag ' (typo/case mismatch) that EntityType.valueOf does not recognize.","commonSituations":"Omitting required CLI args in ad-hoc scalding runs; athenz/azkaban job template missing the argument; enum name changes between versions.","solutions":["Add --entity-type SemanticCore or --entity-type Hashtag to the job args","Check for whitespace/case mismatches in the argument value","If new entity types should be allowed, extend EntityType and this message together"],"exampleFix":"// before\nval entityTypeArg = EntityType.valueOf(args.getOrElse(\"entity-type\", default = \"\")) match {\n  case Some(entityType) => entityType\n  case _ => throw new IllegalArgumentException(...)\n}\n\n// after (optional arg with explicit default)\nval entityTypeArg = EntityType.valueOf(args.getOrElse(\"entity-type\", default = EntityType.Hashtag.name)) match {\n  case Some(entityType) => entityType\n  case _ => throw new IllegalArgumentException(...)\n}","handlingStrategy":"validation","validationCode":"val et = args.getOrElse(\"entity-type\", \"\")\nrequire(et.nonEmpty && EntityType.valueOf(et).isDefined,\n  s\"--entity-type is required; valid: ${EntityType.SemanticCore.name}, ${EntityType.Hashtag.name}\")","typeGuard":"def isValidEntityType(s: String): Boolean = EntityType.valueOf(s).isDefined","tryCatchPattern":null,"preventionTips":["Always specify --entity-type in job launch scripts","Add a pre-submission arg validator that lists required flags"],"tags":["scala","scalding","cli-args","config-parsing"],"backgroundTag":"missing-or-invalid-cli-argument","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}