Answers.Body: <p>I don’t know what version of Craft or MySQL you’re on, but this could either be a MySQL bug, a MySQL configuration issue, an Incognito plugin bug, or a Craft bug.</p>
  <p><a href="https://stackoverflow.com/a/67266529">https://stackoverflow.com/a/67266529</a></p>
  <p>I’d start by ensuring you’re running the latest versions of each to rule out issues that have already been fixed.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-23T05:03:29.947Z
Answers.LastActivityDate: 2024-07-23T05:03:29.947Z
Answers.UserDisplayName: Brad Bell
Body: <p>This error: <code>SQLSTATE[HY001]: Memory allocation error: 1038 Out of sort memory, consider increasing server sort buffer size</code> is causing the <strong>Updating Search Indexes</strong> job to fail. The section that is causing this failure is a <strong>Channel</strong> called <strong>walks</strong>. We have also seen this issue affect the <code>admin/entries/walks</code> page in the Control Panel. When accessing <code>admin/entries/walks</code>, no entries are displayed and an error message reading &quot;A server error has occurred.&quot; appears in the bottom left hand corner of the page. This message also appears when attempting to export the entries.</p>
  <p><strong>Walks</strong> entries have a read-only plain text field that uses the <a href="https://plugins.craftcms.com/incognito-field?craft5=" rel="nofollow noreferrer">Incognito Field</a> plugin and is of type <strong>Incognito Field</strong> rendered in <strong>Read-only</strong> mode. This field contains data in <code>.geojson</code> format and can be quite large. Is there a way to exclude this field from the query performed by this job/when the entries page is accessed in the Control Panel? The SQL being executed that causes the failure is as follows:</p>
  <p><code>SELECT `elements`.`id`, `elements`.`canonicalId`, `elements`.`fieldLayoutId`, `elements`.`uid`, `elements`.`enabled`, `elements`.`archived`, `elements`.`dateLastMerged`, `elements`.`dateCreated`, `elements`.`dateUpdated`, `elements_sites`.`id` AS `siteSettingsId`, `elements_sites`.`siteId`, `elements_sites`.`title`, `elements_sites`.`slug`, `elements_sites`.`uri`, `elements_sites`.`content`, `elements_sites`.`enabled` AS `enabledForSite`, `entries`.`sectionId`, `entries`.`fieldId`, `entries`.`primaryOwnerId`, `entries`.`typeId`, `entries`.`postDate`, `entries`.`expiryDate`, `elements`.`draftId`, `drafts`.`creatorId` AS `draftCreatorId`, `drafts`.`provisional` AS `isProvisionalDraft`, `drafts`.`name` AS `draftName`, `drafts`.`notes` AS `draftNotes` FROM (SELECT `elements`.`id` AS `elementsId`, `elements_sites`.`id` AS `siteSettingsId` FROM `elements` `elements` INNER JOIN `entries` `entries` ON `entries`.`id` = `elements`.`id` INNER JOIN `elements_sites` `elements_sites` ON `elements_sites`.`elementId` = `elements`.`id` LEFT JOIN `drafts` `drafts` ON `drafts`.`id` = `elements`.`draftId` WHERE (`entries`.`sectionId`=4) AND (`elements`.`archived`=FALSE) AND (`elements`.`dateDeleted` IS NULL) AND (`elements`.`canonicalId` IS NULL) AND ((`elements`.`draftId` IS NULL) OR (`drafts`.`provisional`=FALSE)) AND ((`elements`.`draftId` IS NULL) OR (NOT (`elements`.`canonicalId` IS NULL)) OR (`drafts`.`saved`=TRUE)) AND (`elements`.`revisionId` IS NULL) ORDER BY `postDate` IS NULL DESC, `postDate` DESC LIMIT 100 OFFSET 200) `subquery` INNER JOIN `elements` `elements` ON `elements`.`id` = `subquery`.`elementsId` INNER JOIN `elements_sites` `elements_sites` ON `elements_sites`.`id` = `subquery`.`siteSettingsId` INNER JOIN `entries` `entries` ON `entries`.`id` = `subquery`.`elementsId` LEFT JOIN `drafts` `drafts` ON `drafts`.`id` = `elements`.`draftId` ORDER BY `postDate` IS NULL DESC, `postDate` DESC;</code></p>
  
