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

[Bug]: NC28 syntax error accessing /settings/admin/logging #1073

Closed
5 of 8 tasks
cvandesande opened this issue Dec 12, 2023 · 47 comments · Fixed by #1075
Closed
5 of 8 tasks

[Bug]: NC28 syntax error accessing /settings/admin/logging #1073

cvandesande opened this issue Dec 12, 2023 · 47 comments · Fixed by #1075
Assignees

Comments

@cvandesande
Copy link

cvandesande commented Dec 12, 2023

⚠️ This issue respects the following points: ⚠️

Bug description

After upgrading to NC28, I get 500 errors accessing the settings/admin/logging page
The logs indicate a syntax error
image

{
  "reqId": "BtIhSHTQ29Hjm39tZCnW",
  "level": 0,
  "time": "2023-12-12T16:15:40+00:00",
  "remoteAddr": "192.168.9.3",
  "user": "cvandesande",
  "app": "PHP",
  "method": "GET",
  "url": "/settings/admin/logging",
  "message": "Creation of dynamic property OCA\\FirstRunWizard\\Settings\\Personal::$urlGenerator is deprecated at /usr/share/nginx/html/nextcloud/apps/firstrunwizard/lib/Settings/Personal.php#40",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0",
  "version": "28.0.0.11",
  "data": {
    "app": "PHP"
  }
}
{
  "reqId": "BtIhSHTQ29Hjm39tZCnW",
  "level": 3,
  "time": "2023-12-12T16:15:40+00:00",
  "remoteAddr": "192.168.9.3",
  "user": "cvandesande",
  "app": "index",
  "method": "GET",
  "url": "/settings/admin/logging",
  "message": "Syntax error",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0",
  "version": "28.0.0.11",
  "exception": {
    "Exception": "JsonException",
    "Message": "Syntax error",
    "Code": 4,
    "Trace": [
      {
        "file": "/usr/share/nginx/html/nextcloud/apps/logreader/lib/Service/SettingsService.php",
        "line": 52,
        "function": "json_decode",
        "args": [
          "",
          null,
          512,
          4194304
        ]
      },
      {
        "file": "/usr/share/nginx/html/nextcloud/apps/logreader/lib/Service/SettingsService.php",
        "line": 69,
        "function": "getRelativeDates",
        "class": "OCA\\LogReader\\Service\\SettingsService",
        "type": "->",
        "args": []
      },
      {
        "file": "/usr/share/nginx/html/nextcloud/apps/logreader/lib/Settings/Admin.php",
        "line": 46,
        "function": "getAppSettings",
        "class": "OCA\\LogReader\\Service\\SettingsService",
        "type": "->",
        "args": []
      },
      {
        "file": "/usr/share/nginx/html/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php",
        "line": 129,
        "function": "getForm",
        "class": "OCA\\LogReader\\Settings\\Admin",
        "type": "->",
        "args": []
      },
      {
        "file": "/usr/share/nginx/html/nextcloud/apps/settings/lib/Controller/AdminSettingsController.php",
        "line": 86,
        "function": "formatSettings",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->",
        "args": [
          [
            [
              [
                "OCA\\LogReader\\Settings\\Admin"
              ]
            ]
          ]
        ]
      },
      {
        "file": "/usr/share/nginx/html/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php",
        "line": 149,
        "function": "getSettings",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->",
        "args": [
          "logging"
        ]
      },
      {
        "file": "/usr/share/nginx/html/nextcloud/apps/settings/lib/Controller/AdminSettingsController.php",
        "line": 71,
        "function": "getIndexResponse",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->",
        "args": [
          "admin",
          "logging"
        ]
      },
      {
        "file": "/usr/share/nginx/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "index",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->",
        "args": [
          "logging"
        ]
      },
      {
        "file": "/usr/share/nginx/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\Settings\\Controller\\AdminSettingsController"
          ],
          "index"
        ]
      },
      {
        "file": "/usr/share/nginx/html/nextcloud/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\Settings\\Controller\\AdminSettingsController"
          ],
          "index"
        ]
      },
      {
        "file": "/usr/share/nginx/html/nextcloud/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Settings\\Controller\\AdminSettingsController",
          "index",
          [
            "OC\\AppFramework\\DependencyInjection\\DIContainer"
          ],
          [
            "logging",
            "settings.AdminSettings.index"
          ]
        ]
      },
      {
        "file": "/usr/share/nginx/html/nextcloud/lib/base.php",
        "line": 1069,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/settings/admin/logging"
        ]
      },
      {
        "file": "/usr/share/nginx/html/nextcloud/index.php",
        "line": 39,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/usr/share/nginx/html/nextcloud/apps/logreader/lib/Service/SettingsService.php",
    "Line": 52,
    "message": "Syntax error",
    "exception": {},
    "CustomMessage": "Syntax error"
  }
}

Steps to reproduce

  1. Upgrade to NC28
  2. Add missing DB indexes (May not be required, but were my steps)
  3. Access logging page

Expected behavior

View logs

Installation method

Community Manual installation with Archive

Nextcloud Server version

28

Operating system

None

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

PostgreSQL

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?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{ig:list systemoud-7788dcd7bf-6rgmb:/usr/share/nginx/html/nextcloud$ php occ conf
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": ["***REMOVED SENSITIVE VALUE***"],
        "apps_paths": [
            {
                "path": "\/usr\/share\/nginx\/html\/nextcloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/usr\/share\/nginx\/html\/nextcloud\/custom-apps",
                "url": "\/custom-apps",
                "writable": true
            }
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "28.0.0.11",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR",
            "HTTP_X_FORWARDED",
            "HTTP_FORWARDED_FOR"
        ],
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "loglevel": 0,
        "maintenance": false,
        "enable_previews": false,
        "secret": "***REMOVED SENSITIVE VALUE***",
        "filesystem_check_changes": 1,
        "filelocking.enabled": "true",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "dbindex": 0
        },
        "trashbin_retention_obligation": "auto",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpsecure": "ssl",
        "theme": "",
        "app_install_overwrite": [
            "joplin"
        ],
        "encryption.legacy_format_support": false,
        "encryption.key_storage_migrated": false,
        "default_language": "en",
        "default_phone_region": "CA"
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - admin_audit: 1.18.0
  - bruteforcesettings: 2.8.0
  - calendar: 4.6.0
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - contacts: 5.5.0
  - contactsinteraction: 1.9.0
  - dav: 1.29.1
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - nextcloud_announcements: 1.17.0
  - notes: 4.9.0
  - notifications: 2.16.0
  - notify_push: 0.6.5
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - serverinfo: 1.18.0
  - settings: 1.10.0
  - sharebymail: 1.18.0
  - support: 1.11.0
  - survey_client: 1.16.0
  - suspicious_login: 6.0.0
  - systemtags: 1.18.0
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - twofactor_nextcloud_notification: 3.8.0
  - twofactor_totp: 10.0.0-beta.2
  - updatenotification: 1.18.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflowengine: 2.10.0
Disabled:
  - circles: 28.0.0-dev (installed 0.15.2)
  - dashboard: 7.8.0 (installed 7.0.0)
  - encryption: 2.16.0 (installed 2.5.0)
  - files_external: 1.20.0 (installed 1.4.1)
  - files_pdfviewer: 2.9.0 (installed 1.2.1)
  - files_rightclick: 0.15.1 (installed 1.4.0)
  - photos: 2.4.0 (installed 1.3.0)
  - user_ldap: 1.19.0

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@magnus-score
Copy link

Hi, try to restart php-fpm.service

@cvandesande
Copy link
Author

cvandesande commented Dec 12, 2023

Hi! The issue continues after restarting both nginx & php-fpm

@cvandesande
Copy link
Author

I just noticed my issue appears to be with the logreader app, and this is a duplicate of #1064

@stefanbenten
Copy link

I am running into the same issue after the upgrade to 28.0.0.11.
Restarted both PHP-FPM (8.2) and webserver and issue is still persistent. All other functionality looks to be ok.

@hunter-nl
Copy link

I am running into the same issue after the upgrade to 28.0.0.11

@masterwishx
Copy link

Have same issue , using linuxserver container 28.0.0-ls290
Logging and activity blank page :

image
image

@tzerber
Copy link

tzerber commented Dec 13, 2023

I can confirm i have the same issue, fresh install via docker , fpm image.

@peacepenguin
Copy link

