Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JoshuaPettus opened this issue Mar 13, 2024 · 5 comments
Closed
Labels
6 - Ready for release Fix or feature is ready and will be included in the next release Bug

Comments

@JoshuaPettus
Copy link

JoshuaPettus commented Mar 13, 2024

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
Copy link
Collaborator

paulijar commented Mar 13, 2024

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.

@paulijar paulijar added the Bug label Mar 13, 2024
@JoshuaPettus
Copy link
Author

JoshuaPettus commented Mar 14, 2024

It shows up at the error level.

paulijar added a commit that referenced this issue Mar 16, 2024
Don't try to set the response status again in case the file streaming has
already successfully started. This has probably never made sense but prior to
PHP 8.3 this was just silently ignored.

refs #1133
@paulijar
Copy link
Collaborator

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
Copy link
Author

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 paulijar added the 6 - Ready for release Fix or feature is ready and will be included in the next release label Mar 25, 2024
@paulijar
Copy link
Collaborator

The fix is now released in Music v1.11.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6 - Ready for release Fix or feature is ready and will be included in the next release Bug
Projects
None yet
Development

No branches or pull requests

2 participants