Tags: <error><memory><sql>
Title: Updating search index fails due to following SQL error: SQLSTATE[HY001]: Memory allocation error
ThreadText: # Updating search index fails due to following SQL error: SQLSTATE[HY001]: Memory allocation error
  
  (Asked by: username_0 on 2024-07-19)
  
  This error: `SQLSTATE[HY001]: Memory allocation error: 1038 Out of sort memory, consider increasing server sort buffer size` is causing the **Updating Search Indexes** job to fail. The section that is causing this failure is a **Channel** called **walks**. We have also seen this issue affect the `admin/entries/walks` page in the Control Panel. When accessing `admin/entries/walks`, no entries are displayed and an error message reading "A server error has occurred." appears in the bottom left hand corner of the page. This message also appears when attempting to export the entries.
  
  **Walks** entries have a read-only plain text field that uses the [Incognito Field](https://plugins.craftcms.com/incognito-field?craft5=) plugin and is of type **Incognito Field** rendered in **Read-only** mode. This field contains data in `.geojson` format and can be quite large. Is there a way to exclude this field from the query performed by this job/when the entries page is accessed in the Control Panel? The SQL being executed that causes the failure is as follows:
  
  `SELECT `elements`.`id`, `elements`.`canonicalId`, `elements`.`fieldLayoutId`, `elements`.`uid`, `elements`.`enabled`, `elements`.`archived`, `elements`.`dateLastMerged`, `elements`.`dateCreated`, `elements`.`dateUpdated`, `elements_sites`.`id` AS `siteSettingsId`, `elements_sites`.`siteId`, `elements_sites`.`title`, `elements_sites`.`slug`, `elements_sites`.`uri`, `elements_sites`.`content`, `elements_sites`.`enabled` AS `enabledForSite`, `entries`.`sectionId`, `entries`.`fieldId`, `entries`.`primaryOwnerId`, `entries`.`typeId`, `entries`.`postDate`, `entries`.`expiryDate`, `elements`.`draftId`, `drafts`.`creatorId` AS `draftCreatorId`, `drafts`.`provisional` AS `isProvisionalDraft`, `drafts`.`name` AS `draftName`, `drafts`.`notes` AS `draftNotes` FROM (SELECT `elements`.`id` AS `elementsId`, `elements_sites`.`id` AS `siteSettingsId` FROM `elements` `elements` INNER JOIN `entries` `entries` ON `entries`.`id` = `elements`.`id` INNER JOIN `elements_sites` `elements_sites` ON `elements_sites`.`elementId` = `elements`.`id` LEFT JOIN `drafts` `drafts` ON `drafts`.`id` = `elements`.`draftId` WHERE (`entries`.`sectionId`=4) AND (`elements`.`archived`=FALSE) AND (`elements`.`dateDeleted` IS NULL) AND (`elements`.`canonicalId` IS NULL) AND ((`elements`.`draftId` IS NULL) OR (`drafts`.`provisional`=FALSE)) AND ((`elements`.`draftId` IS NULL) OR (NOT (`elements`.`canonicalId` IS NULL)) OR (`drafts`.`saved`=TRUE)) AND (`elements`.`revisionId` IS NULL) ORDER BY `postDate` IS NULL DESC, `postDate` DESC LIMIT 100 OFFSET 200) `subquery` INNER JOIN `elements` `elements` ON `elements`.`id` = `subquery`.`elementsId` INNER JOIN `elements_sites` `elements_sites` ON `elements_sites`.`id` = `subquery`.`siteSettingsId` INNER JOIN `entries` `entries` ON `entries`.`id` = `subquery`.`elementsId` LEFT JOIN `drafts` `drafts` ON `drafts`.`id` = `elements`.`draftId` ORDER BY `postDate` IS NULL DESC, `postDate` DESC;`
  
  **Tags:** error, memory, sql
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-07-23. Score: 0
  
  I don’t know what version of Craft or MySQL you’re on, but this could either be a MySQL bug, a MySQL configuration issue, an Incognito plugin bug, or a Craft bug.
  
  <https://stackoverflow.com/a/67266529>
  
  I’d start by ensuring you’re running the latest versions of each to rule out issues that have already been fixed.
  
  
  ---
  
  