Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x]: Invalid Owner ID Multisite Setup #15964

Open
harry2909 opened this issue Oct 25, 2024 · 1 comment
Open

[5.x]: Invalid Owner ID Multisite Setup #15964

harry2909 opened this issue Oct 25, 2024 · 1 comment
Labels

Comments

@harry2909
Copy link

What happened?

Description

There seem to be a number of entries suddenly showing invalid owner ID when saving, and I am not sure why.

When running various DB queries, there are some elements_sites rows that seem to have no relations, but some of the offending entries do have relations and seem to be related to the hyper plugin. I am not sure if this is related to verbb/hyper#189. I am finding it really difficult to get to the bottom of the issue.

Here is an example:
Saving the "home" single, I get invalid owner id 1114

Running various queries:

SELECT * FROM elements WHERE id = 1114;
Gives: 1114 NULL NULL NULL 46 craft\elements\Entry 1 0 2024-07-23 15:29:50 2024-10-23 11:30:14 NULL NULL NULL 2ce77f04-8b80-4e84-83a1-eed5c7347a83

SELECT * FROM elements_sites WHERE elementId = 1114;
Gives: 1198 1114 1 NULL __temp_jltxwjjcncjrvqqevsrjrwdwmsalsezficlp NULL {"1624958e-405a-4ac2-8b29-649815a1b483": "<p><span>Your independent psychology and neurodevelopmental partner.</span></p>", "217693d6-9230-49df-b335-5faf026505ca": [11635, 10909, 9769], "81dca896-cfa1-4329-911f-e63a091ed1ae": true, "a265225e-c038-4cce-8365-84d5874813b5": "stoneMist", "b00a32db-b371-4156-9d93-4215e478b06c": "Assess Support Empower"} 1 2024-07-23 15:29:50 2024-10-23 11:01:16 dc1f4bbc-b3a5-4542-92c4-1674283d0a2d

SELECT * FROM elements_owners WHERE ownerId = 1114;
Gives:

1115	1114	1
1116	1114	2
1572 1114 3
1573 1114 4

SELECT * FROM relations WHERE sourceId = 1114 OR targetId = 1114;
Gives:

2005	69	1114	2	394	1	2024-07-24 20:23:21	2024-07-24 20:23:21	7bf8eccc-d910-4ae7-ac8c-d7df83a8229f
2006	69	1114	2	393	2	2024-07-24 20:23:21	2024-07-24 20:23:21	b079abf3-941b-4e5e-9e2d-d0a4eff764d5
2007	69	1114	2	392	3	2024-07-24 20:23:21	2024-07-24 20:23:21	7780ea1d-6c70-4630-bc3f-b080c2b9d9a5
15313	69	1114	1	9769	3	2024-10-10 12:27:27	2024-10-10 12:27:27	1c25468f-1629-4547-9d3d-1a04a2003ec8
16638	69	1114	1	10909	2	2024-10-16 18:44:48	2024-10-18 09:55:22	3d40cb8a-7dfe-4299-a814-dfc8885b74ab
17459	69	1114	1	11635	1	2024-10-23 11:01:16	2024-10-23 11:01:16	4d9fdb44-a771-468a-a8a4-eb5d40922a60

SELECT * FROM entries WHERE id = 1114;
Gives:
1114 NULL NULL 5 9 29 2024-07-23 15:25:00 NULL NULL 2024-07-23 15:29:50 2024-07-23 15:29:50

SELECT e.* FROM elements e
JOIN elements_owners eo ON e.id = eo.elementId
WHERE eo.ownerId = 1114;

Gives:

1115	NULL	NULL	NULL	68	craft\elements\Entry	1	0	2024-07-23 15:29:50	2024-10-23 11:30:14	NULL	NULL	NULL	500f490a-10ee-42d1-a2a6-95645aeb5302
1116	NULL	NULL	NULL	68	craft\elements\Entry	1	0	2024-07-23 15:29:50	2024-10-23 11:30:14	NULL	NULL	NULL	416ec1cc-4a42-4aa1-893e-2f975934ba53
1572	NULL	NULL	NULL	68	craft\elements\Entry	1	0	2024-07-30 09:24:08	2024-07-30 09:24:08	NULL	NULL	NULL	c49e938b-5722-4492-9043-6baaceff0a92
1573	NULL	NULL	NULL	68	craft\elements\Entry	1	0	2024-07-30 09:24:08	2024-07-30 09:24:08	NULL	NULL	NULL	b7b6991d-8689-4eab-80f3-3845f6d6717c

If I discard the changes of that entry, I can save it no problem, it seems to be with the draft. I do think it could be related to hyper, but when deleting all blocks off of the entry (just on the entry, not the entry type), I still get the error.

I have tried the following:

  • Run craft gc command
  • Run utils command for cleaning up orphans (they give more errors about invalid owner ids)
  • Deleting this particular entry from elements_sites (this allowed me to save the entry, but probably had unintended consequences as running the clean orphans command then reported the 1114 invalid owner ID issue, whereas before deleting that entry, it didn't)
  • Project config rebuild, sync --force

I appreciate this is probably very hard to track down, I'd just like some advice on how I can resolve it.

I am using a multisite setup. Some of the other owner id errors seem to come from that site.

I have also just tested re-enabling the other site, then saving the home entry on the main site, and got an error saying "there is no ID for this draft" then after a refresh, the same invalid owner id 1114 again.

Steps to reproduce

  1. Save entry

Expected behavior

Entry saves

Actual behavior

Invalid owner ID

Craft CMS version

5.4.9

PHP version

8.3.8

Operating system and version

Linux 6.6.32-linuxkit

Database type and version

MySQL 8.0.36

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

  • Admin Bar (5.0.0)
  • CKEditor (4.3.1)
  • CP Field Inspect (2.0.2)
  • Expanded Singles (3.0.1)
  • Image Resizer (4.0.1)
  • Matrix Block Anchor (2.0.1)
  • Matrix Extended (3.6.1)
  • Scout (5.0.1)
  • Servd Assets and Helpers (4.0.8)
  • Vite (5.0.1)
@harry2909 harry2909 added the bug label Oct 25, 2024
@i-just
Copy link
Contributor

i-just commented Oct 28, 2024

Hi, thanks for getting in touch. What was the last version where the same entries were working as expected?

Would you be able to share your composer.json, composer.lock and database export so we can try to replicate and dig deeper? If so, please send them over to [email protected] and point out a few entries that have this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants