pydio / pydio-core

Pydio 8 official repository
https://pydio.com
GNU Affero General Public License v3.0
867 stars 289 forks source link

PHP error on using pydio pro app (Call to a member function getId() on null) #1269

Closed ghost closed 7 years ago

ghost commented 7 years ago

Exception in php error log after opening the pydio pro app: Call to a member function getId() on null in /var/www/files/core/src/pydio/Core/Services/UsersService.php on line 161

Below is a screenshot of Kibana containing the following log files:

screen

Especially notice the request "/index.php?get_action=switch_repository". It got a response with http status 500 (internal server error). I think this line is related to the entry in apache error log.

I did not notice any impact on the app. Nevertheless it could be worth, a closer look.

ghost commented 7 years ago

The call stack should be: UserService.php => getRepositoriesForUser SessionRepositoryMiddleware.php => switchUserToRepository SessionRepositoryMiddleware.php => handleRequest

The error can be reproduced with pydio 7.0.1 community edition and the latest pro app (updated today). It appeared for the first time after upgrading from 6.4.2 to 7.0 on October 22.

cdujeu commented 7 years ago

hi, is it iOS or Android?

ghost commented 7 years ago

hi charles, sorry, i forgot to mention that. The error could be reproduced with the android app. Just let me know if you need more detailed steps to reproduce. Maybe i can help to narrow it down more precisely.

cdujeu commented 7 years ago

mmm, still not sure of what you are pointing out: the app is working without issue, but just you see that error appear in your logs, that's it?

cdujeu commented 7 years ago

@huzergackl can you explain more about this? What is the actual end-user symptom?

7omate commented 7 years ago

Hi, grep "Pydio Pro" /path/to/pydio_access_log | grep 500

I do have some entries but they all come from Pydio Pro.10 you seem to also have this with Pydio Pro.12, it would be great if you managed to identify the steps you follow in the app to trigger this error.

I tried that but the error didn't appear.

ghost commented 7 years ago

Ok, i first thought it would be a more severe issue but it clearly isn't. It catched my attention because i had no such errors before October 22. After having a closer look i can put your mind at ease: There are no end-user symptoms and the error always appears exactly once at a time only and requires some time in between to occur again. I'am not sure if it has to be fixed at all...

Here are the statistics (there is only one user with the android app): bildschirmfoto vom 2016-11-10 20-36-08

I had a few tries on my test-system to find the exact steps to reproduce.

STR:

=> At this point the error is in the log file. But even if i try the exact same steps again immediately, the error wont occur again. If another test is done after an hour the error can be found again.

I also noticed that there is a "switch_repository" on first try. But not if the steps are repeated immediately.

First try:

/index.php?get_action=get_xml_registry HTTP/1.1" 200 39256 "-" "Pydio-Native-Pydio Pro Pydio Pro.12"
/index.php?get_action=switch_repository HTTP/1.1" 500 1119 "-" "Pydio-Native-Pydio Pro Pydio Pro.12"
/index.php?get_action=get_xml_registry HTTP/1.1" 200 1358 "-" "Pydio-Native-Pydio Pro Pydio Pro.12"
/index.php?get_action=get_seed HTTP/1.1" 200 1273 "-" "Pydio-Native-Pydio Pro Pydio Pro.12"
/index.php?get_action=get_seed HTTP/1.1" 200 1273 "-" "Pydio-Native-Pydio Pro Pydio Pro.12"
/index.php?get_action=login HTTP/1.1" 200 1470 "-" "Pydio-Native-Pydio Pro Pydio Pro.12"

Repeated immediately:

/index.php?get_action=get_xml_registry HTTP/1.1" 200 39258 "-" "Pydio-Native-Pydio Pro Pydio Pro.12"
/index.php?get_action=imagick_data_proxy HTTP/1.1" 200 1335 "-" "Pydio-Native-Pydio Pro Pydio Pro.12"
/index.php?get_action=get_seed HTTP/1.1" 200 1273 "-" "Pydio-Native-Pydio Pro Pydio Pro.12"
/index.php?get_action=get_seed HTTP/1.1" 200 1273 "-" "Pydio-Native-Pydio Pro Pydio Pro.12"
/index.php?get_action=login HTTP/1.1" 200 1470 "-" "Pydio-Native-Pydio Pro Pydio Pro.12"

As i said i am not sure anymore whether this has to be fixed at all. At least it seems to be a topic with low priority in my opinion.

ghost commented 7 years ago

The error did not occur on 7.0.2 and it seems like it is not present in 7.0.3 as well.

I think this commit fixed it: https://github.com/pydio/pydio-core/commit/adbc8398c35a89d7c0f2d3b9dbbeb70212d2e973