Occ syntax error, unexpected identifier "APP_NAME", expecting "=" due to Passwords app

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).

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.8
  • Operating system and version (e.g., Ubuntu 24.04):
    • Linux 5.14.0-503.40.1.el9_5.x86_64
  • Web server and version (e.g, Apache 2.4.25):
    • litespeed
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • ?
  • PHP version (e.g, 8.3):
    • 8.3
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • 9 days ago
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • replace me
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

When Passwords 2025.7.20 is enabled, any occ command displays an error message:

syntax error, unexpected identifier “APP_NAME”, expecting “=”

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

  1. enable Passwords app 2025.7.20

  2. run an occ command on the server

  3. see the error message

  4. disable Passwords app

  5. run an occ command on the server

  6. see no error message

Log entries

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":"af0z5gcoccYt8XytuW41","level":4,"time":"2025-09-09T09:30:34+00:00","remoteAddr":"","user":"--","app":"passwords","method":"","url":"--","message":"Error during app service registration: syntax error, unexpected identifier \"APP_NAME\", expecting \"=\"","userAgent":"--","version":"31.0.8.1","exception":{"Exception":"ParseError","Message":"syntax error, unexpected identifier \"APP_NAME\", expecting \"=\"","Code":0,"Trace":[{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/composer/composer/ClassLoader.php","line":427,"function":"Composer\\Autoload\\{closure}","args":["*** sensitive parameters replaced ***"]},{"function":"loadClass","class":"Composer\\Autoload\\ClassLoader","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":86,"function":"class_exists"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":48,"function":"registerApps","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/base.php","line":676,"function":"runInitialRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/base.php","line":1192,"function":"init","class":"OC","type":"::"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/console.php","line":28,"args":["/home/myUser/domains/cloud.idl-mp.com/public_html/lib/base.php"],"function":"require_once"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/occ","line":33,"args":["/home/myUser/domains/cloud.idl-mp.com/public_html/console.php"],"function":"require_once"}],"File":"/home/myUser/domains/cloud.idl-mp.com/public_html/apps/passwords/lib/AppInfo/Application.php","Line":127,"message":"Error during app service registration: syntax error, unexpected identifier \"APP_NAME\", expecting \"=\"","exception":{},"CustomMessage":"Error during app service registration: syntax error, unexpected identifier \"APP_NAME\", expecting \"=\""}}

{"reqId":"af0z5gcoccYt8XytuW41","level":4,"time":"2025-09-09T09:30:34+00:00","remoteAddr":"","user":"--","app":"passwords","method":"","url":"--","message":"Error during app loading: syntax error, unexpected identifier \"APP_NAME\", expecting \"=\"","userAgent":"--","version":"31.0.8.1","exception":{"Exception":"ParseError","Message":"syntax error, unexpected identifier \"APP_NAME\", expecting \"=\"","Code":0,"Trace":[{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/composer/composer/ClassLoader.php","line":427,"function":"Composer\\Autoload\\{closure}","args":["*** sensitive parameters replaced ***"]},{"function":"loadClass","class":"Composer\\Autoload\\ClassLoader","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":174,"function":"class_exists"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/private/App/AppManager.php","line":444,"function":"isBootable","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/private/App/AppManager.php","line":248,"function":"loadApp","class":"OC\\App\\AppManager","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/private/Console/Application.php","line":90,"function":"loadApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/console.php","line":81,"function":"loadCommands","class":"OC\\Console\\Application","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/occ","line":33,"args":["/home/myUser/domains/cloud.idl-mp.com/public_html/console.php"],"function":"require_once"}],"File":"/home/myUser/d
mains/cloud.idl-mp.com/public_html/apps/passwords/lib/AppInfo/Application.php","Line":127,"message":"Error during app loading: syntax error, unexpected identifier \"APP_NAME\", expecting \"=\"","exception":{},"CustomMessage":"Error during app loading: syntax error, unexpected identifier \"APP_NAME\", expecting \"=\""}}

{"reqId":"af0z5gcoccYt8XytuW41","level":3,"time":"2025-09-09T09:30:34+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"syntax error, unexpected identifier \"APP_NAME\", expecting \"=\"","userAgent":"--","version":"31.0.8.1","exception":{"Exception":"ParseError","Message":"syntax error, unexpected identifier \"APP_NAME\", expecting \"=\"","Code":0,"Trace":[{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/composer/composer/ClassLoader.php","line":427,"function":"Composer\\Autoload\\{closure}","args":["*** sensitive parameters replaced ***"]},{"function":"loadClass","class":"Composer\\Autoload\\ClassLoader","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/private/ServerContainer.php","line":88,"function":"class_exists"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/private/ServerContainer.php","line":170,"function":"getAppContainer","class":"OC\\ServerContainer","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/private/ServerContainer.php","line":135,"function":"getAppContainerForService","class":"OC\\ServerContainer","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/Utility/SimpleContainer.php","line":42,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/public/Server.php","line":39,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/private/Console/Application.php","line":196,"function":"get","class":"OCP\\Server","type":"::"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/lib/private/Console/Application.php","line":101,"function":"loadCommandsFromInfoXml","class":"OC\\Console\\Application","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/console.php","line":81,"function":"loadCommands","class":"OC\\Console\\Application","type":"->"},{"file":"/home/myUser/domains/cloud.idl-mp.com/public_html/occ","line":33,"args":["/home/myUser/domains/cloud.idl-mp.com/public_html/console.php"],"function":"require_once"}],"File":"/home/myUser/domains/cloud.idl-mp.com/public_html/apps/passwords/lib/AppInfo/Application.php","Line":127,"message":"syntax error, unexpected identifier \"APP_NAME\", expecting \"=\"","exception":{},"CustomMessage":"syntax error, unexpected identifier \"APP_NAME\", expecting \"=\""}}

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.

Brave v1.82.161 or Firefox 142.0.1

Web server / Reverse Proxy

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

No access to this log

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": [
            "cloud.idl-mp.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.8.1",
        "overwrite.cli.url": "https:\/\/cloud.idl-mp.com",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "default_language": "fr",
        "installed": true,
        "theme": "",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "trashbin_retention_obligation": "auto, 7",
        "trashbin_auto_expire": true,
        "versions_retention_obligation": "auto, 7",
        "degug": false,
        "loglevel": 2,
        "cron_log": true,
        "log_rotate_size": 209715200,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "maintenance": false,
        "default_phone_region": "FR",
        "app_install_overwrite": [
            "occweb",
            "social",
            "apporder",
            "mailnotifier",
            "unsplash"
        ],
        "maintenance_window_start": 1,
        "updater.release.channel": "stable",
        "mail_smtpport": "465",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

Apps

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

Enabled:
  • activity: 4.0.0
    
  • app_api: 5.0.2
    
  • bookmarks: 15.2.0
    
  • bruteforcesettings: 4.0.0
    
  • calendar: 5.5.2
    
  • calendar_resource_management: 0.10.0
    
  • cloud_federation_api: 1.14.0
    
  • contacts: 7.2.6
    
  • dashboard: 7.11.0
    
  • dav: 1.33.0
    
  • federatedfilesharing: 1.21.0
    
  • federation: 1.21.0
    
  • files: 2.3.1
    
  • files_automatedtagging: 2.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
    
  • fileslibreofficeedit: 2.0.1
    
  • flow_notifications: 2.0.1
    
  • lookup_server_connector: 1.19.0
    
  • mail: 5.4.0
    
  • mailnotifier: 0.0.3
    
  • notes: 4.12.3
    
  • notifications: 4.0.0
    
  • oauth2: 1.19.1
    
  • occweb: 0.2.3
    
  • password_policy: 3.0.0
    
  • phonetrack: 0.9.1
    
  • privacy: 3.0.0
    
  • profile: 1.0.0
    
  • provisioning_api: 1.21.0
    
  • quota_warning: 1.21.0
    
  • related_resources: 2.0.0
    
  • settings: 1.14.0
    
  • support: 3.0.0
    
  • survey_client: 3.0.0
    
  • systemtags: 1.21.1
    
  • tasks: 0.16.1
    
  • 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
    
  • webhook_listeners: 1.2.0
    
  • workflowengine: 2.13.0Disabled:
    
  • admin_audit: 1.21.0
    
  • circles: 31.0.0 (installed 24.0.1)
    
  • comments: 1.21.0 (installed 1.14.0)
    
  • contactsinteraction: 1.12.0 (installed 1.5.0)
    
  • encryption: 2.19.0
    
  • files_downloadlimit: 4.0.0 (installed 3.0.0)
    
  • firstrunwizard: 4.0.0 (installed 2.13.0)
    
  • logreader: 4.0.0 (installed 2.9.0)
    
  • nextcloud_announcements: 3.0.0 (installed 1.13.0)
    
  • officeonline: 3.1.0 (installed 3.1.0)
    
  • passwords: 2025.7.20 (installed 2025.7.20)
    
  • photos: 4.0.0 (installed 1.6.0)
    
  • recommendations: 4.0.0 (installed 1.3.0)
    
  • richdocuments: 8.7.4 (installed 8.7.4)
    
  • richdocumentscode: 25.4.403 (installed 25.4.403)
    
  • serverinfo: 3.0.0 (installed 1.14.0)
    
  • sharebymail: 1.21.0 (installed 1.14.0)
    
  • side_menu: 5.1.1 (installed 5.1.1)
    
  • suspicious_login: 9.0.1 (installed 4.2.1)
    
  • twofactor_nextcloud_notification: 5.0.0
    
  • twofactor_totp: 13.0.0-dev.0
    
  • user_ldap: 1.22.0
    
  • weather_status: 1.11.0 (installed 1.4.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.

if you’re getting a syntax error you’re not using PHP 8.3.

try php -v and update your default php version to at least 8.3 or just run php8.3 ./occ.

That’s exactly what I was thinking too, and yes PHP cli is in 8.2.28.

The bad news is, on my hostinger hosting there’s no way to use PHP cli in 8.3 (even when it’s the selected version in PHP Configuration), so… :frowning:

So, here’s what I’ll try to do to make my cron jobs work with Passwords enabled : instead of running cron.php with PHP CLI, I do it with PHP like this:

*/30 * * * * curl -s https://my.cloud.domain/nextcloud/cron.php

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