{"record":{"id":"9bb3a63e477bff15","repo":"jellyfin/jellyfin","slug":"unrecognized-trigger-type-info-type","errorCode":null,"errorMessage":"Unrecognized trigger type: {info.Type}","messagePattern":"Unrecognized trigger type: (.+?)","errorType":"validation","errorClass":"ArgumentException","httpStatus":400,"severity":"error","filePath":"Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs","lineNumber":659,"sourceCode":"            return new WeeklyTrigger(TimeSpan.FromTicks(info.TimeOfDayTicks.Value), info.DayOfWeek.Value, options);\n        }\n\n        if (info.Type == TaskTriggerInfoType.IntervalTrigger)\n        {\n            if (!info.IntervalTicks.HasValue)\n            {\n                throw new ArgumentException(\"Info did not contain a IntervalTicks.\", nameof(info));\n            }\n\n            return new IntervalTrigger(TimeSpan.FromTicks(info.IntervalTicks.Value), options);\n        }\n\n        if (info.Type == TaskTriggerInfoType.StartupTrigger)\n        {\n            return new StartupTrigger(options);\n        }\n\n        throw new ArgumentException(\"Unrecognized trigger type: \" + info.Type);\n    }\n\n    /// <summary>\n    /// Disposes each trigger.\n    /// </summary>\n    private void DisposeTriggers()\n    {\n        foreach (var triggerInfo in InternalTriggers)\n        {\n            var trigger = triggerInfo.Item2;\n            trigger.Triggered -= OnTriggerTriggered;\n            trigger.Stop();\n            if (trigger is IDisposable disposable)\n            {\n                disposable.Dispose();\n            }\n        }\n    }","sourceCodeStart":641,"sourceCodeEnd":677,"githubUrl":"https://github.com/jellyfin/jellyfin/blob/ae8723026d97b6d0f926638803edef338919b794/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs#L641-L677","documentation":"Thrown by ScheduledTaskWorker.GetTrigger when info.Type doesn't match any known trigger type constant (DailyTrigger, WeeklyTrigger, IntervalTrigger, StartupTrigger). ArgumentException signals an unrecognized/unsupported trigger type string. This is the fallthrough after all known type branches.","triggerScenarios":"Loading a scheduled task whose TaskTriggerInfo.Type is a string not equal to any of the known TaskTriggerInfoType constants. Comes from a config file with a typo'd or future/unknown trigger type.","commonSituations":"Typo in the trigger type string in the task config; a config from a newer server version with a trigger type this version doesn't know; hand-edited config with a wrong casing; plugin/custom trigger types not handled by this factory.","solutions":["Correct the trigger Type in the task config to a known value: DailyTrigger, WeeklyTrigger, IntervalTrigger, or StartupTrigger.","Ensure case matches the TaskTriggerInfoType constants exactly.","If the config came from a newer server, upgrade or remove the unsupported trigger.","Re-create the trigger via the UI/API so only supported types are produced."],"exampleFix":"// before\nvar info = new TaskTriggerInfo { Type = \"daily\" }; // wrong casing/value\n\n// after\nvar info = new TaskTriggerInfo\n{\n    Type = TaskTriggerInfoType.DailyTrigger,\n    TimeOfDayTicks = TimeSpan.FromHours(2).Ticks\n};","handlingStrategy":"validation","validationCode":"var known = new[] { TaskTriggerInfoType.DailyTrigger, TaskTriggerInfoType.WeeklyTrigger, TaskTriggerInfoType.IntervalTrigger, TaskTriggerInfoType.StartupTrigger };\nif (!known.Contains(info.Type))\n    throw new InvalidOperationException($\"Unknown trigger type: {info.Type}\");","typeGuard":"static bool IsKnownTriggerType(string type)\n    => type is TaskTriggerInfoType.DailyTrigger or TaskTriggerInfoType.WeeklyTrigger\n       or TaskTriggerInfoType.IntervalTrigger or TaskTriggerInfoType.StartupTrigger;","tryCatchPattern":"try { var trigger = GetTrigger(info); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"Unrecognized trigger type\"))\n{ _logger.LogError(\"Unsupported trigger type {Type}; removing trigger\", info.Type); }","preventionTips":["Use only supported trigger type constants.","Match casing exactly against TaskTriggerInfoType values.","If migrating from a newer server, remove unsupported triggers or upgrade."],"tags":["scheduled-tasks","triggers","configuration","validation","unknown-type"],"backgroundTag":null,"analyzedSha":"ae8723026d97b6d0f926638803edef338919b794","analyzedAt":"2026-08-13T10:43:30.013Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}