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

Error: Call to a member function getPath() on null #221

Closed
robsmy98 opened this issue Aug 14, 2023 · 6 comments · Fixed by #228 or #229
Closed

Error: Call to a member function getPath() on null #221

robsmy98 opened this issue Aug 14, 2023 · 6 comments · Fixed by #228 or #229
Assignees
Labels
bug Something isn't working

Comments

@robsmy98
Copy link

After the Update from 27.0.1 to 27.0.2 I get this message 10 times in 1 minute in my protocol:

[workflow_ocr] Fehler: Error: Call to a member function getPath() on null at <<closure>>

0. /var/www/html/custom_apps/workflow_ocr/lib/Notification/Notifier.php line 98
   OCA\WorkflowOcr\Notification\Notifier->getRichParamForFile(["OC\\Notification\\Notification"])
1. /var/www/html/lib/private/Notification/Manager.php line 368
   OCA\WorkflowOcr\Notification\Notifier->prepare(["OC\\Notification\\Notification"], "de")
2. /var/www/html/apps/notifications/lib/Controller/EndpointController.php line 108
   OC\Notification\Manager->prepare(["OC\\Notification\\Notification"], "de")
3. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230
   OCA\Notifications\Controller\EndpointController->listNotifications("v2")
4. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137
   OC\AppFramework\Http\Dispatcher->executeController(["OCA\\Notificat ... "], "listNotifications")
5. /var/www/html/lib/private/AppFramework/App.php line 183
   OC\AppFramework\Http\Dispatcher->dispatch(["OCA\\Notificat ... "], "listNotifications")
6. /var/www/html/lib/private/Route/Router.php line 315
   OC\AppFramework\App::main("OCA\\Notificati ... r", "listNotifications", ["OC\\AppFramewo ... "], ["v2","ocs.notif ... "])
7. /var/www/html/ocs/v1.php line 64
   OC\Route\Router->match("/ocsapp/apps/no ... s")
8. /var/www/html/ocs/v2.php line 23
   require_once("/var/www/html/ocs/v1.php")

GET /ocs/v2.php/apps/notifications/api/v2/notifications?format=json

System

  • App version: 1.27.1
  • Nextcloud version: 27.0.2
  • PHP version: 8.2.8
  • Environment: Docker
  • ocrmypdf version: 14.0.1+dfsg1

Server log

{"reqId":"XXXXX","level":3,"time":"2023-08-14T09:10:08+00:00","remoteAddr":"XXXXXXX","user":"XXXXXXX","app":"workflow_ocr","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications?format=json","message":"Call to a member function getPath() on null","userAgent":"Mozilla/5.0 (Windows) mirall/3.9.2stable-Win64 (build 20230808) (Nextcloud, windows-10.0.22621 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"27.0.2.1","exception":{"Exception":"Error","Message":"Call to a member function getPath() on null","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/workflow_ocr/lib/Notification/Notifier.php","line":98,"function":"getRichParamForFile","class":"OCA\\WorkflowOcr\\Notification\\Notifier","type":"->","args":[["OC\\Notification\\Notification"]]},{"file":"/var/www/html/lib/private/Notification/Manager.php","line":368,"function":"prepare","class":"OCA\\WorkflowOcr\\Notification\\Notifier","type":"->","args":[["OC\\Notification\\Notification"],"de"]},{"file":"/var/www/html/apps/notifications/lib/Controller/EndpointController.php","line":108,"function":"prepare","class":"OC\\Notification\\Manager","type":"->","args":[["OC\\Notification\\Notification"],"de"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"listNotifications","class":"OCA\\Notifications\\Controller\\EndpointController","type":"->","args":["v2"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Notifications\\Controller\\EndpointController"],"listNotifications"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Notifications\\Controller\\EndpointController"],"listNotifications"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Notifications\\Controller\\EndpointController","listNotifications",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["v2","ocs.notifications.Endpoint.listNotifications"]]},{"file":"/var/www/html/ocs/v1.php","line":64,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/notifications/api/v2/notifications"]},{"file":"/var/www/html/ocs/v2.php","line":23,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/custom_apps/workflow_ocr/lib/Notification/Notifier.php","Line":111,"message":"Call to a member function getPath() on null","exception":{},"CustomMessage":"Call to a member function getPath() on null"}}
@robsmy98 robsmy98 added the bug Something isn't working label Aug 14, 2023
@R0Wi
Copy link
Contributor

R0Wi commented Aug 14, 2023

Thank's for reporting this. I also saw these messages on my dev machine but I thought they are related to some test data I created earlier. Will try to dig deeper into that ASAP.

R0Wi added a commit that referenced this issue Aug 20, 2023
@R0Wi
Copy link
Contributor

R0Wi commented Aug 20, 2023

@robsmy98 I think I found a fix for that. Would you mind testing the current patch from https://github.com/R0Wi-DEV/workflow_ocr/suites/15285716874/artifacts/872905928 ?

@robsmy98
Copy link
Author

robsmy98 commented Aug 21, 2023 via email

@JakeAi
Copy link

JakeAi commented Aug 29, 2023

@robsmy98 I think I found a fix for that. Would you mind testing the current patch from https://github.com/R0Wi-DEV/workflow_ocr/suites/15285716874/artifacts/872905928 ?

That seemed to work for me.

@farhills
Copy link

farhills commented Sep 1, 2023

I had the same issue for a single file, single user.

Before Patch:
image

After Patch:
image

Much better! To solve the actual issue, I had to ssh into the DB and delete the offending entry from oc_jobs. Hopefully that helps the next person getting spammed in the logs.

@R0Wi R0Wi linked a pull request Sep 8, 2023 that will close this issue
R0Wi added a commit that referenced this issue Sep 8, 2023
@R0Wi R0Wi closed this as completed in #228 Sep 8, 2023
R0Wi added a commit that referenced this issue Sep 8, 2023
* Fix Notifications not being processed #221

* Add Migration to remove Notification + additional tests

Signed-off-by: Robin Windey <[email protected]>

---------

Signed-off-by: Robin Windey <[email protected]>
R0Wi added a commit that referenced this issue Sep 8, 2023
* Fix Notifications not being processed #221

* Add Migration to remove Notification + additional tests

Signed-off-by: Robin Windey <[email protected]>

---------

Signed-off-by: Robin Windey <[email protected]>
@R0Wi
Copy link
Contributor

R0Wi commented Sep 8, 2023

Thanks for your feedback @farhills! Even though I could not reproduce this behaviour after the patch, I added a migration step which should remove the pending Notifications when upgrading to the next app version.

Fix will be shipped with v1.27.2

@R0Wi R0Wi linked a pull request Sep 8, 2023 that will close this issue
R0Wi added a commit that referenced this issue Sep 8, 2023
* Fix Notifications not being processed #221

* Add Migration to remove Notification + additional tests



---------

Signed-off-by: Robin Windey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants