I am getting a gack when creating a new community based on my community template so am looking at the template's content to try to see what is wrong. There is an example of such a template in the CommunityTemplateDefinition documentation, and that includes this image reference:
<bundlesInfo> <image>siteAsset_2dbe594eb6794173af78da264cd6a4a7</image> <order>1</order> <title>Preview Image</title> <type>PreviewImage</type> </bundlesInfo>
Where is that image located and how does "siteAsset_2dbe594eb6794173af78da264cd6a4a7" identify the image?
(In my org I can't see anything with a matching name.)
I found the cause of the gack. The template somehow caused a custom setting in a separate managed package to self-initialize and that DML seems to be the cause the gack because pre-creating the custom setting org defaults avoids the problem. (Found this custom setting reference in the debug log.)