owncloud / music

:notes: Music app for ownCloud
GNU Affero General Public License v3.0
570 stars 199 forks source link

Benign error in nc log - Cannot set response code - headers already sent #1133

Closed JoshuaPettus closed 7 months ago

JoshuaPettus commented 8 months ago

Hi I have: Music 1.10.0 nextcloud 28.0.3 php 8.3.3 pgsql 15.6 nginx 1.25.4

This error keeps repeatedly flooding the nextcloud log. It doesn't seem to effect anything but I was wondering if you might have any idea:

  http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/music/lib/Http/FileStreamResponse.php:99) at /var/www/nextcloud/lib/private/AppFramework/Http/Output.php#77

paulijar commented 8 months ago

Thanks for the report. What is the logging level where this is shown? I haven't seen this on NC 28.0.2 but maybe there is some new check in 28.0.3. It's possible that I'm using the NC ICallbackResponse API a bit incorrectly in a way which doesn't cause any actual problem.

JoshuaPettus commented 8 months ago

It shows up at the error level.

paulijar commented 8 months ago

Now I managed to reproduce and fix this. The key was to use PHP 8.3, this error didn't appear with PHP 8.2 regardless of the cloud version.

JoshuaPettus commented 8 months ago

Thank you! I just tested the fix on my install and its working fine (Isn't PHP a neat thing?). Guess just to go show how much I use the app that it was triggered by every new song I listened to :)

paulijar commented 7 months ago

The fix is now released in Music v1.11.0.