{"record":{"id":"74484f4069213286","repo":"crowdsecurity/crowdsec","slug":"unknown-entry-type-s-in-s-supported-s-s","errorCode":null,"errorMessage":"unknown entry type '%s' in %s (supported: %s): %s","messagePattern":"unknown entry type '(.+?)' in (.+?) \\(supported: (.+?)\\): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/exprhelpers/filemap.go","lineNumber":64,"sourceCode":"\tif err := json.Unmarshal([]byte(line), &record); err != nil {\n\t\treturn fmt.Errorf(\"failed to parse JSON line in %s: %w\", filename, err)\n\t}\n\n\tif record[\"pattern\"] == \"\" {\n\t\treturn fmt.Errorf(\"missing mandatory 'pattern' field in %s: %s\", filename, line)\n\t}\n\n\tif record[\"tag\"] == \"\" {\n\t\treturn fmt.Errorf(\"missing mandatory 'tag' field in %s: %s\", filename, line)\n\t}\n\n\tentryType := record[\"type\"]\n\tif entryType == \"\" {\n\t\treturn fmt.Errorf(\"missing mandatory 'type' field in %s: %s\", filename, line)\n\t}\n\n\tif !slices.Contains(validMapEntryTypes, entryType) {\n\t\treturn fmt.Errorf(\"unknown entry type '%s' in %s (supported: %s): %s\",\n\t\t\tentryType, filename, strings.Join(validMapEntryTypes, \", \"), line)\n\t}\n\n\tif entryType == \"regex\" {\n\t\tif _, err := regexp.Compile(record[\"pattern\"]); err != nil {\n\t\t\tlog.Warningf(\"invalid regex pattern in %s: %s\", filename, err)\n\t\t}\n\t}\n\n\tif dataFileMap[filename] == nil {\n\t\tdataFileMap[filename] = &fileMapEntry{filename: filename}\n\t}\n\n\tdataFileMap[filename].rows = append(dataFileMap[filename].rows, record)\n\n\treturn nil\n}\n","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/exprhelpers/filemap.go#L46-L82","documentation":"fileMapInit validates the 'type' value against validMapEntryTypes and rejects anything else. This error is thrown when the JSON line's 'type' is non-empty but not one of the supported entry types, so the map entry cannot be routed to the right lookup structure.","triggerScenarios":"Calling FileInit (via fileMapInit) on a filemap line with e.g. \"type\":\"IP\" (wrong case) or \"type\":\"cidr\" instead of a supported value like ip/range/string/regex.","commonSituations":"Typos or wrong casing in hand-written data files; authors guessing type names instead of consulting the supported list; data files written for a different tool or an older crowdsec version with different type names.","solutions":["Change the line's \"type\" to one of the supported values listed in the error message (strings.Join(validMapEntryTypes, \", \")).","Fix casing/typos: the comparison is exact and case-sensitive (e.g. \"ip\", not \"IP\" or \"Ip\").","If the entry semantically means an address block, use \"range\" rather than invented types like \"cidr\" or \"subnet\".","Refresh the data file from its official hub source if it follows a foreign schema."],"exampleFix":"// before\n{\"pattern\":\"10.0.0.0/8\",\"tag\":\"private\",\"type\":\"cidr\"}\n// after\n{\"pattern\":\"10.0.0.0/8\",\"tag\":\"private\",\"type\":\"range\"}","handlingStrategy":"validation","validationCode":"validTypes := []string{\"ip\", \"range\", \"string\", \"regex\", \"url\"} // see validMapEntryTypes\nif !slices.Contains(validTypes, entryType) {\n\treturn fmt.Errorf(\"type %q unsupported\", entryType)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy type names exactly from the error message's supported list — they are case-sensitive","Avoid inventing aliases like \"cidr\"; map them to the supported value at generation time","Validate types in the script that generates the data file"],"tags":["data-files","validation","enum","crowdsec"],"backgroundTag":"invalid-enum-value","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}