Issue Bug Closed

#106785PHP Warning: ob_start(): Output handler 'ob_gzhandler' cannot be used twice when creating backend user/group

Sébastien Delcroix 05/27/25, 15:30 updated 12/02/25, 13:59

Description

Hi,

since 12.4.31 or 12.4.32, we got this warning when creating backend user or group :

PHP Warning: ob_start(): Output handler 'ob_gzhandler' cannot be used twice in [...]/typo3/sysext/backend/Classes/Middleware/OutputCompression.php line 55

In some dev instances where we enable the Debug preset, this lead to an exception which prevents the user/group creation.

Note : as Garvin asked on Slack, this is not a composer installation

Reviews 3

Files 1

History 1621

  1. Sébastien Delcroix commented <span data-processor="relativetime" data-value="2025-05-27T18:14:48+00:00" > 05/27/25, 18:14 </span>

    Error happens after clicking on the “verify” button in the modal.

    Here is the middlewares sequence :

    1. VerifyHostHeader
    2. NormalizedParamsAttribute
    3. LockedBackendGuard
    4. ForcedHttpsBackendRedirector
    5. ContentSecurityPolicyReporter
    6. BackendRouteInitialization
    7. RequestTokenMiddleware
    8. BackendUserAuthenticator
    9. BackendModuleValidator
    10. OutputCompression
    11. ContentSecurityPolicyHeaders
    12. AdditionalResponseHeaders
    13. SudoModeInterceptor

    There is a call to SudoModeInterceptor->handleRequestGrantedException()

    this calls typo3_src-12.4.32-dev/typo3/sysext/backend/Classes/Middleware/SudoModeInterceptor.php line 127 :

    return $this->application->handle($request);

    And then the middlewares sequence starts again until crash :

    1. VerifyHostHeader
    2. NormalizedParamsAttribute
    3. LockedBackendGuard
    4. ForcedHttpsBackendRedirector
    5. ContentSecurityPolicyReporter
    6. BackendRouteInitialization
    7. RequestTokenMiddleware
    8. BackendUserAuthenticator
    9. BackendModuleValidator
    10. OutputCompression
    => #1476107295 TYPO3\CMS\Core\Error\Exception 
    
    PHP Warning: ob_start(): Output handler 'ob_gzhandler' cannot be used twice in [...]/typo3_src-12.4.32-dev/typo3/sysext/backend/Classes/Middleware/OutputCompression.php line 55
  2. Sébastien Delcroix commented <span data-processor="relativetime" data-value="2025-05-27T18:17:39+00:00" > 05/27/25, 18:17 </span>

    Weird thing is that I’m in developer context but I have to enter the admin (or Install Tool) password when creating a backend user/group.

  3. Sébastien Delcroix commented <span data-processor="relativetime" data-value="2025-05-27T18:56:09+00:00" > 05/27/25, 18:56 </span>

    Hmm OK, I thought that I’ve read somewhere that this step is bypassed in developer context

  4. Sybille Peters commented and changed attached exception_stacktrace_12_4_32_ob_gzhandler.txt <span data-processor="relativetime" data-value="2025-06-02T08:45:52+00:00" > 06/02/25, 08:45 </span>

    Had (probably the same problem:

    • version: 12.4.32
    • Composer installation
    • Development system
    • debug preset

    Steps to reproduce:

    1. In BE-User module create a new BE user name username “test”, fill out name and password
    2. Save
    3. Now exception is displayed:

    #1476107295 TYPO3\CMS\Core\Error\Exception
    PHP Warning: ob_start(): Output handler 'ob_gzhandler' cannot be used twice in /var/www/site-uol12/vendor/typo3/cms-backend/Classes/Middleware/OutputCompression.php line 55

    Cache was flushed previously.

    Stack trace:

  5. Hannes Bochmann commented <span data-processor="relativetime" data-value="2025-06-10T11:52:37+00:00" > 06/10/25, 11:52 </span>

    I ran into the same problem when changing the admin flag for BE users.

  6. Michaela Spandl commented <span data-processor="relativetime" data-value="2025-06-12T07:45:07+00:00" > 06/12/25, 07:45 </span>

    Same for us in TYPO3 13 and TYPO3 12 – since the last TYPO3 Update (12.4.33) if we change user permissions the password field appears – right after the password confirmation the errors is shown. When I go back to the user permission I can change them. Until next password confirmation. In the last versions I never was able to change user permissions, so now it is a little bit better but still the error first.

  7. Marcus Schwemer commented <span data-processor="relativetime" data-value="2025-07-23T11:05:29+00:00" > 07/23/25, 11:05 </span>

    We are hit by the same issue

    - changing own password (as admin user, normal user not tested)
    - switching a user to admin permissions

    Setup:

    • TYPO3 12.4.33
    • php 8.2.29
    • composer-based installation
  8. Simon Praetorius commented <span data-processor="relativetime" data-value="2025-08-13T08:11:06+00:00" > 08/13/25, 08:11 </span>

    I just experienced the same problem:

    TYPO3 12.4.35
    PHP 8.2

    Directly after confirmation of the sudo mode, the error occurs. If the sudo mode has already been confirmed, it works just fine.

  9. Stefan Froemken commented <span data-processor="relativetime" data-value="2025-08-25T08:06:28+00:00" > 08/25/25, 08:06 </span>

    Hello,

    we got the same issue. In that project we have disabled BE/compressionLevel (set to 0) now to solve that issue.

    Stefan

  10. Markus Klein commented and changed status New Accepted <span data-processor="relativetime" data-value="2025-09-09T13:09:08+00:00" > 09/09/25, 13:09 </span>

    I can confirm this issue with 12.4.36. Happens any time one changes a be_users regardless of the password field being touched.

  11. Dennis Grün commented <span data-processor="relativetime" data-value="2025-09-15T10:33:02+00:00" > 09/15/25, 10:33 </span>

    Same here, 12.4.36/37, two identical dev webs show the same exception.
    Additional info:
    After password confirmation and exception I can edit users just fine until “sudo mode” expires.

    Workaround for the time being: disable backend compression in TYPO3 settings.

  12. Gerrit Code Review pushed patch set 1 for main to change 91321 status Accepted Under Review <span data-processor="relativetime" data-value="2025-10-29T09:08:02+00:00" > 10/29/25, 09:08 </span>

  13. Oliver Hader commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-10-29T14:45:11+00:00" > 10/29/25, 14:45 </span>

    Applied in changeset commit:fbcfcae162ab80ab4e2f6f9fcce60aa135263fb0.