exact same issue here. after updating nextcloud to v28, error 500, same syntax error in logs.

@joshtrichards
Copy link
Member

A workaround while #1075 is pending is the following:

./occ config:app:set logreader relativedates --value="false"

@MP715
Copy link

MP715 commented Dec 14, 2023

I’m also experiencing the same issue, but along with Logging, Activity is blank too. Also, there are missing settings under Notification. The workaround above didn't work for me.

@spitzlei
Copy link

I’m also experiencing the same issue, but along with Logging, Activity is blank too. Also, there are missing settings under Notification. The workaround above didn't work for me.

The empty activity and logging is related to the fpm/nginx setup. I had that too and its because *.mjs is delivered as octet/stream instead of application/javascipt (and being blocked by the browser then). I've added mjs to the mime.types in nginx folder and activity + and logging is showing up again.

@JappeHallunken
Copy link

I run my nextcloud on LIGHTTPD and I just get an error message in top right corner:
Could not load log entries

@cvandesande
Copy link
Author

cvandesande commented Dec 14, 2023

The empty activity and logging is related to the fpm/nginx setup. I had that too and its because *.mjs is delivered as octet/stream instead of application/javascipt (and being blocked by the browser then). I've added mjs to the mime.types in nginx folder and activity + and logging is showing up again.

Just to tack onto this very helpful comment, to fix the Activity stream by adding mjs to mime.types involved adding a new types block. (At least that was the case for me). My config below

