Closed (fixed)
Project:
Single Content Sync
Version:
1.4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Mar 2025 at 02:47 UTC
Updated:
27 Nov 2025 at 04:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
vladimirausDigging further, the module collects same entity multiple times so looks like it is cyclic until it runs out of memory or times out.
Comment #3
vladimirausAfter further investigation I found versions 1.4.7+ are unusable for complex websites with a lot of references.
The issues discovered:
$this->exporter->doExportToArray($entity->get('parent')->entity)inDrupal\single_content_sync\Plugin\SingleContentSyncBaseFieldsProcessor\TaxonomyTerm::exportBaseValues()Comment #4
nginex commentedthat's not a critical issue, it's easy to fix, expect a new patch in a few minutes
Comment #6
nginex commentedwell I don't know what is your exact structure, so it's hard to test it for me as I can't reproduce it. In any case, I provided a MR that might improve the export. Do you export node with a taxonomy reference or you export a taxonomy entity itself? Please provide more details of your content structure, so I can replicate it at least. Also take a screenshot of your settings form or paste the content of single_content_sync.settings.yml here (you can remove any custom entities if you wish)
Comment #7
nginex commentedComment #8
vladimirausNope, getting
Comment #9
vladimirausComment #10
nginex commentedI asked you a few questions and received 0 answers, can you please provide any information about your content structure. If the issue is not reproducible out of the box, this cannot be critical.
Please set up a clean Drupal, set up the necessary content structure and relationships between entities, try to reproduce and if it’s reproducible, post the steps how to reproduce it
Comment #11
vladimirausThanks @nginex. Production data is too complex to export.
Let me setup clear instance and try to replicate it.
From what I investigated, entities that are referenced in text fields are being exported as well (both taxonomies and nodes).
Comment #12
nginex commentedCorrect, that feature did not exist in 1.4.6. Probably it makes sense to change the logic of export there. Let me update the patch and try to optimize that moment (instead of exporting full entity I will only export stub version of it)
Comment #13
nginex commentedI provided a few new options of exporting for menu links of content and embedded links from formatted text. By default it will be Stub mode instead of Full one. Also it's possible to select None.
Let me know if new patch works for you. Don't forget to run drush updb.
Comment #14
talishk commentedWas able to export the zip with the patch suggested. However, currently unable to import zip with all assets - Bad Gateway
An AJAX HTTP error occurred.
HTTP Result Code: 502
Debugging information follows.
Path: /batch?id=6746686&op=do_nojs&op=do
StatusText: error
ResponseText:
502 Bad Gateway
502 Bad Gateway
nginx
My observation is that the function validateYamlFileContent() is causing Bad Gateway when trying to decode the YML file
$content = Yaml::decode($content); in /single_content_sync/src/ContentSyncHelper.php
If anybody has faced similar issue, please advise
Comment #15
nginex commentedwould it be possible to share the file you exported? I would like to review it and see what's wrong with it.
Comment #16
laureana commentedI believe this is related to commit 72ae530b821671faf1db0931fead72a564a27d27 which was made to address issue #3491573.
Instead of just have "uri: 'entity:node/xxx'", now we also have the "linked_entity" property with all related content.
For example, i've a node type "page" with lots of paragraphs inside. Inside one of them i've a field "link" related to another node "page". Instead having only this relation with the id, now i've have all contents of the second page and.. if this second have another link, and maybe it's enabled to be inside a menu, i have also all menu parents content in the export.
However, it's not important have a link inside the first page, it occours also if the first page provide a menu item (menu_link property), so all parents are exported.
The same content exported with different version of single_content_sync module could have a very different yml file sizes:
In this scenario i tried to export a "page" and the export starting from 1.4.7 exports about 75 pages with all contents.
In the first level i have "base_fields" at row 5 of the .yml, inside it i have "menu_link" at row 14 and "moderation_state" at row 190888. So i have 190k rows of "other pages content". In the 1.4.6 version (exporting the same content) the "menu_link" property that starts at row 14, ends at row 3254 because there isn't "linked_entity" prop.
So it's difficult to import in some circumstances (or need long processing times triggering a bad gateway in many environments). Maybe adding "linked_entity" could be an optional option of the export.
Ps. I'm not telling that it's wrong, i'm telling that after "linked_entity" property maybe it could be difficult import contents
Hope it helps!
Comment #17
nginex commentedI agree with @laureana
I forgot to include optimization for link file and its embedded entities to the config form to make it stub or optional.
Will extend my patch
Comment #18
nginex commentedembedded_entities_export_mode should be now in use for Formatted text and Link plugins. I think using stub option is gonna solve a lot of issues
Comment #19
npcoder commentedWe had a similar issue when exporting a "Layout Components Page" node using the
single_content_syncmodule (version 1.4.13) in Drupal 10.4.3. The issue arises due to recursive field exports triggered by enabling the "Provide a menu link" option, resulting in excessively large exports and performance issues. It happened when there is a deeper level of the menu.For fixing this issue, there is a patch. Please test it and comment.
Comment #20
nginex commentedPatch from #19 does similar job to the patch from MR 154, but the patch from MR has an extra configuration that allows to configure it instead of hardcoding
Comment #21
alfattal commentedI was having similar issue and the patch in MR !154 fixed this issue for me. 1+ for RTBC.
Comment #22
nginex commentedNice, I'm going to include this to the next release
Comment #23
jannakha commented+1 to MR 154
import/export works on a node that references 46 other nodes
total length of the export file is 16716 lines!
thanks for MR!
please release!
Comment #24
o_timoshchuk commentedI created a patch from the merge request, and it works well for version 1.4.13
Comment #26
nginex commentedThis is now available in new release 1.4.14
Comment #28
jannakha commentedthank you to all the contributors!!! 🍾 🥂