Repository navigation
do not hide exception when ldap server has a hiccup - #15332
Conversation
|
Can we show the full stacktrace only if Debug mode is enabled? – It's fine to show "No LDAP Connection to server" and log this properly but we really should not expose all the other rest if not really required as I already see people complaining about exposing the directory structure etc… |
|
Looks reasonable - @butonic do we get prs against master and stable8 as well? THX |
|
nice 👍 But I agree with @LukasReschke here. Can we make this debug only? |
2febd85 to
24e9286
Compare
|
from my pov there is no reason to have the login page displayed - the regular exception page is quite okay - exception details should be hidden as soon as debug is disabled @LukasReschke or is it necessary to throw a HintException here? THX |
Nope. HintException's are the only ones where the actual error message is shown to the user. So a Any other uncatched exception will print the regular exception page which shows the "Instance has encountered a problem" button as well as the request ID to allow easier debugging of the error. If debug mode is enabled the whole stacktrace will be shown to the user. (otherwise the admin needs to cross-reference the request ID with the error log.) |
|
Could this result in the case where the LDAP server goes down (perhaps triggered by an admin), then the admin needs to go into oC to disable LDAP, but can't because login throws an exception that isn't caught? |
|
There seems to be a problem with accessing the users page. @blizzz I always get a |
|
When a new user is mapped (which happens for the first time on the users page
or any other time a search is done and a new user is brought to ownCloud) a
userExists is done to make sure that the desired username is not given away.
Might this clash?
|
|
Throwing an exception will cause strange behaviour when ajax requests are done, since they receive HTML instead of JSON? What's the best way we can/should handle this? |
8ee9145 to
2539c0d
Compare
We already have this broken behaviour in a lot of other places :-( |
|
I tested this with a broken LDAP ... it works. Let me check the AJAX calls (I will test the sharing auto complete) |
We could check if the accept header is application/json in index.php before printing an exception. That is actually not that much work ... but not part of this PR. |
There was a problem hiding this comment.
To drop (roughly) 1 out of 20 requests change that line to:
if(rand(0,19) === 0 || is_null($this->ldapConnectionRes)) {
dc45a86 to
7ddfdd2
Compare
|
How to test this:
current behaviour:The shared folder is simply omited. With running LDAP server: With stopped LDAP server: Behaviour with this patchThe PROPFIND result in a 500 |
|
@MorrisJobke unfortunately - still creates the f***** local:// entries. I used the |
|
I assume there is another code path that eats the exception. I have now disabled the creation of the local:// entry and will try to capture a backtrace of it happening |
723beba to
4a87986
Compare
|
The idea now is that if no user could be fetched from any backend we simply cannot mount anything. We should therefore not mount a local storage based on the userId. This simply is wrong. @icewind1991 Can you confirm that this is how it should work? 4a87986?w=1 We throw an exception and let the endpoint (webdav, web UI) know that something bad happened. We later should try to make the backends more robust to failures of the underlying infrastructure, but for now we not have a way to communicate this up to the mount point init. |
Seems reasonable |
d9c7123 to
919241c
Compare
|
Rebased. Can we get this in. There are more and more problems with stable7 instances that could be solved by this. |
|
Refer to this link for build results (access rights to CI server needed): |
|
👍 |
1 similar comment
|
👍 |
|
If this was resolved #15332 (comment) Checking Update Seems so |
|
The exception is not thrown, when the connection was established initially, but got lost during operation. For example, do a search using occ over many users and shut off LDAP inbetween. Only partly results will be returned, »LDAP error Can't contact LDAP server (-1) after calling ldap_read« is being logged. I'll have a look. |
|
added throwing another one. @butonic @MorrisJobke you ok with this? |
|
@blizzz if you also port it to oc8 & master I am ok with it |
|
will do |
|
Added to the stable8 PR and, since master is done, opened an additional PR therefore: #15811 |
|
The inspection completed: 3504 Issues, 89 Patches |
|
Refer to this link for build results (access rights to CI server needed): |
|
👍 |
do not hide exception when ldap server has a hiccup


this PR allows connection related exceptions in user_ldap to bubble up. When triggered by the filecache post write hook the following message will now show up in tho oc log.
When a user tries to login and the ldap server is not available he will now see

instead of
Fixes #13862