Skip to content

Undefined variable $OC_Version#1424

Description

@Knapoc

How to use GitHub

  • Please use the 馃憤 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Set log-level at least to warning
  2. Logout of Nextcloud with a user that is logged in via OIDC
  3. Log back in via OIDC

Expected behaviour

No warnings in the nextcloud logs

Actual behaviour

I observe the following warnings:

{"reqId":"fmqWxtJ5recTSXc98xk7","level":2,"time":"2026-04-22T19:47:28+02:00","remoteAddr":"192.168.1.1","user":"obfuscated","app":"PHP","method":"GET","url":"/apps/user_oidc/code?code=obfuscated&state=obfuscated","scriptName":"/index.php","message":"Undefined variable $OC_Version at /var/www/html/custom_apps/user_oidc/lib/Controller/LoginController.php#750","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.4 Safari/605.1.15","version":"32.0.8.2","data":{"app":"PHP"},"id":"69e909b8ddd22"}
{"reqId":"fmqWxtJ5recTSXc98xk7","level":2,"time":"2026-04-22T19:47:28+02:00","remoteAddr":"192.168.1.1","user":"obfuscated","app":"PHP","method":"GET","url":"/apps/user_oidc/code?code=obfuscated&state=obfuscated","scriptName":"/index.php","message":"Trying to access array offset on null at /var/www/html/custom_apps/user_oidc/lib/Controller/LoginController.php#750","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.4 Safari/605.1.15","version":"32.0.8.2","data":{"app":"PHP"},"id":"69e909b8ddd18"}

I assume this is due to #1407 / #ac4c25f9648e37c690e530757121d12c79bc6c79 and $OC_Version being never defined.

Server configuration

Web server: Nginx

Database: PostgreSQL 17

PHP version: 8.3.30

Nextcloud version: 32.0.8

List of activated apps
Enabled:
  - activity: 5.0.0
  - bruteforcesettings: 5.0.0
  - calendar: 6.2.2
  - circles: 32.0.0
  - cloud_federation_api: 1.16.0
  - comments: 1.22.0
  - contacts: 8.3.8
  - contactsinteraction: 1.13.1
  - cospend: 3.2.0
  - dashboard: 7.12.0
  - dav: 1.34.2
  - drawio: 4.1.4
  - end_to_end_encryption: 1.18.2
  - external: 7.0.0
  - federatedfilesharing: 1.22.0
  - files: 2.4.0
  - files_accesscontrol: 3.0.2
  - files_antivirus: 6.2.0
  - files_automatedtagging: 3.0.3
  - files_downloadlimit: 5.0.0
  - files_external: 1.24.1
  - files_fulltextsearch: 32.0.2
  - files_fulltextsearch_tesseract: 32.0.0
  - files_pdfviewer: 5.0.0
  - files_reminders: 1.5.0
  - files_sharing: 1.24.1
  - files_trashbin: 1.22.0
  - files_versions: 1.25.0
  - firstrunwizard: 5.0.0
  - fulltextsearch: 32.0.0
  - fulltextsearch_elasticsearch: 32.0.2
  - logreader: 5.0.0
  - lookup_server_connector: 1.20.0
  - nextcloud_announcements: 4.0.0
  - notifications: 5.0.0
  - oauth2: 1.20.0
  - ocs_api_viewer: 1.0.11
  - password_policy: 4.0.0
  - photos: 5.0.0
  - previewgenerator: 5.13.0
  - privacy: 4.0.0
  - profile: 1.1.0
  - provisioning_api: 1.22.0
  - recommendations: 5.0.0
  - related_resources: 3.0.0
  - richdocuments: 9.0.5
  - serverinfo: 4.0.0
  - settings: 1.15.1
  - sharebymail: 1.22.0
  - systemtags: 1.22.0
  - text: 6.0.1
  - theming: 2.7.0
  - twofactor_backupcodes: 1.21.0
  - twofactor_totp: 14.0.0
  - twofactor_webauthn: 2.6.0
  - updatenotification: 1.22.0
  - user_oidc: 8.10.0
  - user_status: 1.12.0
  - viewer: 5.0.0
  - weather_status: 1.12.0
  - webhook_listeners: 1.3.0
  - workflow_ocr: 1.32.1
  - workflowengine: 2.14.0
Disabled:
  - admin_audit: 1.22.0 (installed 1.20.0)
  - app_api: 32.0.0 (installed 4.0.0)
  - encryption: 2.20.0 (installed 2.4.0)
  - federation: 1.22.0 (installed 1.9.0)
  - files_retention: 3.0.0 (installed 3.0.0)
  - maps: 1.6.0 (installed 1.6.0)
  - support: 4.0.0 (installed 1.12.0)
  - survey_client: 4.0.0 (installed 1.1.0)
  - suspicious_login: 10.0.0 (installed 4.2.1)
  - twofactor_nextcloud_notification: 6.0.0
  - user_ldap: 1.23.0
Nextcloud configuration
{
    "system": {
        "htaccess.RewriteBase": "\/",
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "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": [
            "obfuscated.example.com"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/obfuscated.example.com",
        "dbtype": "pgsql",
        "version": "32.0.8.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpsecure": "tls",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance_window_start": 1,
        "logtimezone": "Europe\/Berlin",
        "loglevel": 2,
        "log_rotate_size": 0,
        "updater.release.channel": "stable",
        "maintenance": false,
        "overwritehost": "obfuscated.example.com",
        "overwriteprotocol": "https",
        "theme": "",
        "data-fingerprint": "35f8fe895c13635df2ac5db36208def9",
        "app_install_overwrite": [
            "drawio",
            "ransomware_detection",
            "suspicious_login",
            "end_to_end_encryption",
            "files_antivirus",
            "fulltextsearch_elasticsearch"
        ],
        "quota_include_external_storage": true,
        "default_phone_region": "DE",
        "mail_sendmailmode": "smtp",
        "enable_previews": true,
        "enabledPreviewProviders": {
            "0": "OC\\Preview\\PNG",
            "1": "OC\\Preview\\JPEG",
            "3": "OC\\Preview\\GIF",
            "4": "OC\\Preview\\BMP",
            "5": "OC\\Preview\\XBitmap",
            "6": "OC\\Preview\\MP3",
            "7": "OC\\Preview\\TXT",
            "8": "OC\\Preview\\MarkDown",
            "9": "OC\\Preview\\HEIC",
            "10": "OC\\Preview\\OpenDocument",
            "11": "OC\\Preview\\Imaginary",
            "12": "OC\\Preview\\ImaginaryPDF",
            "14": "OC\\Preview\\Movie"
        },
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "preview_format": "webp",
        "preview_imaginary_key": "***REMOVED SENSITIVE VALUE***",
        "user_oidc": {
            "use_pkce": true
        },
        "upgrade.disable-web": true,
        "defaultapp": ""
    }
}

Browser

Browser name: Safari

Browser version: 26.4

Operating system: macOS 26.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions