Answers.Body: <p>I can offer a solution to get you unstuck, but it won't solve whatever caused it to get stuck. If you're on mysql, open mysql in your commandline of choice and then use the command <code>show processlist;</code></p>
  <p>From there you can kill stuck processes by running <code>KILL id</code> where id is the process' ID from the processlist. After that, you'll need to check your database setup. Check your resource usage in the DO dashboard (you might need more memory if mysql is hanging on large tasks) as well as the items Brad mentioned.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-23T01:10:04.537Z
Answers.LastActivityDate: 2023-08-23T01:10:04.537Z
Answers.UserDisplayName: cherrykoda
Answers.Body: <blockquote>
  <p>SQLSTATE[HY000]: General error: 2006 MySQL server has gone away</p>
  </blockquote>
  <p>Unfortunately, that’s one of those generic MySQL error messages that could mean many things.</p>
  <p>Typically when we see it, it’s because the MySQL <a href="https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_allowed_packet" rel="nofollow noreferrer">max_allowed_packet</a> config setting is set too low on the server, or the <a href="https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout" rel="nofollow noreferrer">wait_timeout</a> setting is. You can try bumping those up to some higher values.</p>
  <p>If that doesn’t fix it, there are other solutions to try in the official MySQL documentation on the subject: <a href="https://dev.mysql.com/doc/refman/8.0/en/gone-away.html" rel="nofollow noreferrer">https://dev.mysql.com/doc/refman/8.0/en/gone-away.html</a></p>
  <p>Hope that helps!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-24T22:08:45.973Z
Answers.LastActivityDate: 2023-01-24T22:08:45.973Z
Answers.UserDisplayName: Brad Bell
Answers.Body: <p>You can remove the stuck / frozen task be deleting the corresponding row in the Craft CMS database table <code>assetindexingsessions</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-08T12:22:15.320Z
Answers.LastActivityDate: 2024-08-08T12:22:53.897Z
Answers.LastEditDate: 2024-08-08T12:22:53.897Z
Answers.UserDisplayName: Martin Schwenzer
Body: <p>I'm using Craft 4.3.6.1 and a DigitalOcean Spaces filesystem. On the Utilities &gt; Asset Indexes page, I clicked &quot;Update Asset Indexes&quot; button. A procress started and got about 3% done before freezing (there are a large number of assets: 2700).</p>
  <p>I clicked the &quot;Discard&quot; button, but it didn't do anything. I tried clicking &quot;Update Asset Indexes&quot; again, but it just adds another task to the queue, which it can't execute because its waiting on the first (frozen) one to finish.</p>
  <p>In <strong>/storage/logs/queue.log</strong>, these errors/warnings are showing up:</p>
  <pre><code>[queue.ERROR] [craft\queue\QueueLogBehavior::afterError]  [56071] t9n:[&quot;app&quot;,&quot;Generating pending image transforms&quot;] (attempt: 1, pid: 1646408) - Error (time: 22.829s): SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
  [queue.WARNING] [craft\elements\db\ElementQuery::prepare] Element query executed before Craft is fully initialized.
  </code></pre>
  <p>Here are a handful of settings in my <strong>php.ini</strong> that seem relevant:</p>
  <pre><code>memory_limit         512M
  post_max_size        8M
  upload_max_filesize  512M
  max_execution_time   300
  post_max_size        16M
  max_file_uploads     64
  </code></pre>
  <p>I also have <strong>restarted php8 and my nginx server</strong> several times. 24 hours later, the process is still stuck at the same spot and I can't discard it. Any thoughts about what might be going on here and how I can resolve it?</p>
  
Tags: <assets><digitalocean>
Title: Asset Indexing is frozen and I can't discard the task
ThreadText: # Asset Indexing is frozen and I can't discard the task
  
  (Asked by: username_0 on 2023-01-22)
  
  I'm using Craft 4.3.6.1 and a DigitalOcean Spaces filesystem. On the Utilities > Asset Indexes page, I clicked "Update Asset Indexes" button. A procress started and got about 3% done before freezing (there are a large number of assets: 2700).
  
  I clicked the "Discard" button, but it didn't do anything. I tried clicking "Update Asset Indexes" again, but it just adds another task to the queue, which it can't execute because its waiting on the first (frozen) one to finish.
  
  In **/storage/logs/queue.log**, these errors/warnings are showing up:
  
  ```
  [queue.ERROR] [craft\queue\QueueLogBehavior::afterError]  [56071] t9n:["app","Generating pending image transforms"] (attempt: 1, pid: 1646408) - Error (time: 22.829s): SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
  [queue.WARNING] [craft\elements\db\ElementQuery::prepare] Element query executed before Craft is fully initialized.
  
  ```
  
  Here are a handful of settings in my **php.ini** that seem relevant:
  
  ```
  memory_limit         512M
  post_max_size        8M
  upload_max_filesize  512M
  max_execution_time   300
  post_max_size        16M
  max_file_uploads     64
  
  ```
  
  I also have **restarted php8 and my nginx server** several times. 24 hours later, the process is still stuck at the same spot and I can't discard it. Any thoughts about what might be going on here and how I can resolve it?
  
  **Tags:** assets, digitalocean
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2023-08-23. Score: 1
  
  I can offer a solution to get you unstuck, but it won't solve whatever caused it to get stuck. If you're on mysql, open mysql in your commandline of choice and then use the command `show processlist;`
  
  From there you can kill stuck processes by running `KILL id` where id is the process' ID from the processlist. After that, you'll need to check your database setup. Check your resource usage in the DO dashboard (you might need more memory if mysql is hanging on large tasks) as well as the items username_2 mentioned.
  
  
  ---
  
  ### Answer by username_2 on 2023-01-24. Score: 0
  
  > SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
  
  Unfortunately, that’s one of those generic MySQL error messages that could mean many things.
  
  Typically when we see it, it’s because the MySQL [max\_allowed\_packet](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_allowed_packet) config setting is set too low on the server, or the [wait\_timeout](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout) setting is. You can try bumping those up to some higher values.
  
  If that doesn’t fix it, there are other solutions to try in the official MySQL documentation on the subject: <https://dev.mysql.com/doc/refman/8.0/en/gone-away.html>
  
  Hope that helps!
  
  
  ---
  
  ### Answer by username_3 on 2024-08-08. Score: 0
  
  You can remove the stuck / frozen task be deleting the corresponding row in the Craft CMS database table `assetindexingsessions`.
  
  
  ---
  
  