{"record":{"id":"623b1e0e8e3663a1","repo":"gitroomhq/postiz-app","slug":"validation-name-validation-settingserror","errorCode":null,"errorMessage":"${validation.name}: ${\n  validation.settingsError || 'Please fix your settings'\n}","messagePattern":"\\$\\{validation\\.name\\}: \\$\\{\n  validation\\.settingsError \\|\\| 'Please fix your settings'\n\\}","errorType":"validation","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"libraries/nestjs-libraries/src/database/prisma/posts/posts.service.ts","lineNumber":1060,"sourceCode":"\n    // Same server-side validation as the dashboard / public create route.\n    const [validation] = await this.validatePosts(orgId, [\n      {\n        integration: { id: integration.id },\n        settings: mergedSettings,\n        value: value.map((p) => ({ content: p.content, image: p.image })),\n      },\n    ]);\n\n    if (validation.emptyContent) {\n      throw new BadRequestException(\n        `${validation.name}: Your post should have at least one character or one image.`\n      );\n    }\n\n    if (root.state !== 'DRAFT') {\n      if (!validation.valid) {\n        throw new BadRequestException(\n          `${validation.name}: ${\n            validation.settingsError || 'Please fix your settings'\n          }`\n        );\n      }\n\n      if (validation.errors !== true) {\n        throw new BadRequestException(\n          `${validation.name}: ${validation.errors}`\n        );\n      }\n\n      if (validation.tooLong) {\n        throw new BadRequestException(\n          `${validation.name}: The maximum characters is ${validation.maximumCharacters}`\n        );\n      }\n    }","sourceCodeStart":1042,"sourceCodeEnd":1078,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/database/prisma/posts/posts.service.ts#L1042-L1078","documentation":"After a post leaves DRAFT, its channel-specific settings (merged user settings with provider defaults) are validated. settingsError reports which setting is invalid for the provider (e.g. missing board for Pinterest, missing YouTube title, invalid visibility), falling back to 'Please fix your settings'.","triggerScenarios":"Scheduling a non-draft post whose provider-specific settings fail validation — e.g. YouTube without a title, Pinterest without a board id, Discord without a valid channel selection.","commonSituations":"Settings accordion skipped in the composer; provider settings changed server-side after the draft was saved; account-specific settings (boards/lists) deleted on the remote platform; drafts promoted to schedule with incomplete settings.","solutions":["Open the channel settings for that variant and fill the field named in settingsError","Re-select the remote resource (board, playlist, channel) — it may have been deleted on the platform","For drafts, complete required settings before switching status to schedule","Update to the latest version if a provider schema changed and stale settings no longer validate"],"exampleFix":"// before\n{ integration: { id }, content, settings: {} } // youtube: missing title\n// after\n{ integration: { id }, content, settings: { title: 'My video title' } }","handlingStrategy":"validation","validationCode":"const required = REQUIRED_SETTINGS_BY_PROVIDER[providerIdentifier] ?? [];\nconst ok = body.posts.every((p) => required.every((k) => p.settings?.[k] != null && p.settings[k] !== ''));\nif (ok) await schedulePost(orgId, body);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mark provider-required settings in the UI before scheduling (not just drafts)","Re-validate settings when promoting a draft to schedule","Re-pull remote resources (boards, channels) when they change"],"tags":["posts","settings","validation","provider","scheduling"],"backgroundTag":"schema-validation-failed","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}