[jira] [Commented] (SOLR-13905) Nullpointer exception in AuditEvent

2019-11-18 Thread Jira


[ 
https://issues.apache.org/jira/browse/SOLR-13905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16976629#comment-16976629
 ] 

Jan Høydahl commented on SOLR-13905:


I'll merge this PR tomorrow and defer to SOLR-13941 to fix the root cause of 
this confusion.

> Nullpointer exception in AuditEvent
> ---
>
> Key: SOLR-13905
> URL: https://issues.apache.org/jira/browse/SOLR-13905
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Auditlogging
>Affects Versions: 8.3
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
>Priority: Major
> Fix For: 8.4, 8.3.1
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Nullpointer exception in AuditEvent for events with HttpServletRequest as 
> input. Happens when {{getPathInfo()}} returns null, which was not caught by 
> current tests. This causes the whole request to fail, rendering the audit 
> service unusable.
> The nullpointer is experienced in the {{findRequestType()}} method when 
> performing pattern match on the resource (path).
> This is a regression from 8.3, caused by SOLR-13835 where we switched from 
> fetching the URL path from {{httpRequest.getContextPath()}} to 
> {{httpRequest.getPathInfo()}}. However while this method behaves well in 
> tests (JettyTestRunner) it returns {{null}} in production.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (SOLR-13905) Nullpointer exception in AuditEvent

2019-11-18 Thread Jira


[ 
https://issues.apache.org/jira/browse/SOLR-13905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16976624#comment-16976624
 ] 

Jan Høydahl commented on SOLR-13905:


Spinning off SOLR-13941 to perhaps fix the discrepancy between cmdline and 
TestRunner servlets.

> Nullpointer exception in AuditEvent
> ---
>
> Key: SOLR-13905
> URL: https://issues.apache.org/jira/browse/SOLR-13905
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Auditlogging
>Affects Versions: 8.3
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
>Priority: Major
> Fix For: 8.4, 8.3.1
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Nullpointer exception in AuditEvent for events with HttpServletRequest as 
> input. Happens when {{getPathInfo()}} returns null, which was not caught by 
> current tests. This causes the whole request to fail, rendering the audit 
> service unusable.
> The nullpointer is experienced in the {{findRequestType()}} method when 
> performing pattern match on the resource (path).
> This is a regression from 8.3, caused by SOLR-13835 where we switched from 
> fetching the URL path from {{httpRequest.getContextPath()}} to 
> {{httpRequest.getPathInfo()}}. However while this method behaves well in 
> tests (JettyTestRunner) it returns {{null}} in production.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (SOLR-13905) Nullpointer exception in AuditEvent

2019-11-16 Thread Jira


[ 
https://issues.apache.org/jira/browse/SOLR-13905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16975797#comment-16975797
 ] 

Jan Høydahl commented on SOLR-13905:


{quote}What is exactly the difference?
{quote}
In our tests the /admin/info path (example) comes in pathInfo, while in 
production this returns null and we have to pull it from getContextPath or 
getServletPath instead. You see similar code in SolrDispatchFilter 
[https://github.com/apache/lucene-solr/blob/f07998fc234c81ff956a84ee508b85f8d573ef38/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java#L494-L499]
 where we have some null checks.

I propose we create some static utility method 
{{SolrUtils.getPathFromRequest()}} to unify this across the code base, probably 
everywhere our code tries to call {{HttpServletRequest.getPathInfo()}}?

> Nullpointer exception in AuditEvent
> ---
>
> Key: SOLR-13905
> URL: https://issues.apache.org/jira/browse/SOLR-13905
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Auditlogging
>Affects Versions: 8.3
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
>Priority: Major
> Fix For: 8.4, 8.3.1
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Nullpointer exception in AuditEvent for events with HttpServletRequest as 
> input. Happens when {{getPathInfo()}} returns null, which was not caught by 
> current tests. This causes the whole request to fail, rendering the audit 
> service unusable.
> The nullpointer is experienced in the {{findRequestType()}} method when 
> performing pattern match on the resource (path).
> This is a regression from 8.3, caused by SOLR-13835 where we switched from 
> fetching the URL path from {{httpRequest.getContextPath()}} to 
> {{httpRequest.getPathInfo()}}. However while this method behaves well in 
> tests (JettyTestRunner) it returns {{null}} in production.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (SOLR-13905) Nullpointer exception in AuditEvent

2019-11-16 Thread Uwe Schindler (Jira)


[ 
https://issues.apache.org/jira/browse/SOLR-13905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16975650#comment-16975650
 ] 

Uwe Schindler commented on SOLR-13905:
--

I think this has to do that real life uses a full features Jetty server with a 
web application, which the tests use embedded Jetty that's configured in code. 
As communicated many times, we should really get rid of the webapp and do the 
productive part in the same way, but until this is done there may be some 
differenceds. I think that has to do with context resolves. getPathInfo() 
depends very hard on how the pattern is configured (if there is a wildcard in 
the servlet path) or not. 

What is exactly the difference? No pathinfo at all? Or is one giving path 
starting from context root, while the other one only the part behind the 
servlet name?

> Nullpointer exception in AuditEvent
> ---
>
> Key: SOLR-13905
> URL: https://issues.apache.org/jira/browse/SOLR-13905
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Auditlogging
>Affects Versions: 8.3
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
>Priority: Major
> Fix For: 8.4, 8.3.1
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Nullpointer exception in AuditEvent for events with HttpServletRequest as 
> input. Happens when {{getPathInfo()}} returns null, which was not caught by 
> current tests. This causes the whole request to fail, rendering the audit 
> service unusable.
> The nullpointer is experienced in the {{findRequestType()}} method when 
> performing pattern match on the resource (path).
> This is a regression from 8.3, caused by SOLR-13835 where we switched from 
> fetching the URL path from {{httpRequest.getContextPath()}} to 
> {{httpRequest.getPathInfo()}}. However while this method behaves well in 
> tests (JettyTestRunner) it returns {{null}} in production.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (SOLR-13905) Nullpointer exception in AuditEvent

2019-11-15 Thread Jira


[ 
https://issues.apache.org/jira/browse/SOLR-13905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16975161#comment-16975161
 ] 

Jan Høydahl commented on SOLR-13905:


[~uschindler] Do you have any idea why httpRequest.getPathInfo() behaves 
differently in tests and real life?

> Nullpointer exception in AuditEvent
> ---
>
> Key: SOLR-13905
> URL: https://issues.apache.org/jira/browse/SOLR-13905
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Auditlogging
>Affects Versions: 8.3
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
>Priority: Major
> Fix For: 8.4, 8.3.1
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Nullpointer exception in AuditEvent for events with HttpServletRequest as 
> input. Happens when {{getPathInfo()}} returns null, which was not caught by 
> current tests. This causes the whole request to fail, rendering the audit 
> service unusable.
> The nullpointer is experienced in the {{findRequestType()}} method when 
> performing pattern match on the resource (path).
> This is a regression from 8.3, caused by SOLR-13835 where we switched from 
> fetching the URL path from {{httpRequest.getContextPath()}} to 
> {{httpRequest.getPathInfo()}}. However while this method behaves well in 
> tests (JettyTestRunner) it returns {{null}} in production.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (SOLR-13905) Nullpointer exception in AuditEvent

2019-11-15 Thread Jira


[ 
https://issues.apache.org/jira/browse/SOLR-13905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16975151#comment-16975151
 ] 

Jan Høydahl commented on SOLR-13905:


Please see [GitHub Pull Request 
#1014|https://github.com/apache/lucene-solr/pull/1014] for the fix. I did not 
manage to reproduce the original NPE in {{findRequestType()}} in unit tests, 
since Jetty seems to behave differently in our tests and real life wrt what 
part of URL goes into servletPath and pathInfo in {{httpRequest}}. But I both 
added an explicit null check in that method as well as a safe way to construct 
the "resource" string that gets audit-logged. Also in the PR is an optimization 
of regex matching in the {{findRequestType()}} method and detection of some 
more ADMIN paths.

I'll commit on Tuesday Nov 19th. Reviews welcome.

> Nullpointer exception in AuditEvent
> ---
>
> Key: SOLR-13905
> URL: https://issues.apache.org/jira/browse/SOLR-13905
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Auditlogging
>Affects Versions: 8.3
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
>Priority: Major
> Fix For: 8.4, 8.3.1
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Nullpointer exception in AuditEvent for events with HttpServletRequest as 
> input. Happens when {{getPathInfo()}} returns null, which was not caught by 
> current tests. This causes the whole request to fail, rendering the audit 
> service unusable.
> The nullpointer is experienced in the {{findRequestType()}} method when 
> performing pattern match on the resource (path).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (SOLR-13905) Nullpointer exception in AuditEvent

2019-11-08 Thread Jira


[ 
https://issues.apache.org/jira/browse/SOLR-13905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16970054#comment-16970054
 ] 

Jan Høydahl commented on SOLR-13905:


I plan to do two changes
 * resource should never be null. This may be a regression from 8.3 when we 
switched from {{getContextPath}} to {{getPathInfo}} to get the resource
 * Check for null explicitly in {{findRequestType}} and return UNKNOWN, as a 
safeguard.
 * Also I will pre-compile all the regexes so we don't need to compile those on 
every request but instead loop through the precompiled {{List}} - for 
performance reasons.

I currently have found no way to reproduce the exact null scenario in a test, 
just in a live test environment.

> Nullpointer exception in AuditEvent
> ---
>
> Key: SOLR-13905
> URL: https://issues.apache.org/jira/browse/SOLR-13905
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: Auditlogging
>Affects Versions: 8.3
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
>Priority: Major
> Fix For: 8.4, 8.3.1
>
>
> Nullpointer exception in AuditEvent for events with HttpServletRequest as 
> input. Happens when {{getPathInfo()}} returns null, which was not caught by 
> current tests. This causes the whole request to fail, rendering the audit 
> service unusable.
> The nullpointer is experienced in the {{findRequestType()}} method when 
> performing pattern match on the resource (path).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org