NickeManarin/ScreenToGif · error · Exception

Missing upload preset called {preset.UploadService}

Error message

Missing upload preset called {preset.UploadService}

What it means

EncodingManager resolves the upload destination by finding a UploadPreset in UserSettings.All.UploadPresets whose AllowedTypes permits the export type AND whose Title equals preset.UploadService. If no preset matches, it throws — the export preset references an upload service name that no longer exists in settings.

Source

Thrown at ScreenToGif/Util/EncodingManager.cs:1160

                Update(id, EncodingStatus.Canceled);
                return;
            }

            #region Upload

            if (preset.UploadFile && File.Exists(preset.FullPath))
            {
                Update(id, "S.Encoder.Uploading", true, true);

                try
                {
                    //Get selected preset.
                    var presetType = preset.Extension == ".zip" ? ExportFormats.Zip : preset.Type;
                    var uploadPreset = UserSettings.All.UploadPresets.OfType<UploadPreset>().FirstOrDefault(f => (f.AllowedTypes.Count == 0 || f.AllowedTypes.Contains(presetType)) && f.Title == preset.UploadService);

                    if (uploadPreset == null)
                        throw new Exception($"Missing upload preset called {preset.UploadService}");

                    //TODO: Limit upload by imposed service limits.

                    //Try uploading to the selected service.
                    var cloud = CloudFactory.CreateCloud(uploadPreset.Type);
                    var history = await cloud.UploadFileAsync(uploadPreset, preset.FullPath, CancellationToken.None);

                    uploadPreset.History.Add(history);
                    UserSettings.Save();

                    if (history.Result != 200)
                        throw new Exception(history.Message);

                    SetUpload(id, true, history.GetLink(uploadPreset), history.DeletionLink);
                }
                catch (Exception e)
                {
                    LogWriter.Log(e, "It was not possible to upload.");

View on GitHub (pinned to a4d0a67c21)

Solutions

  1. Recreate the upload preset whose Title matches preset.UploadService, or edit the export preset to point at an existing upload preset.
  2. If AllowAny type is acceptable, clear the matching preset's AllowedTypes so it accepts all formats.
  3. Validate preset.UploadService against UserSettings.All.UploadPresets in the export panel before starting the encode.
  4. If the upload preset is optional, clear preset.UploadFile so the export skips the upload step.

Example fix

// before
var uploadPreset = UserSettings.All.UploadPresets.OfType<UploadPreset>().FirstOrDefault(f => (f.AllowedTypes.Count == 0 || f.AllowedTypes.Contains(presetType)) && f.Title == preset.UploadService);
if (uploadPreset == null)
    throw new Exception($"Missing upload preset called {preset.UploadService}");

// after
var uploadPreset = UserSettings.All.UploadPresets.OfType<UploadPreset>().FirstOrDefault(f => (f.AllowedTypes.Count == 0 || f.AllowedTypes.Contains(presetType)) && f.Title == preset.UploadService);
if (uploadPreset == null)
    throw new Exception($"Missing upload preset called '{preset.UploadService}'. Available: {string.Join(", ", UserSettings.All.UploadPresets.OfType<UploadPreset>().Select(p => p.Title))}.");
Defensive patterns

Strategy: validation

Validate before calling

// In the export panel, validate UploadService before enabling 'Upload'
var match = UserSettings.All.UploadPresets.OfType<UploadPreset>()
    .FirstOrDefault(p => p.Title == exportPreset.UploadService &&
                         (p.AllowedTypes.Count == 0 || p.AllowedTypes.Contains(exportPreset.Type)));
if (match == null) /* block upload / surface a 'missing preset' warning */

Type guard

bool UploadServiceIsConfigured(ExportPreset ep) =>
    UserSettings.All.UploadPresets.OfType<UploadPreset>().Any(p => p.Title == ep.UploadService);

Try / catch

try { /* upload */ }
catch (Exception ex) when (ex.Message.StartsWith("Missing upload preset"))
{ /* open Upload settings so the user can recreate the preset */ }

Prevention

When it happens

Trigger: preset.UploadFile == true and an output file exists, but the LINQ FirstOrDefault over UploadPresets returns null because no entry's Title == preset.UploadService (with AllowedTypes compatibility).

Common situations: User deleted or renamed the upload preset but the export preset still records the old UploadService name; settings file corrupted/partially migrated; preset was imported from another machine; AllowedTypes list excludes the current export type.

Related errors


AI-assisted analysis of NickeManarin/ScreenToGif@a4d0a67c21 (2026-08-13). Data as JSON: /api/errors/33daab3a4495046f. Report an issue: GitHub.