Skip to content

[5.x]: Craft cannot process certain queue requests when runQueueAutomatically() is set to true - Session errors #18739

@terryupton

Description

@terryupton

What happened?

Description

Since Craft 5.9.19 - I am seeing that Craft cannot process queue requests automatically, if the setting runQueueAutomatically() is set to true.

In the queue panel - seeing errors like this;
session_set_save_handler(): Session save handler cannot be changed after headers have already been sent (sent from /home/ploi/dev.pemuk.com/vendor/yiisoft/yii2/web/Response.php on line 442)

This is occurring with standard Craft jobs like;

Standard Craft Queue Jobs like craft\queue\jobs\PruneRevisions or craft\queue\jobs\UpdateSearchIndex

If the queue is run manually or on a cronjob or worker then it seems to work ok.

Steps to reproduce

  1. Upgrade to Craft 5.9.19
  2. Ensure runQueueAutomatically() is set to true
  3. Login to the CP and wait for a queue item to try and run or try and trigger one with a change and an UpdateSearchIndex

Expected behavior

  1. Queue should run and process the jobs automatically.

Actual behavior

  1. Queue job failes ad remains in the queue with errors like session_set_save_handler(): Session save handler cannot be changed after headers have already been sent (sent from /home/ploi/dev.pemuk.com/vendor/yiisoft/yii2/web/Response.php on line 442)

Craft CMS version

5.9.20

PHP version

8.5.5

Operating system and version

Linux 6.8.0-107-generic

Database type and version

MySQL 8.0.45

Image driver and version

Imagick 3.8.1 (ImageMagick 6.9.12-98)

Installed plugins and versions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions