NC 12.0.3.3 - Page <Domain>/index.php/apps/activity/ returns a ASCII page with statuscode 304

On a fresh Nextcloud installation (version 12.0.3.3) I get issues with the activity page.
When I login as admin account and press first on the activity tab and secondly on any other link on the web interface, the browser shows the following error text(see below) instead of real page. This behavior is happing every third time/try.

When I reload the side mostly the text message disappears, and the page load normally.
I’m running two nextcloud instances on the same server. They running behind an apache reverse proxy, which takes care of the SSL offloading as well.

When I check the URLs which are loaded during opening of the xxxxs///index.php apps/activity/ page I noticed these two URLs get load as well:

  • //ocs/v2.php/apps/activity/api/v2/activity/all?format=json&previews=true&since=0
    statuscode 200 - OK

  • ocs/v2.php/apps/activity/api/v2/activity/all?format=json&previews=true&since=6
    statuscode 304 - Not Modified

For me it looks like, that after a page is loaded, with the statuscode 304, the next pressed link on Nextcloud will fail with this text message:

{"ocs":{"meta":{"status":"failure","statuscode":304,"message":null},"data":[]}}HTTP/1.1 200 OKDate: Mon, 13 Nov 2017 10:03:25 GMT
Server: Apache/2.4.6 (CentOS) PHP/7.1.10
X-Powered-By: PHP/7.1.10
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Content-Security-Policy: default-src 'none';base-uri 'none';manifest-src 'self';script-src 'nonce-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxxxxx=' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self';connect-src 'self';media-src 'self'
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Robots-Tag: none
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Content-Length: 21053
Keep-Alive: timeout=5, max=94
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8

<!DOCTYPE html>
<html class="ng-csp" data-placeholder-focus="false" lang="de" >
	<head data-user="admin" data-user-displayname="admin" data-requesttoken="u4q7/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxx=">
		<meta charset="utf-8">
		<title>
			AktivitÃĪt - Nextcloud		</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="referrer" content="never">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
		<meta name="apple-itunes-app" content="app-id=1125420102">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-title" content="AktivitÃĪt">
		<meta name="mobile-web-app-capable" content="yes">
		<meta name="theme-color" content="#0082c9">
		<link rel="icon" href="/core/img/favicon.ico">
		<link rel="apple-touch-icon-precomposed" href="/core/img/favicon-touch.png">
		<link rel="mask-icon" sizes="any" href="/core/img/favicon-mask.svg" color="#0082c9">
		<link rel="manifest" href="/core/img/manifest.json">
					<script nonce="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx=" type="text/javascript">
				var oc_debug=false;
var oc_isadmin=true;
var oc_dataURL=false;
var oc_webroot="";
var oc_appswebroots={"activity":"/apps/activity","comments":"/apps/comments","dav":"/apps/dav","federatedfilesharing":
"/apps/federatedfilesharing","federation":"/apps/federation","files":"/apps/files","files_pdfviewer":"/apps/files_pdfviewer",
"files_sharing":"/apps/files_sharing","files_texteditor":"/apps/files_texteditor","files_trashbin":"/apps/files_trashbin",
"files_versions":"/apps/files_versions","files_videoplayer":"/apps/files_videoplayer","firstrunwizard":"/apps/firstrunwizard",
"gallery":"/apps/gallery","logreader":"/apps/logreader","lookup_server_connector":"/apps/lookup_server_connector",
"nextcloud_announcements":"/apps/nextcloud_announcements","notifications":"/apps/notifications","oauth2":"/apps/oauth2",
"password_policy":"/apps/password_policy","provisioning_api":"/apps/provisioning_api","serverinfo":"/apps/serverinfo",
"sharebymail":"/apps/sharebymail","survey_client":"/apps/survey_client","systemtags":"/apps/systemtags","theming":"/apps/theming",
"twofactor_backupcodes":"/apps/twofactor_backupcodes","updatenotification":"/apps/updatenotification","workflowengine":"/apps/workflowengine"};
var datepickerFormatDate="dd.MM.yy";

...

This is the configuration:

[root@xxxxxxxxxxxxx cloud2]# sudo  -u apache php occ config:list
{
    "system": {
        "updatechecker": false,
        "instanceid": "XXXXXupfqnml",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "127.0.0.1",
            "doc.domain.ch"
        ],
        "trusted_proxies": [
            "192.169.10.170",
            "192.169.95.196"
        ],
        "overwritehost": "doc.domain.ch",
        "overwriteprotocol": "https",
        "overwritewebroot": "\/",
        "overwritecondaddr": "^192\\.169\\.10\\.170$",
        "overwrite.cli.url": "xxxxxx:\/\/doc.domain.ch",
        "proxy": "localhost:3128",
        "datadirectory": "\/data\/cloud2",
        "dbtype": "mysql",
        "version": "12.0.3.3",
        "dbname": "domain_nextcloud2_prod",
        "dbhost": "127.0.0.1",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "europe\/zurich",
        "log_type": "file",
        "loglevel": 0,
        "debug": true,
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_smtpport": "25",
        "mail_smtphost": "localhost",
        "mail_from_address": "admin-prod",
        "mail_domain": "fxxxx.ch",
        "log_rotate_size": 104857600,
        "maintenance": false,
        "theme": "",
        "mail_smtpauthtype": "LOGIN",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "localhost",
            "port": 6379
        }
    },

Hi,

I got the same issue with a virtual KVM machine under openSUSE Leap 42.3 … it happens sometimes when I stress a few the app … I try to disable cache and nothing helping …

Hope someone can help us :slight_smile:

After i tested it with NC 12.0.0 & 11.0.5 and without SSL (just plain html) without any success i found a workaround by forcing “HTTP/1.0” on the Apache reverse proxy with:

SetEnv force-proxy-request-1.0 1

With this I don’t get anymore any 304 status messages on the client side. It look like there is an HTTP-Pipelining issue, when the HTTP/1.1 protocol is used?

With this my Reverse Proxy configuration looks like:

ServerAdmin     support@domain.ch
DocumentRoot    /data/apache/xxxx
Include conf/virtualhosts/common-logging-formats.conf
ErrorLog        "| /usr/sbin/rotatelogs /opt/apache/xxxx/logs/domain.error_log.%Y-%m-%d 86400 +120"
CustomLog     "| /usr/sbin/rotatelogs /opt/apache/xxxx/logs/domain.access_log.%Y-%m-%d 86400 +120" extended
SSLOptions +StdEnvVars

<Directory "/data/apache/xxxx">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
    DirectoryIndex 400.html
</Directory>
SSLEngine on
SSLCertificateFile /opt/apache/xxxx/cert/domain.ch.crt
SSLCertificateKeyFile /opt/apache/xxxx/cert/domain.ch.key
SSLCertificateChainFile /opt/apache/xxxx/cert/intermediate-xxxxx-chain.crt
SSLHonorCipherOrder on
SSLOptions +StdEnvVars +ExportCertData
SSLCipherSuite HIGH:MEDIUM:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4
SSLProtocol All -SSLv2 -SSLv3
Header add Strict-Transport-Security "max-age=15768000"
RewriteEngine Off
ProxyRequests Off
ProxyTimeout 30
<Proxy *>
   Require all granted
</Proxy> 
Include conf/proxy_html.conf

<Location />
    ProxyPreserveHost On
    SetEnv force-proxy-request-1.0 1
    ProxyPass        http://nextcloudXXX.hsz1.oe.ch:8080/cloud2/ retry=0
    ProxyPassReverse http://nextcloudXXX.hsz1.oe.ch:8080/cloud2/
    ProxyHTMLEnable On
    ProxyHTMLExtended On
    ProxyHTMLURLMap /cloud2/ /
</Location>
1 Like

@morokeni thank you so much to share this fix ! That’s works also on my reverse proxy (Apache)