http {
    include /etc/nginx/mime.types;
    types {
        application/javascript js mjs;
    }
    default_type  application/octet-stream;
...

@tzerber
Copy link

tzerber commented Dec 14, 2023

The empty activity and logging is related to the fpm/nginx setup. I had that too and its because *.mjs is delivered as octet/stream instead of application/javascipt (and being blocked by the browser then). I've added mjs to the mime.types in nginx folder and activity + and logging is showing up again.

Just to tack onto this very helpful comment, to fix the Activity stream by adding mjs to mime.types involved adding a new types block. (At least that was the case for me). My config below

http {
    include /etc/nginx/mime.types;
    types {
        application/javascript js mjs;
     }
    default_type  application/octet-stream;
...

Works like a charm, thank you!

@Xav-Pe
Copy link

Xav-Pe commented Dec 14, 2023

Same error after upgrade from 27 to 28 with the latest docker image (28.0.0)

Server configuration detail

Operating system: Linux 5.10.0-26-amd64 #1 SMP Debian 5.10.197-1 (2023-09-29) x86_64

Webserver: Apache/2.4.57 (Debian) (apache2handler)

Database: mysql 10.7.8

PHP version: 8.2.13

Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, session, PDO, pdo_sqlite, standard, posix, random, Reflection, Phar, SimpleXML, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, apcu, bcmath, exif, gd, gmp, imagick, intl, ldap, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, sodium, sysvsem, zip, Zend OPcache

Nextcloud version: 28.0.0 - 28.0.0.11

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

<details><summary>Signing status</summary>

[]
</details>

<details><summary>List of activated apps</summary>

Enabled:
 - activity: 2.20.0
 - circles: 28.0.0-dev
 - cloud_federation_api: 1.11.0
 - comments: 1.18.0
 - contactsinteraction: 1.9.0
 - dashboard: 7.8.0
 - dav: 1.29.1
 - federatedfilesharing: 1.18.0
 - federation: 1.18.0
 - files: 2.0.0
 - files_external: 1.20.0
 - files_pdfviewer: 2.9.0
 - files_reminders: 1.1.0
 - files_sharing: 1.20.0
 - files_trashbin: 1.18.0
 - files_versions: 1.21.0
 - firstrunwizard: 2.17.0
 - logreader: 2.13.0
 - lookup_server_connector: 1.16.0
 - nextcloud_announcements: 1.17.0
 - notes: 4.9.0
 - notifications: 2.16.0
 - oauth2: 1.16.3
 - password_policy: 1.18.0
 - photos: 2.4.0
 - privacy: 1.12.0
 - provisioning_api: 1.18.0
 - recommendations: 2.0.0
 - related_resources: 1.3.0
 - serverinfo: 1.18.0
 - settings: 1.10.0
 - sharebymail: 1.18.0
 - support: 1.11.0
 - survey_client: 1.16.0
 - systemtags: 1.18.0
 - text: 3.9.1
 - theming: 2.3.0
 - twofactor_backupcodes: 1.17.0
 - updatenotification: 1.18.0
 - user_status: 1.8.1
 - viewer: 2.2.0
 - weather_status: 1.8.0
 - workflowengine: 2.10.0
Disabled:
 - admin_audit
 - bruteforcesettings: 1.6.0
 - encryption
 - files_rightclick: 1.6.0
 - nextbackup: 21.1.0
 - suspicious_login
 - twofactor_totp
 - user_ldap


</details>

<details><summary>Configuration (config/config.php)</summary>

{
    "htaccess.RewriteBase": "\/",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "filelocking.enabled": true,
    "memcache.locking": "\\OC\\Memcache\\APCu",
    "apps_paths": [
        {
            "path": "\/var\/www\/html\/apps",
            "url": "\/apps",
            "writable": false
        },
        {
            "path": "\/var\/www\/html\/custom_apps",
            "url": "\/custom_apps",
            "writable": true
        }
    ],
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "nextcloud.mydomain"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "28.0.0.11",
    "overwrite.cli.url": "http:\/\/nextcloud.mydomain",
    "overwriteprotocol": "https",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "theme": "",
    "loglevel": 2,
    "default_phone_region": "FR",
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "maintenance": false,
    "config_is_read_only": false,
    "trashbin_retention_obligation": "15,30",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_sendmailmode": "smtp",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "587",
    "mail_smtpauth": 1,
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
}

</details>

Cron Configuration: Array
(
[backgroundjobs_mode] => cron
[lastcron] => 1702564501
)

External storages: yes

<details><summary>External storage configuration</summary>

No mounts configured

</details>

Encryption: no

User-backends:

OC\User\Database

Browser: Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0

@susnux
Copy link
Contributor

susnux commented Dec 14, 2023

The empty activity and logging is related to the fpm/nginx setup. I had that too and its because *.mjs is delivered as octet/stream instead of application/javascipt (and being blocked by the browser then). I've added mjs to the mime.types in nginx folder and activity + and logging is showing up again.

This is part of the upgrade guide since Nextcloud 27:
1: https://docs.nextcloud.com/server/27/admin_manual/installation/nginx.html
2: https://docs.nextcloud.com/server/27/admin_manual/release_notes/upgrade_to_27.html?highlight=mjs#web-server-configuration

@susnux
Copy link
Contributor

susnux commented Dec 14, 2023

A fix will be released with Nextcloud 28.0.1, until then use the workaround from #1073 (comment)

@masterwishx
Copy link

A workaround while #1075 is pending is the following:

./occ config:app:set logreader relativedates --value="false"

not worked for me

should we set back to "true" if this not helps and wait for update ?

./occ config:app:set logreader relativedates --value="true"

@cvandesande
Copy link
Author

Thank you @tzerber I was missing those config blocks in NGINX. The logs now work in Chrome, but I still have the same error in Firefox :( (Even after clearing browser cache, and testing from a private window)

if you use the Firefox with the "uBlock Origin" Addon, this was blocking a part at my end from the nextcloud logging

Same here thanks @AmatorPhasma that resolves my final issue!

@AmatorPhasma
Copy link

AmatorPhasma commented Dec 14, 2023

@MP715

The empty activity and logging is related to the fpm/nginx setup. I had that too and its because *.mjs is delivered as octet/stream instead of application/javascipt (and being blocked by the browser then). I've added mjs to the mime.types in nginx folder and activity + and logging is showing up again.

Just to tack onto this very helpful comment, to fix the Activity stream by adding mjs to mime.types involved adding a new types block. (At least that was the case for me). My config below

http {
    include /etc/nginx/mime.types;
    types {
        application/javascript js mjs;
    }
    default_type  application/octet-stream;
...

Where do I add this snippet? My nextcloud config?

Depends on your config/style

You can put it in the /etc/nginx/nginx.conf by default this should the location of this tow lines:

http {
    ...
    include /etc/nginx/mime.types;
    default_type  application/octet-stream;
    ...
}

or you can add this to the config file in /etc/nginx/conf.d/nexctloud.conf:

server {
    server_name cloud.xxx.xxx;
    listen 8080;
    ...
    ...
    types {
        text/javascript js mjs;
    }
    ...
    ...
    location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ {
        try_files $uri /index.php$request_uri;
        add_header Cache-Control "public, max-age=15778463, $asset_immutable";
        access_log off;     # Optional: Don't log access to assets

        location ~ \.wasm$ {
            default_type application/wasm;
        }
    }
    ...
    ...
}

@tzerber
Copy link

tzerber commented Dec 14, 2023

Just FYI: NC docs as well as https://www.ietf.org/rfc/rfc9239.pdf says it should be text/javascript not application/javascript, but that also creates other nginx problems. Working on it at the moment, but i suspect it also causes issues with some browsers.

@gstrauss
Copy link

https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
lists .js and .mjs as text/javascript, with a link to RFC9239
Specifically, see https://www.rfc-editor.org/rfc/rfc9239#name-iana-considerations

Separately, lighttpd 1.4.71 and later provide a default set of mime types (include .js and .mjs) if mimetype.assign is not configured in lighttpd.conf, though most distro do provide mimetype.assign based off the system /etc/mime.types.

One more data point: on a modern Fedora system, .js and .mjs in /etc/mime.types are listed as text/javascript.

@tzerber
Copy link

tzerber commented Dec 17, 2023

https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types lists .js and .mjs as text/javascript, with a link to RFC9239 Specifically, see https://www.rfc-editor.org/rfc/rfc9239#name-iana-considerations

Separately, lighttpd 1.4.71 and later provide a default set of mime types (include .js and .mjs) if mimetype.assign is not configured in lighttpd.conf, though most distro do provide mimetype.assign based off the system /etc/mime.types.

One more data point: on a modern Fedora system, .js and .mjs in /etc/mime.types are listed as text/javascript.

Just FYI, i don't think this issue is the place to discuss it ;)
Read this nginx mailing archive and around it for more info

@tmknight
Copy link

tmknight commented Dec 18, 2023

A fix will be released with Nextcloud 28.0.1, until then use the workaround from #1073 (comment)

In my implementation (docker fpm) it was down to missing mjs config in nginx (types and location) per #1073 (comment) by @AmatorPhasma and nothing to do with logreader as is being suggested.

See https://docs.nextcloud.com/server/27/admin_manual/installation/nginx.html#nextcloud-in-the-webroot-of-nginx and compare to what you may have (or haven't) in your .conf.

@vindic
Copy link

vindic commented Dec 20, 2023

Same issue on two servers with apache2 configuration without using PHP-FPM.

One on Ubuntu 22.04 // PHP 8.2 // Apache 2.4.52

One on Ubuntu 20.04 // PHP 8.2 // Apache 2.4.41

#1073 (comment) fix the internal error and show some logs.

@VinceMasuka
Copy link

Neither the above suggested modifications nor the update to Nextcloud v28.0.1 helped on latest Debian with PHP v8.2 and latest nginx (tested with latest Firefox and latest Chrome).

Some other suggestions? Anyone?

@susnux
Copy link
Contributor

susnux commented Dec 21, 2023

Neither the above suggested modifications nor the update to Nextcloud v28.0.1 helped on latest Debian with PHP v8.2 and latest nginx (tested with latest Firefox and latest Chrome).

What issue do you face?

This issue here is used for quite some off topic, because here are three different issues that are mixed up:

  1. The internal server error -> This is fixed for 28.0.1 and was caused by the app setting (fix see above)
  2. JS files not loaded due to server misconfiguration -> Caused by your NGinx not configured to serve .mjs as application/javascript or text/javascript.
  3. No log entires shown (but might appear after some time when polling is enabled) -> Your Adblocker behaves faulty, disable it for your Nextcloud instance and report it to your Adblocker.

This issue here is about (1) meaning you see only the "Internal server error" notice

For (2) you see a Nextcloud page but the app is not loaded there is a empty app page.

For (3) you see the Logreader UI but no log entries.

@palto42
Copy link

palto42 commented Dec 22, 2023

With the workaround suggested in #1073 the error disappeared, but the logging page is now empty. Also the update to 28.0.1 didn't change anything, logs page is still completely blank.
I tried to toggle the value of occ config:app:set logreader relativedates betwee true and false, but no difference.
The admin overview page still complains about some errors in the logs...

@masterwishx
Copy link

With the workaround suggested in #1073 the error disappeared, but the logging page is now empty. Also the update to 28.0.1 didn't change anything, logs page is still completely blank. I tried to toggle the value of occ config:app:set logreader relativedates betwee true and false, but no difference. The admin overview page still complains about some errors in the logs...

Please check #1073 (comment)

@palto42
Copy link

palto42 commented Dec 22, 2023

Please check #1073 (comment)

Thanks, adding the mime-type mjs fixed it.

@VinceMasuka
Copy link

What issue do you face?

This issue here is used for quite some off topic, because here are three different issues that are mixed up:

1. The internal server error -> This is fixed for 28.0.1 and was caused by the app setting (fix see above)

2. JS files not loaded due to server misconfiguration -> Caused by your NGinx not configured to serve .mjs as application/javascript or text/javascript.

3. No log entires shown (but might appear after some time when polling is enabled) -> Your Adblocker behaves faulty, disable it for your Nextcloud instance and report it to your Adblocker.

This issue here is about (1) meaning you see only the "Internal server error" notice

For (2) you see a Nextcloud page but the app is not loaded there is a empty app page.

For (3) you see the Logreader UI but no log entries.

Ah yes... obviously. Sorry for that:
It's the blank logging page I'm facing (as seen in the screenshot of masterwishx above).

Besides: My config/stlye lays within /etc/nginx/nginx.conf. The mentioned two lines are already in there.

@cvandesande
Copy link
Author

cvandesande commented Dec 22, 2023

It's the blank logging page I'm facing (as seen in the screenshot of masterwishx above).

For those of us that faced that issue after solving the 500 errors, the cause of no logs was an ad blocker. For me it was ublock origin, but it stands to reason other ad blockers could have the same issue

@VinceMasuka
Copy link

It's the blank logging page I'm facing (as seen in the screenshot of masterwishx above).

For those of us that faced that issue after solving the 500 errors, the cause of no logs was an ad blocker. For me it was ublock origin, but it stands to reason other ad blockers could have the same issue

Thanks for the hint. But actually I read that, too. I'm using no browser ad blocker add-in at all, I'm afraid (I have a PiHole in place what makes such a plugin unneccessary).

@cvandesande
Copy link
Author

I nearly suggested a pihole might be the cause, but I thought that was being presumptuous. It would be helpful to know if a pihole causes this issue as well since you have an opportunity to test

@VinceMasuka
Copy link

VinceMasuka commented Dec 22, 2023

I just deactivated PiHole in order to be sure; It does have no effect on the logging issue if I do.

@susnux
Copy link
Contributor

susnux commented Dec 23, 2023

@VinceMasuka can you check the browser console if there are any errors and check also the network tab

@nursoda
Copy link

nursoda commented Dec 24, 2023

I tested on a native minimal NC 28.0.1 (which does include #1079) installation without any network security/privacy appliances but the issue (described in detail in nextcloud/server#42370 (comment)) is still present for me. In another NC many-apps-installed-instance on the same server, /settings/admin/logging immediately loads correctly – 🤔

@saschabrockel
Copy link

saschabrockel commented Jan 7, 2024

Also not fixed for me. I have this for so many apps / plugins. For example activity-api.mjs:1, activity-sidebar.mjs:1 files_zip-main.mjs:1 and also logreader-main.mjs:1.

The page for logs is just blank.

@bai-ivan
Copy link

bai-ivan commented Jan 8, 2024

Also not fixed for me. I have this for so many apps / plugins. For example activity-api.mjs:1, activity-sidebar.mjs:1 files_zip-main.mjs:1 and also logreader-main.mjs:1.

The page for logs is just blank.

Your webserver is not serving the mjs file extension properly.
I suspect you're using nginx and your config is a bit outdated. Please re-check it with the official documentation of Nextcloud https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html

If not using Nginx check if your webserver is serving the mjs file extension with text/javascript or in worst case - application/javascript mime type.

@saschabrockel
Copy link

@bai-ivan you are right. It's an old example issue. They have changed the things I have set up. I guess there will be a bunch of people having this issue and I can help now. Just update your nginx.conf to this updated example of Nextcloud:

https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.