镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[Bug]: Warning with lazy objects and debug mode "App class OC\\Core\\AppInfo\\Application is not setup via query() but directly" #53463

Closed

Description

@kesselb

Bug description

"App class OC\Core\AppInfo\Application is not setup via query() but directly" us logged for each request.

Steps to reproduce

  1. Use php8.4
  2. 'enable_lazy_objects' => true,
  3. 'debug' => true,

Expected behavior

I might be wrong, but with lazy objects enabled, it seems intentional to call the constructor directly. Therefore, we may need to adjust the check in the application base class.

However, I'm confused as to why we only see that warning for Core and not the other application classes. Initializing this class seems to take an unusual path.

I'm raising this issue for awareness.

Nextcloud Server version

master

PHP engine version

8.4

Activity

  1. added
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Jun 12, 2025
  2. kesselb commented on Jun 12, 2025

    @kesselb
    ContributorAuthor
  3. come-nc commented on Jun 16, 2025

    @come-nc
    Contributor

    98b2cfc This was intended to fix it.
    But Core application changed in #53157 since then, so maybe something different is happening.

    @kesselb no trace?

  4. kesselb commented on Jun 16, 2025

    @kesselb
    ContributorAuthor
    {
      "reqId": "qZDhcX1Ilx0xZXrNGHe4",
      "level": 3,
      "time": "2025-06-16T09:31:20+00:00",
      "remoteAddr": "172.18.0.1",
      "user": "admin",
      "app": "core",
      "method": "GET",
      "url": "/ocs/v2.php/apps/notifications/api/v2/notifications",
      "message": "App class OC\\Core\\AppInfo\\Application is not setup via query() but directly",
      "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0",
      "version": "32.0.0.0",
      "exception": {
        "Exception": "RuntimeException",
        "Message": "App class OC\\Core\\AppInfo\\Application is not setup via query() but directly",
        "Code": 0,
        "Trace": [
          {
            "file": "/var/www/html/core/AppInfo/Application.php",
            "line": 50,
            "function": "__construct",
            "class": "OCP\\AppFramework\\App",
            "type": "->",
            "args": [
              "core",
              []
            ]
          },
          {
            "file": "/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 68,
            "function": "__construct",
            "class": "OC\\Core\\AppInfo\\Application",
            "type": "->",
            "args": [
              []
            ]
          },
          {
            "file": "/var/www/html/lib/public/AppFramework/App.php",
            "line": 101,
            "function": "{closure:OC\\AppFramework\\Utility\\SimpleContainer::buildClass():66}",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->",
            "args": [
              "*** sensitive parameters replaced ***"
            ]
          },
          {
            "file": "/var/www/html/lib/private/AppFramework/Bootstrap/RegistrationContext.php",
            "line": 752,
            "function": "getContainer",
            "class": "OCP\\AppFramework\\App",
            "type": "->",
            "args": []
          },
          {
            "file": "/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php",
            "line": 129,
            "function": "delegateContainerRegistrations",
            "class": "OC\\AppFramework\\Bootstrap\\RegistrationContext",
            "type": "->",
            "args": [
              {
                "core": "*** sensitive parameters replaced ***"
              }
            ]
          },
          {
            "file": "/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php",
            "line": 53,
            "function": "registerApps",
            "class": "OC\\AppFramework\\Bootstrap\\Coordinator",
            "type": "->",
            "args": [
              [
                "core"
              ]
            ]
          },
          {
            "file": "/var/www/html/lib/base.php",
            "line": 778,
            "function": "runLazyRegistration",
            "class": "OC\\AppFramework\\Bootstrap\\Coordinator",
            "type": "->",
            "args": [
              "core"
            ]
          },
          {
            "file": "/var/www/html/lib/base.php",
            "line": 1164,
            "function": "init",
            "class": "OC",
            "type": "::",
            "args": []
          },
          {
            "file": "/var/www/html/ocs/v1.php",
            "line": 20,
            "args": [
              "/var/www/html/lib/base.php"
            ],
            "function": "require_once"
          },
          {
            "file": "/var/www/html/ocs/v2.php",
            "line": 7,
            "args": [
              "/var/www/html/ocs/v1.php"
            ],
            "function": "require_once"
          }
        ],
        "File": "/var/www/html/lib/public/AppFramework/App.php",
        "Line": 54,
        "message": "App class OC\\Core\\AppInfo\\Application is not setup via query() but directly",
        "exception": {},
        "CustomMessage": "App class OC\\Core\\AppInfo\\Application is not setup via query() but directly"
      }
    }
    
    {
      "reqId": "Fvfqm4RQzk7D6csGFAKY",
      "level": 3,
      "time": "2025-06-16T09:31:19+00:00",
      "remoteAddr": "172.18.0.1",
      "user": "admin",
      "app": "core",
      "method": "PROPFIND",
      "url": "/remote.php/dav/calendars/admin/",
      "message": "App class OC\\Core\\AppInfo\\Application is not setup via query() but directly",
      "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0",
      "version": "32.0.0.0",
      "exception": {
        "Exception": "RuntimeException",
        "Message": "App class OC\\Core\\AppInfo\\Application is not setup via query() but directly",
        "Code": 0,
        "Trace": [
          {
            "file": "/var/www/html/core/AppInfo/Application.php",
            "line": 50,
            "function": "__construct",
            "class": "OCP\\AppFramework\\App",
            "type": "->",
            "args": [
              "core",
              []
            ]
          },
          {
            "file": "/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 68,
            "function": "__construct",
            "class": "OC\\Core\\AppInfo\\Application",
            "type": "->",
            "args": [
              []
            ]
          },
          {
            "file": "/var/www/html/lib/public/AppFramework/App.php",
            "line": 101,
            "function": "{closure:OC\\AppFramework\\Utility\\SimpleContainer::buildClass():66}",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->",
            "args": [
              "*** sensitive parameters replaced ***"
            ]
          },
          {
            "file": "/var/www/html/lib/private/AppFramework/Bootstrap/RegistrationContext.php",
            "line": 752,
            "function": "getContainer",
            "class": "OCP\\AppFramework\\App",
            "type": "->",
            "args": []
          },
          {
            "file": "/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php",
            "line": 129,
            "function": "delegateContainerRegistrations",
            "class": "OC\\AppFramework\\Bootstrap\\RegistrationContext",
            "type": "->",
            "args": [
              {
                "core": "*** sensitive parameters replaced ***"
              }
            ]
          },
          {
            "file": "/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php",
            "line": 53,
            "function": "registerApps",
            "class": "OC\\AppFramework\\Bootstrap\\Coordinator",
            "type": "->",
            "args": [
              [
                "core"
              ]
            ]
          },
          {
            "file": "/var/www/html/lib/base.php",
            "line": 778,
            "function": "runLazyRegistration",
            "class": "OC\\AppFramework\\Bootstrap\\Coordinator",
            "type": "->",
            "args": [
              "core"
            ]
          },
          {
            "file": "/var/www/html/lib/base.php",
            "line": 1164,
            "function": "init",
            "class": "OC",
            "type": "::",
            "args": []
          },
          {
            "file": "/var/www/html/remote.php",
            "line": 97,
            "args": [
              "/var/www/html/lib/base.php"
            ],
            "function": "require_once"
          }
        ],
        "File": "/var/www/html/lib/public/AppFramework/App.php",
        "Line": 54,
        "message": "App class OC\\Core\\AppInfo\\Application is not setup via query() but directly",
        "exception": {},
        "CustomMessage": "App class OC\\Core\\AppInfo\\Application is not setup via query() but directly"
      }
    }
    
  5. moved this from To triage to Confirmed in 🧑‍🤝‍🧑 Community triageon Jun 16, 2025
  6. added theissue type on Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmap32-feedbackbug

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions