JsonException Syntax error - cache issue on ocm discovery

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.9
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 12
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.65
  • PHP version (e.g, 8.3):
    • 8.2.29
  • Is this the first time you’ve seen this error? (Yes / No):
    • No
  • When did this problem seem to first start?
    • Not sure
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Archive
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

In my Nextcloud logs I’m seeing errors of JsonException Syntax error - cache issue on ocm discovery

Steps to replicate it (hint: details matter!):

  1. I’m not sure what is causing it to occur

Log entries

{
  "reqId": "vaeoi2l71jWczjQq3zA0",
  "level": 2,
  "time": "2025-10-23T17:02:06+00:00",
  "remoteAddr": "REDACTED",
  "user": "REDACTED",
  "app": "no app in context",
  "method": "PROPFIND",
  "url": "/remote.php/dav/files/REDACTED/",
  "message": "cache issue on ocm discovery",
  "userAgent": "Mozilla/5.0 (Windows) mirall/3.17.3 (build 20251009) (Nextcloud, windows-10.0.26100 ClientArchitecture: x86_64 OsArchitecture: x86_64)",
  "version": "31.0.9.1",
  "clientReqId": "d8899297-1f18-4f6f-9663-1da0472de1b6",
  "exception": {
    "Exception": "JsonException",
    "Message": "Syntax error",
    "Code": 4,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/private/OCM/OCMDiscoveryService.php",
        "line": 86,
        "function": "json_decode"
      },
      {
        "file": "/var/www/nextcloud/apps/files_sharing/lib/External/Storage.php",
        "line": 66,
        "function": "discover",
        "class": "OC\\OCM\\OCMDiscoveryService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Mount/MountPoint.php",
        "line": 145,
        "function": "__construct",
        "class": "OCA\\Files_Sharing\\External\\Storage",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Mount/MountPoint.php",
        "line": 170,
        "function": "createStorage",
        "class": "OC\\Files\\Mount\\MountPoint",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Mount/MountPoint.php",
        "line": 271,
        "function": "getStorage",
        "class": "OC\\Files\\Mount\\MountPoint",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Config/UserMountCache.php",
        "line": 65,
        "function": "getStorageRootId",
        "class": "OC\\Files\\Mount\\MountPoint",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/SetupManager.php",
        "line": 606,
        "function": "registerMounts",
        "class": "OC\\Files\\Config\\UserMountCache",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/SetupManager.php",
        "line": 295,
        "function": "registerMounts",
        "class": "OC\\Files\\SetupManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/SetupManager.php",
        "line": 211,
        "function": "afterUserFullySetup",
        "class": "OC\\Files\\SetupManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/SetupManager.php",
        "line": 390,
        "function": "setupForUser",
        "class": "OC\\Files\\SetupManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Mount/Manager.php",
        "line": 75,
        "function": "setupForPath",
        "class": "OC\\Files\\SetupManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/View.php",
        "line": 1419,
        "function": "find",
        "class": "OC\\Files\\Mount\\Manager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/Root.php",
        "line": 178,
        "function": "getFileInfo",
        "class": "OC\\Files\\View",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/LazyUserFolder.php",
        "line": 32,
        "function": "get",
        "class": "OC\\Files\\Node\\Root",
        "type": "->"
      },
      {
        "function": "OC\\Files\\Node\\{closure}",
        "class": "OC\\Files\\Node\\LazyUserFolder",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php",
        "line": 50,
        "function": "call_user_func"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php",
        "line": 64,
        "function": "getRealFolder",
        "class": "OC\\Files\\Node\\LazyFolder",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php",
        "line": 562,
        "function": "__call",
        "class": "OC\\Files\\Node\\LazyFolder",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php",
        "line": 446,
        "function": "getMetadata",
        "class": "OC\\Files\\Node\\LazyFolder",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "handleGetProperties",
        "class": "OCA\\DAV\\Connector\\Sabre\\FilesPlugin",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1052,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 984,
        "function": "getPropertiesByNode",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1664,
        "function": "getPropertiesIteratorForPath",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1649,
        "function": "writeMultiStatus",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 346,
        "function": "generateMultiStatus",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "httpPropFind",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 472,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php",
        "line": 49,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Server.php",
        "line": 401,
        "function": "start",
        "class": "OCA\\DAV\\Connector\\Sabre\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",
        "line": 21,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/remote.php",
        "line": 145,
        "args": [
          "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/OCM/OCMDiscoveryService.php",
    "Line": 86,
    "message": "cache issue on ocm discovery",
    "exception": [],
    "CustomMessage": "cache issue on ocm discovery"
  },
  "id": "68fa64157a194"

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

{"reqId":"vaeoi2l71jWczjQq3zA0","level":2,"time":"2025-10-23T17:02:06+00:00","remoteAddr":"192.168.127.117","user":"REDACTED","app":"no app in context","method":"PROPFIND","url":"/remote.php/dav/files/REDACTED/","message":"cache issue on ocm discovery","userAgent":"Mozilla/5.0 (Windows) mirall/3.17.3 (build 20251009) (Nextcloud, windows-10.0.26100 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"31.0.9.1","clientReqId":"d8899297-1f18-4f6f-9663-1da0472de1b6","exception":{"Exception":"JsonException","Message":"Syntax error","Code":4,"Trace":[{"file":"/var/www/nextcloud/lib/private/OCM/OCMDiscoveryService.php","line":86,"function":"json_decode"},{"file":"/var/www/nextcloud/apps/files_sharing/lib/External/Storage.php","line":66,"function":"discover","class":"OC\\OCM\\OCMDiscoveryService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Mount/MountPoint.php","line":145,"function":"__construct","class":"OCA\\Files_Sharing\\External\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Mount/MountPoint.php","line":170,"function":"createStorage","class":"OC\\Files\\Mount\\MountPoint","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Mount/MountPoint.php","line":271,"function":"getStorage","class":"OC\\Files\\Mount\\MountPoint","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Config/UserMountCache.php","line":65,"function":"getStorageRootId","class":"OC\\Files\\Mount\\MountPoint","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/SetupManager.php","line":606,"function":"registerMounts","class":"OC\\Files\\Config\\UserMountCache","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/SetupManager.php","line":295,"function":"registerMounts","class":"OC\\Files\\SetupManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/SetupManager.php","line":211,"function":"afterUserFullySetup","class":"OC\\Files\\SetupManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/SetupManager.php","line":390,"function":"setupForUser","class":"OC\\Files\\SetupManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Mount/Manager.php","line":75,"function":"setupForPath","class":"OC\\Files\\SetupManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1419,"function":"find","class":"OC\\Files\\Mount\\Manager","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/Root.php","line":178,"function":"getFileInfo","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/LazyUserFolder.php","line":32,"function":"get","class":"OC\\Files\\Node\\Root","type":"->"},{"function":"OC\\Files\\Node\\{closure}","class":"OC\\Files\\Node\\LazyUserFolder","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php","line":50,"function":"call_user_func"},{"file":"/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php","line":64,"function":"getRealFolder","class":"OC\\Files\\Node\\LazyFolder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php","line":562,"function":"__call","class":"OC\\Files\\Node\\LazyFolder","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php","line":446,"function":"getMetadata","class":"OC\\Files\\Node\\LazyFolder","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"handleGetProperties","class":"OCA\\DAV\\Connector\\Sabre\\FilesPlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1052,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":984,"function":"getPropertiesByNode","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1664,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1649,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php","line":49,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":401,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":21,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":145,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/OCM/OCMDiscoveryService.php","Line":86,"message":"cache issue on ocm discovery","exception":[],"CustomMessage":"cache issue on ocm discovery"},"id":"68fa64157a194"}

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

{                       
    "system": {       
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cstcloud.cowboystatetrucking.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.9.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "overwrite.cli.url": "http:\/\/cstcloud.cowboystatetrucking.com",
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "skeletondirectory": "\/var\/www\/skeleton",
        "maintenance": false,
        "theme": "",
        "loglevel": 1,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtpauth": true,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "data-fingerprint": "b4a0fbf34f2b5ce4f1a1418d6b352529",
        "default_phone_region": "US",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "maintenance_window_start": 1,
        "app_install_overwrite": [],
        "mail_smtpsecure": "ssl",
        "defaultapp": ""
    }
}

Apps

The output of occ app:list (if possible).

Enabled:                                                                                                                                                                                                           
  - activity: 4.0.0                                                                                                                                                                                                
  - app_api: 5.0.2                                                                                                                                                                                                 
  - bruteforcesettings: 4.0.0                                                                                                                                                                                      
  - calendar: 5.5.7                                                                                                                                                                                                
  - circles: 31.0.0       
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0      
  - contacts: 7.3.4       
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0 
  - dav: 1.33.0
  - deck: 1.15.3
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_external: 1.23.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - spreed: 21.1.5
  - support: 3.0.0
  - survey_client: 3.0.0
  - suspicious_login: 9.0.1
  - systemtags: 1.21.1
  - tasks: 0.17.0
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - updatenotification: 1.21.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - encryption: 2.19.0
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - user_ldap: 1.22.0

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

Hi @m0dese7en

This logging comes from a new feature added in 32 and in 31.0.9 for ocm discovery.

What your log tell is that your nextcloud client windows connect to your nextcloud server to get list of file ( webav PROPFIND ) and server is expecting to get a valid json request but got something else.

In previous version, prior that feature, this error was silently ignored.

There is an issue [Bug]: Json Exception : syntax error · Issue #55312 · nextcloud/server · GitHub
According to [stable31] fix(ocm): ignore cache if not setup by backportbot[bot] · Pull Request #55325 · nextcloud/server · GitHub

This is fixed in 31.0.10

Regards

Thank you for the reply, it is very appreciated. I’m updating my systems now.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.