Closed donniewr closed 3 weeks ago
I have the same problem.
Since you failed to fill out the issue template, this report will likely be closed.
Also, it's critical you include the entire raw log message. Though from the looks of the snippet you provided, I suspect you have other errors before this in your log.
Wild guess: when switching PHP versions at least one required PHP extension is missing. Your Nextcloud log will have further hints.
Since you failed to fill out the issue template, this report will likely be closed.
Also, it's critical you include the entire raw log message. Though from the looks of the snippet you provided, I suspect you have other errors before this in your log.
Wild guess: when switching PHP versions at least one required PHP extension is missing. Your Nextcloud log will have further hints.
I edited the post to include the full log message. There are no other errors prior to this one, and no message in the setup warnings about missing PHP extensions either.
This line of code only gets executed after another error has occurred and been logged. Again, you didn't fill out the template. It could be as simple as your loglevel
being set higher than the default, causing your logs to be missing the details to help troubleshoot your situation.
Please fill out the missing elements of the form. We ask for that information to be able to help you.
This line of code only gets executed after another error has occurred and been logged. Again, you didn't fill out the template. It could be as simple as your
loglevel
being set higher than the default, causing your logs to be missing the details to help troubleshoot your situation.Please fill out the missing elements of the form. We ask for that information to be able to help you.
I changed my logs from warnings to debug, and it seems I'm getting this error before the 'cannot set response code' message.
{"reqId":"7VxNUfIYmb5sOaIeab","level":0,"time":"2024-06-13T16:01:07+00:00","remoteAddr":"0.0.0.0","user":"--","app":"no app in context","method":"GET","url":"/s/KCgNDFe77y4KnDD/download?path=&files=","message":"Exception thrown: OCP\\Files\\ConnectionLostException","userAgent":"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36","version":"29.0.2.2","exception":{"Exception":"OCP\\Files\\ConnectionLostException","Message":"Connection lost. Status: 1","Code":0,"Trace":[{"file":"/home/domain-cloud/htdocs/cloud.domain.com/lib/private/Files/View.php","line":461,"function":"checkConnectionStatus","class":"OC\\Files\\View","type":"->"},{"file":"/home/domain-cloud/htdocs/cloud.domain.com/lib/private/legacy/OC_Files.php","line":362,"function":"readfilePart","class":"OC\\Files\\View","type":"->"},{"file":"/home/domain-cloud/htdocs/cloud.domain.com/lib/private/legacy/OC_Files.php","line":123,"function":"getSingleFile","class":"OC_Files","type":"::"},{"file":"/home/domain-cloud/htdocs/cloud.domain.com/apps/files_sharing/lib/Controller/ShareController.php","line":492,"function":"get","class":"OC_Files","type":"::"},{"file":"/home/domain-cloud/htdocs/cloud.domain.com/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"downloadShare","class":"OCA\\Files_Sharing\\Controller\\ShareController","type":"->"},{"file":"/home/domain-cloud/htdocs/cloud.domain.com/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/domain-cloud/htdocs/cloud.domain.com/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/domain-cloud/htdocs/cloud.domain.com/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home/domain-cloud/htdocs/cloud.domain.com/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/domain-cloud/htdocs/cloud.domain.com/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/domain-cloud/htdocs/cloud.domain.com/lib/private/Files/View.php","Line":474,"CustomMessage":"Exception thrown: OCP\\Files\\ConnectionLostException"},"id":"666b19c7609"
The error only occurs with video files over 5MB. I've tested this on a different server and a fresh NC install.
I'm not sure what else I can fill in on the form, the error is easy to reproduce.
We are facing the same issue in our Nextcloud instance.
Nextcloud: 29.0.2.2 OS: Ubuntu 24.04 PHP: 8.3.6
I have the same issue, I have hundreds of errors of this type in my log. Nextcloud: 29.0.2.2 OS: Debian Linux 6.1.0 PHP: 8.3.8
I have the same issue. Also hundreds of error messages in the log. Nextcloud: 29.03 OS: Debian GNU/Linux 12 (bookworm) PHP: 8.3.8
Cc @sorbaugh
Same issue here Nextcloud 28.0.3 using the linuxserver.io docker image
Same issue here, using Nextcloud 29.0.3.4 with PHP 8.3.8 with Nginx on Linux (NixOS 24 .05).
Well, I have the same issue:
[PHP] Fehler: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/lib/private/Files/View.php:459) at /var/www/nextcloud/lib/private/legacy/OC_Template.php#257
GET /s/WBYapggWeTaJ688/download?path=&files=
von 123.123.123.123 von -- um 29.07.2024, 17:44:41
PHP 8.3.6 and Nextcloud 29.0.4 on Ubuntu 24.04
Same issue:
http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/lib/private/Files/View.php:406) at /var/www/nextcloud/lib/private/legacy/OC_Template.php#257
Nextcloud 29.0.4 Ubuntu 22.04 PHP 8.3.10
Same issue with older NC 28.0.9.
Hi, same here with NC 29.0.5 after php (php-fpm and apache) update from 8.1 to 8.3 and still there after update to NC 29.0.6
I have the same issue with NC 29.0.6, PHP 8.3.8, FreeBSD 13.1, Caddy 2.7.6
Same problem here: NC 29.0.4, PHP 8.3, Ubuntu 24.04, Apache2
Similarly to OC seems to be occuring while playing video from share: [PHP] Fehler: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/lib/private/Files/View.php:459) at /var/www/nextcloud/lib/private/legacy/OC_Template.php#257 GET /index.php/s/XXX/download?path=&files=XXX.MP4
This error is coming up when PHP's connection_status()
returns CONNECTION_ABORTED
:
This code was added via #40233. It's in most our recent majors: >=25.0.11, >=26.0.6, >=27.1.0, >=28.0.0 so it's been in the wild for awhile w/o reports until this June. The main difference is the increasing prevalence of PHP 8.3.
Are any of you experiencing this not using php-fpm?
So, this is specific to Video playing then, right? The point of detection of closed connection was to avoid to keep reading the video file when the user actually closed the page already. It also helped tremendously with performance when moving the cursor in the video because the browser close and opens lots of connections when doing that.
Can you be more clear about the error, what do you see on the screen, how does the page behave? Or is the only problem a line in the logs?
I can reproduce with stable29 and PHP 8.3, using a long video and moving the cursor in it. But it’s only an error in the log, it work fine apart from that. Gonna look into it. It might be fixed already in master because the public link page was redone.
Ok, so the issue is this:
I’m not sure what’s the clean way to fix it, it’s useless to catch the error and try to display it, the connection is already gone. Maybe simply in printErrorPage check connection_status and do not bother if it’s closed?
The following patch should do it: https://github.com/nextcloud/server/pull/47971.diff
⚠️ This issue respects the following points: ⚠️
Bug description
Hello, I'm encountering an error with shared links when using PHP 8.3. There are no errors when using PHP 8.2
Steps to reproduce
Expected behavior
No error.
Installation method
Manual install with zip file.
Nextcloud Server version
29
Operating system
Ubuntu 24.04
PHP engine version
PHP 8.3
Web server
Nginx
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Upgraded to a MAJOR version (ex. 22 to 23)
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
List of activated Apps
Files
Nextcloud Signing status
Disabled
Nextcloud Logs
No response
Additional info
Cloudpanel.io control panel.
The error only seems to trigger with video files larger than 5MB.