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

OCA\\Notes\\Controller\\NotesController::__construct(): Argument #10 ($userId) must be of type string, null given #1089

Closed
solracsf opened this issue Aug 7, 2023 · 2 comments · Fixed by #1106
Labels
bug Something isn't working need to reproduce Issue that has not been reproduced

Comments

@solracsf
Copy link
Member

solracsf commented Aug 7, 2023

Please make a clear and concise description of what the bug is.

Steps to reproduce

  1. Expired session, $userId is null
  2. Try to load the page
  3. Error

Server

Please complete the following information.

  • Notes app version: 4.8.1
  • Nextcloud version: 26.0.4

Log files

{
  "reqId": "LhlieLsnD2oKIjMdv8UR",
  "level": 3,
  "time": "2023-08-07T15:31:59+02:00",
  "remoteAddr": "3.19.4.4",
  "user": "--",
  "app": "index",
  "method": "GET",
  "url": "/apps/notes/notes/2125667",
  "message": "OCA\\Notes\\Controller\\NotesController::__construct(): Argument #10 ($userId) must be of type string, null given",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0",
  "version": "26.0.4.2",
  "exception": {
    "Exception": "TypeError",
    "Message": "OCA\\Notes\\Controller\\NotesController::__construct(): Argument #10 ($userId) must be of type string, null given",
    "Code": 0,
    "Trace": [
      {
        "function": "__construct",
        "class": "OCA\\Notes\\Controller\\NotesController",
        "type": "->",
        "args": [
          "notes",
          [
            "OC\\AppFramework\\Http\\Request"
          ],
          [
            "OCA\\Notes\\Service\\NotesService"
          ],
          [
            "OC\\Files\\Lock\\LockManager"
          ],
          [
            "OCA\\Notes\\Service\\SettingsService"
          ],
          [
            "OCA\\Notes\\Controller\\Helper",
            [
              "OC\\AppFramework\\ScopedPsrLogger"
            ]
          ],
          [
            "OC\\AllConfig"
          ],
          [
            "OC\\L10N\\LazyL10N"
          ],
          [
            "OC\\Files\\Type\\Detection"
          ],
          null
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 116,
        "function": "newInstanceArgs",
        "class": "ReflectionClass",
        "type": "->",
        "args": [
          [
            "notes",
            [
              "OC\\AppFramework\\Http\\Request"
            ],
            [
              "OCA\\Notes\\Service\\NotesService"
            ],
            [
              "OC\\Files\\Lock\\LockManager"
            ],
            [
              "OCA\\Notes\\Service\\SettingsService"
            ],
            "And 5 more entries, set log level to debug to see all entries"
          ]
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 124,
        "function": "buildClass",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->",
        "args": [
          [
            "ReflectionClass",
            "OCA\\Notes\\Controller\\NotesController"
          ]
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 142,
        "function": "resolve",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->",
        "args": [
          "OCA\\Notes\\Controller\\NotesController"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
        "line": 493,
        "function": "query",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->",
        "args": [
          "OCA\\Notes\\Controller\\NotesController"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
        "line": 465,
        "function": "queryNoFallback",
        "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
        "type": "->",
        "args": [
          "OCA\\Notes\\Controller\\NotesController"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 162,
        "function": "query",
        "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
        "type": "->",
        "args": [
          "OCA\\Notes\\Controller\\NotesController"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Notes\\Controller\\NotesController",
          "get",
          [
            "OC\\AppFramework\\DependencyInjection\\DIContainer"
          ],
          [
            "2125667",
            "notes.notes.get"
          ]
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 1065,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/apps/notes/notes/2125667"
        ]
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 36,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/var/www/nextcloud/apps/notes/lib/Controller/NotesController.php",
    "Line": 33,
    "CustomMessage": "--"
  },
  "id": "64d15b266c4d6"
}
@solracsf solracsf added bug Something isn't working need to reproduce Issue that has not been reproduced labels Aug 7, 2023
@alx-tuilmenau
Copy link

alx-tuilmenau commented Sep 5, 2023

Also got this in the Log:

{"reqId":"qXDf1vBSQ738KMl5KQ34","level":3,"time":"2023-09-05T08:52:05+00:00","remoteAddr":"[deleted]","user":"--","app":"index","method":"GET","url":"/apps/notes/notes/69756737","message":"Cannot assign null to property OCA\\Notes\\Controller\\NotesController::$userId of type string","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0","version":"26.0.5.1","exception":{"Exception":"TypeError","Message":"Cannot assign null to property OCA\\Notes\\Controller\\NotesController::$userId of type string","Code":0,"Trace":[{"function":"__construct","class":"OCA\\Notes\\Controller\\NotesController","type":"->"},{"file":"/data/nextcloud_a3/lib/private/AppFramework/Utility/SimpleContainer.php","line":84,"function":"newInstanceArgs","class":"ReflectionClass","type":"->"},{"file":"/data/nextcloud_a3/lib/private/AppFramework/Utility/SimpleContainer.php","line":124,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/data/nextcloud_a3/lib/private/AppFramework/Utility/SimpleContainer.php","line":142,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/data/nextcloud_a3/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":493,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/data/nextcloud_a3/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":465,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/data/nextcloud_a3/lib/private/AppFramework/App.php","line":162,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/data/nextcloud_a3/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/data/nextcloud_a3/lib/base.php","line":1065,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/data/nextcloud_a3/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/data/nextcloud_a3/apps/notes/lib/Controller/NotesController.php","Line":53,"CustomMessage":"--"},"id":"64f6ed8fe0d24"}

NC 26.0.5
Notes 4.8.1
PHP 8.2 (FPM)

@juliusknorr
Copy link
Member

Fix in #1106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need to reproduce Issue that has not been reproduced
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants