Open FrittenKeeZ opened 6 years ago
Worth noting that this is an extremely hard to reproduce bug, which has only occurred on our staging environment. The localized pages will have the same ID, but they will differ from the main language. This is the only errors we have prior to the crash:
[2018-09-05 14:35:57] stage.ERROR: Cannot add [pages/1.hoteller/17.comwell-hotel-varbergs-kusthotell/4.behandlinger/_3.spabehandlingar-1/index.md] to Stache repository [pages]. File at [pages/1.hoteller/17.comwell-hotel-varbergs-kusthotell/4.behandlinger/_1.spabehandlingar-1/index.md] already exists in repository [pages] with an ID of [4b7daf5a-ec5b-4fcb-a106-9aa1f860e7b2].
[2018-09-05 14:38:12] stage.ERROR: Cannot add [pages/1.hoteller/17.comwell-hotel-varbergs-kusthotell/4.behandlinger/3.spabehandlingar-1/index.md] to Stache repository [pages]. File at [pages/1.hoteller/17.comwell-hotel-varbergs-kusthotell/4.behandlinger/1.spabehandlingar-1/index.md] already exists in repository [pages] with an ID of [4b7daf5a-ec5b-4fcb-a106-9aa1f860e7b2].
[2018-09-05 14:44:56] stage.ERROR: Cannot add [pages/1.hoteller/17.comwell-hotel-varbergs-kusthotell/4.behandlinger/4.spabehandlingar-1-1/index.md] to Stache repository [pages]. File at [pages/1.hoteller/17.comwell-hotel-varbergs-kusthotell/4.behandlinger/1.spabehandlingar-1-1/index.md] already exists in repository [pages] with an ID of [9769d355-1d0f-45f3-980d-b1bf1a8ba7c3].
[2018-09-05 14:44:56] stage.ERROR: Cannot add [pages/1.hoteller/17.comwell-hotel-varbergs-kusthotell/4.behandlinger/5.spabehandlingar-1-1-1/index.md] to Stache repository [pages]. File at [pages/1.hoteller/17.comwell-hotel-varbergs-kusthotell/4.behandlinger/1.spabehandlingar-1-1-1/index.md] already exists in repository [pages] with an ID of [1e607b7a-1697-43ce-97cf-c7c00ebd904b].
[2018-09-05 14:57:08] stage.ERROR: Cannot add [pages/1.hoteller/17.comwell-hotel-varbergs-kusthotell/3.spa/1.behandlinger/3.spabehandlingar-hand-fot/index.md] to Stache repository [pages]. File at [pages/1.hoteller/17.comwell-hotel-varbergs-kusthotell/4.behandlinger/3.spabehandlingar-hand-fot/index.md] already exists in repository [pages] with an ID of [4b7daf5a-ec5b-4fcb-a106-9aa1f860e7b2].
Hey @jackmcdade and @jasonvarga
We're having a really rough time with multiple languages - we get a lot of duplicate ID issues and editors only use CP... I don't know how or why it's happening, but we're losing credibility with our client, as they think the system is unstable with these errors, which potentially can force the site to crash.
We need this to be resolved once and for all.
This sadly also occurs when moving pages around.
Any update on this one? I've got a client site that is having the same issue when reordering or removing pages. Also a site with multiple languages.
Let me know what info I can provide to help debug further.
@nobodyiscertain how much content do they have on their site? We have a patch in place for locking the Stache when pages are being moved around, but Stache still isn't always updated correctly after the reordering - but corruption seems to be prevented with it.
diff --git statamic/core/Http/Controllers/PagesController.php statamic/core/Http/Controllers/PagesController.php
index 5b79402..52af909 100644
--- statamic/core/Http/Controllers/PagesController.php
+++ statamic/core/Http/Controllers/PagesController.php
@@ -161,10 +161,20 @@ class PagesController extends CpController
{
$this->authorize('pages:reorder');
- // Grab the JSON payload
- $tree = $this->request->input('pages');
+ // Hang it there, this might take a while!
+ set_time_limit(0);
- $reorderer->reorder($tree);
+ if (app('stache')->lock()->acquire(true)) {
+ // Grab the JSON payload
+ $tree = $this->request->input('pages');
+
+ $reorderer->reorder($tree);
+
+ app('stache')->lock()->release();
+ }
Stache::update();
Quite a bit of content, hundreds of pages/collection entries. Does that patch work with lots of content?
It works a lot better than without the patch, that much I can say.
Patching core code isn't ideal, but will give it a shot and see how it goes. Thanks for the help!
Describe the bug Duplicating a page with multiple languages will cause duplicate IDs error. When trying to resolve the issue, the non-primary languages with get different IDs than the primary, which will blow up the cache/stache.
To Reproduce Steps to reproduce the behavior:
Call to a member function in() on null
.Expected behavior Duplication of pages should work regardless of number of languages.
Screenshots
Environment details (please complete the following information):