[jira] [Commented] (SOLR-12427) Status 500 on Incorrect value for start and rows

2018-06-30 Thread Jason Gerlowski (JIRA)


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

Jason Gerlowski commented on SOLR-12427:


Sorry for letting this fall off my radar.  I've committed a slightly updated 
patch which moves the tests to TestDistributedSearch, where similar 
param-validation tests were added back in SOLR-7524.

I agree that it'd be nice to improve the error message coming out of {{getInt}} 
more generally, so it mentions the parameter name, but also agree that's best 
in a separate JIRA.  (If helping with this sort of change interests you, tag me 
on the JIRA if you create one.  I'm happy to help there as well.)  Again, 
apologies for the delay.

> Status 500 on Incorrect value for start and rows
> 
>
> Key: SOLR-12427
> URL: https://issues.apache.org/jira/browse/SOLR-12427
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Munendra S N
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12427.patch, SOLR-12427.patch
>
>
> With SOLR-7254, 
> Cases, when start and rows are negatives, was handled but the case when an 
> invalid value is passed is not handled.
> Hence, Solr returns 500. It is better to return 400, as it is the client error



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (SOLR-12427) Status 500 on Incorrect value for start and rows

2018-06-30 Thread ASF subversion and git services (JIRA)


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

ASF subversion and git services commented on SOLR-12427:


Commit 9a395f83ccd83bca568056f178757dd032007140 in lucene-solr's branch 
refs/heads/branch_7x from [~gerlowskija]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9a395f8 ]

SOLR-12427: Correct status for invalid 'start', 'rows'

Prior to this commit we correctly handled negative start/rows param
values by returning a 400 (BAD REQUEST) with an appropriate error
message, but would return an ugly 500 with stack trace for non-numeric
input values.  This commit corrects this later case to also return
a 400 status code with a nicer error message.


> Status 500 on Incorrect value for start and rows
> 
>
> Key: SOLR-12427
> URL: https://issues.apache.org/jira/browse/SOLR-12427
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Munendra S N
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12427.patch, SOLR-12427.patch
>
>
> With SOLR-7254, 
> Cases, when start and rows are negatives, was handled but the case when an 
> invalid value is passed is not handled.
> Hence, Solr returns 500. It is better to return 400, as it is the client error



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (SOLR-12427) Status 500 on Incorrect value for start and rows

2018-06-30 Thread ASF subversion and git services (JIRA)


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

ASF subversion and git services commented on SOLR-12427:


Commit ea4043b954dd089e3deb27b1f70da868b383152a in lucene-solr's branch 
refs/heads/master from [~gerlowskija]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ea4043b ]

SOLR-12427: Correct status for invalid 'start', 'rows'

Prior to this commit we correctly handled negative start/rows param
values by returning a 400 (BAD REQUEST) with an appropriate error
message, but would return an ugly 500 with stack trace for non-numeric
input values.  This commit corrects this later case to also return
a 400 status code with a nicer error message.


> Status 500 on Incorrect value for start and rows
> 
>
> Key: SOLR-12427
> URL: https://issues.apache.org/jira/browse/SOLR-12427
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Munendra S N
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12427.patch, SOLR-12427.patch
>
>
> With SOLR-7254, 
> Cases, when start and rows are negatives, was handled but the case when an 
> invalid value is passed is not handled.
> Hence, Solr returns 500. It is better to return 400, as it is the client error



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (SOLR-12427) Status 500 on Incorrect value for start and rows

2018-05-31 Thread Munendra S N (JIRA)


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

Munendra S N commented on SOLR-12427:
-

[~gerlowskija]
Thanks for looking into this.

* I didn't find a good place to add the test. So, I have added it in 
_TestGroupingSearch_ (As grouping also goes through the same code block). 
Please move it to a better place.

* While working on this, I have observed that 
In *params.getInt(String param)*, when an exception is thrown the error message 
doesn't include for which param it has failed. (This is true for all number 
conversions in SolrParams)

This can be changed to something like this. This helps user as it is more 
verbose.
{code:java}
  public Integer getInt(String param) {
String val = get(param);
try {
  return val==null ? null : Integer.valueOf(val);
}
catch( Exception ex ) {
  throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "for param" 
+ param + "error" + ex.getMessage(), ex );
}
  }
{code}
I haven't made the change in this patch because the change is not related to 
this issue. Probably it should be covered separately. 

> Status 500 on Incorrect value for start and rows
> 
>
> Key: SOLR-12427
> URL: https://issues.apache.org/jira/browse/SOLR-12427
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Munendra S N
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12427.patch, SOLR-12427.patch
>
>
> With SOLR-7254, 
> Cases, when start and rows are negatives, was handled but the case when an 
> invalid value is passed is not handled.
> Hence, Solr returns 500. It is better to return 400, as it is the client error



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (SOLR-12427) Status 500 on Incorrect value for start and rows

2018-05-31 Thread Jason Gerlowski (JIRA)


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

Jason Gerlowski commented on SOLR-12427:


Thanks for adding in tests for this too.  I might move them out of 
{{TestGroupingSearch}} unless you had a good reason for putting them there?  
Nothing about the change seems specific to grouping.

But otherwise this looks good to me.  Hope to have this in this weekend.

> Status 500 on Incorrect value for start and rows
> 
>
> Key: SOLR-12427
> URL: https://issues.apache.org/jira/browse/SOLR-12427
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Munendra S N
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12427.patch, SOLR-12427.patch
>
>
> With SOLR-7254, 
> Cases, when start and rows are negatives, was handled but the case when an 
> invalid value is passed is not handled.
> Hence, Solr returns 500. It is better to return 400, as it is the client error



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (SOLR-12427) Status 500 on Incorrect value for start and rows

2018-05-31 Thread Jason Gerlowski (JIRA)


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

Jason Gerlowski commented on SOLR-12427:


Thanks for the patch Munendra.  I'll try and take this forward.  Will take a 
look at the patch soon and get some feedback back to you.

> Status 500 on Incorrect value for start and rows
> 
>
> Key: SOLR-12427
> URL: https://issues.apache.org/jira/browse/SOLR-12427
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Munendra S N
>Assignee: Jason Gerlowski
>Priority: Trivial
> Attachments: SOLR-12427.patch, SOLR-12427.patch
>
>
> With SOLR-7254, 
> Cases, when start and rows are negatives, was handled but the case when an 
> invalid value is passed is not handled.
> Hence, Solr returns 500. It is better to return 400, as it is the client error



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (SOLR-12427) Status 500 on Incorrect value for start and rows

2018-05-31 Thread Lucene/Solr QA (JIRA)


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

Lucene/Solr QA commented on SOLR-12427:
---

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 1 new or modified test 
files. {color} |
|| || || || {color:brown} master Compile Tests {color} ||
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  4m  
1s{color} | {color:green} master passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  4m 
57s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  4m 
57s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Release audit (RAT) {color} | 
{color:green}  4m 57s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Check forbidden APIs {color} | 
{color:green}  4m 57s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Validate source patterns {color} | 
{color:green}  4m 57s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:red}-1{color} | {color:red} unit {color} | {color:red}203m  5s{color} 
| {color:red} core in the patch failed. {color} |
| {color:black}{color} | {color:black} {color} | {color:black}217m 56s{color} | 
{color:black} {color} |
\\
\\
|| Reason || Tests ||
| Failed junit tests | solr.cloud.HttpPartitionTest |
|   | solr.cloud.autoscaling.sim.TestLargeCluster |
\\
\\
|| Subsystem || Report/Notes ||
| JIRA Issue | SOLR-12427 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/12925787/SOLR-12427.patch |
| Optional Tests |  compile  javac  unit  ratsources  checkforbiddenapis  
validatesourcepatterns  |
| uname | Linux lucene2-us-west.apache.org 4.4.0-112-generic #135-Ubuntu SMP 
Fri Jan 19 11:48:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | ant |
| Personality | 
/home/jenkins/jenkins-slave/workspace/PreCommit-SOLR-Build/sourcedir/dev-tools/test-patch/lucene-solr-yetus-personality.sh
 |
| git revision | master / 7626308 |
| ant | version: Apache Ant(TM) version 1.9.6 compiled on July 8 2015 |
| Default Java | 1.8.0_172 |
| unit | 
https://builds.apache.org/job/PreCommit-SOLR-Build/109/artifact/out/patch-unit-solr_core.txt
 |
|  Test Results | 
https://builds.apache.org/job/PreCommit-SOLR-Build/109/testReport/ |
| modules | C: solr/core U: solr/core |
| Console output | 
https://builds.apache.org/job/PreCommit-SOLR-Build/109/console |
| Powered by | Apache Yetus 0.7.0   http://yetus.apache.org |


This message was automatically generated.



> Status 500 on Incorrect value for start and rows
> 
>
> Key: SOLR-12427
> URL: https://issues.apache.org/jira/browse/SOLR-12427
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Munendra S N
>Priority: Trivial
> Attachments: SOLR-12427.patch, SOLR-12427.patch
>
>
> With SOLR-7254, 
> Cases, when start and rows are negatives, was handled but the case when an 
> invalid value is passed is not handled.
> Hence, Solr returns 500. It is better to return 400, as it is the client error



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (SOLR-12427) Status 500 on Incorrect value for start and rows

2018-05-30 Thread Munendra S N (JIRA)


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

Munendra S N commented on SOLR-12427:
-

 [^SOLR-12427.patch] 
This one uses params.getInt() instead of implementing new method

> Status 500 on Incorrect value for start and rows
> 
>
> Key: SOLR-12427
> URL: https://issues.apache.org/jira/browse/SOLR-12427
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Munendra S N
>Priority: Trivial
> Attachments: SOLR-12427.patch, SOLR-12427.patch
>
>
> With SOLR-7254, 
> Cases, when start and rows are negatives, was handled but the case when an 
> invalid value is passed is not handled.
> Hence, Solr returns 500. It is better to return 400, as it is the client error



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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