Translating single type returns 404 and then 500

I have a single type named “frontpage” and two locales.

One locale (de) is saved and published, the other (en) is not.

  • I switch from de to en and add content
  • I hit save, I get: Success: saved (if I navigate away and back its gone though)
  • I hit publish, I get Warning: not found

http://localhost:1337/content-manager/single-types/api::frontpage.frontpage/actions/publish?locale=en

    "data": null,
    "error": {
        "status": 404,
        "name": "NotFoundError",
        "message": "Not Found",
        "details": {}
    }
}```

- then i edit the content again and click save I get **Warning: Internal Server Error**

Any idea how to fix this, what could be the problem?
Thanks in advance!

<i>This topic has been created from a Discord post (1226827762258411541) to give it more visibility.
It will be on Read-Only mode here.
<a href="https://discord.com/channels/811989166782021633/1226827762258411541/1226827762258411541">Join the conversation on Discord</a></i>

this is logged by strapi running locally (after the 500):
[2024-04-08 11:33:08.446] error: insert into `frontpages` (`created_at`, `created_by_id`, `id`, `locale`, `published_at`, `updated_at`, `updated_by_id`) values ('2024-04-08 11:33:08.445', 1, 6, 'de', NULL, '2024-04-08 11:33:08.445', 1) returning `id` - UNIQUE constraint failed: frontpages.id SqliteError: insert into `frontpages` (`created_at`, `created_by_id`, `id`, `locale`, `published_at`, `updated_at`, `updated_by_id`) values ('2024-04-08 11:33:08.445', 1, 6, 'de', NULL, '2024-04-08 11:33:08.445', 1) returning `id` - UNIQUE constraint failed: frontpages.id at Client_BetterSQLite3._query (/Users/fs/Sites/ts-strapi/node_modules/knex/lib/dialects/better-sqlite3/index.js:39:40) at executeQuery (/Users/fs/Sites/ts-strapi/node_modules/knex/lib/execution/internal/query-executioner.js:37:17) at Client_BetterSQLite3.query (/Users/fs/Sites/ts-strapi/node_modules/knex/lib/client.js:154:12) at Runner.query (/Users/fs/Sites/ts-strapi/node_modules/knex/lib/execution/runner.js:141:36) at ensureConnectionCallback (/Users/fs/Sites/ts-strapi/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:13:17) at Runner.ensureConnection (/Users/fs/Sites/ts-strapi/node_modules/knex/lib/execution/runner.js:318:20) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Runner.run (/Users/fs/Sites/ts-strapi/node_modules/knex/lib/execution/runner.js:30:19) at async Object.execute (/Users/fs/Sites/ts-strapi/node_modules/@strapi/database/dist/index.js:4254:22) at async Object.create (/Users/fs/Sites/ts-strapi/node_modules/@strapi/database/dist/index.js:5028:19) [2024-04-08 11:33:08.446] http: PUT /content-manager/single-types/api::frontpage.frontpage/?locale=en (27 ms) 500

Could this be related to Issue directly publishing a translated entity after translating · Issue #19528 · strapi/strapi · GitHub?

I’ve just created a new single type, to be sure it has nothing to with “turning on localisation” after content for one locale has already been created.

The issue remains.

Problem solved by updating to 4.22.1
fix:issue on do not validate locale if not creating for all locales by binar1 · Pull Request #19799 · strapi/strapi · GitHub :tada: