You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@manifoldcf.apache.org by "Shinichiro Abe (JIRA)" <ji...@apache.org> on 2011/09/13 06:03:09 UTC

[jira] [Created] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Bad request when posting 0 byte file to Solr
--------------------------------------------

                 Key: CONNECTORS-254
                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
             Project: ManifoldCF
          Issue Type: Bug
          Components: Lucene/SOLR connector
    Affects Versions: ManifoldCF 0.2, ManifoldCF 0.1, ManifoldCF 0.3
            Reporter: Shinichiro Abe
            Priority: Minor
             Fix For: ManifoldCF 0.3


It seems that httpposter brings about bad request when posting 0 byte file.

Solr log say the below. "missing content stream". Status code is 400. 
On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.


 
2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
2011/09/13 12:30:40 org.apache.solr.common.SolrException log
?v???I: org.apache.solr.common.SolrException: missing content stream
	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Posted by "Karl Wright (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13103465#comment-13103465 ] 

Karl Wright commented on CONNECTORS-254:
----------------------------------------

I have some concerns about this approach.

First, I'm not sure it is the right thing to do.  It would be good to know more about the case you are comparing against when you say "On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally."  How are you posting the content normally?  When you post the content in that way, what does the entire http request look like?  You can use Wireshark to capture it, or I can, so we can see exactly what happens in that case.

Second, if it turns out that adding a space is the correct thing to do, I'm concerned because this change is not being reflected in the content-length header.  If the header reports a different length than what is posted, the posted data will be truncated.  This may be the whole goal, though, in which case we should add a comment to the code noting that the content MUST be the last field posted for this reason.


> Bad request when posting 0 byte file to Solr
> --------------------------------------------
>
>                 Key: CONNECTORS-254
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Lucene/SOLR connector
>    Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3
>            Reporter: Shinichiro Abe
>            Priority: Minor
>             Fix For: ManifoldCF 0.3
>
>         Attachments: CONNECTORS-254-1.patch, sample0byte.zip
>
>
> It seems that httpposter brings about bad request when posting 0 byte file.
> Solr log say the below. "missing content stream". Status code is 400. 
> On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.
>  
> 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
> ???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
> 2011/09/13 12:30:40 org.apache.solr.common.SolrException log
> ?v???I: org.apache.solr.common.SolrException: missing content stream
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Posted by "Karl Wright (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13104449#comment-13104449 ] 

Karl Wright commented on CONNECTORS-254:
----------------------------------------

I created a Solr ticket for the problem.  SOLR-2763.


> Bad request when posting 0 byte file to Solr
> --------------------------------------------
>
>                 Key: CONNECTORS-254
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Lucene/SOLR connector
>    Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3
>            Reporter: Shinichiro Abe
>            Priority: Minor
>             Fix For: ManifoldCF 0.3
>
>         Attachments: CONNECTORS-254-1.patch, sample0byte.zip
>
>
> It seems that httpposter brings about bad request when posting 0 byte file.
> Solr log say the below. "missing content stream". Status code is 400. 
> On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.
>  
> 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
> ???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
> 2011/09/13 12:30:40 org.apache.solr.common.SolrException log
> ?v???I: org.apache.solr.common.SolrException: missing content stream
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Posted by "Karl Wright (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13104317#comment-13104317 ] 

Karl Wright commented on CONNECTORS-254:
----------------------------------------

It appears that the major difference is that curl's POST is not a multi-part post.  It's apparently the multi-part form post with zero-length content that Solr (or Jetty) doesn't like.

The Solr connector must use multi-part in order to include other fields such as metadata, so it's not an option to do things just like post.sh does.  Can you modify the curl POST command to do a multi-part form post, and try that with a zero-length file?  Then we can really compare apples against apples.

> Bad request when posting 0 byte file to Solr
> --------------------------------------------
>
>                 Key: CONNECTORS-254
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Lucene/SOLR connector
>    Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3
>            Reporter: Shinichiro Abe
>            Priority: Minor
>             Fix For: ManifoldCF 0.3
>
>         Attachments: CONNECTORS-254-1.patch, sample0byte.zip
>
>
> It seems that httpposter brings about bad request when posting 0 byte file.
> Solr log say the below. "missing content stream". Status code is 400. 
> On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.
>  
> 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
> ???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
> 2011/09/13 12:30:40 org.apache.solr.common.SolrException log
> ?v???I: org.apache.solr.common.SolrException: missing content stream
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Posted by "Karl Wright (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Wright resolved CONNECTORS-254.
------------------------------------

    Resolution: Not A Problem
      Assignee: Shinichiro Abe

Solr fix was made

> Bad request when posting 0 byte file to Solr
> --------------------------------------------
>
>                 Key: CONNECTORS-254
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Lucene/SOLR connector
>    Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3
>            Reporter: Shinichiro Abe
>            Assignee: Shinichiro Abe
>            Priority: Minor
>             Fix For: ManifoldCF 0.4
>
>         Attachments: CONNECTORS-254-1.patch, sample0byte.zip
>
>
> It seems that httpposter brings about bad request when posting 0 byte file.
> Solr log say the below. "missing content stream". Status code is 400. 
> On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.
>  
> 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
> ???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
> 2011/09/13 12:30:40 org.apache.solr.common.SolrException log
> ?v???I: org.apache.solr.common.SolrException: missing content stream
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Posted by "Karl Wright (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Wright updated CONNECTORS-254:
-----------------------------------

    Fix Version/s:     (was: ManifoldCF 0.3)
                   ManifoldCF 0.4

It looks like Solr fix is going to be done.


> Bad request when posting 0 byte file to Solr
> --------------------------------------------
>
>                 Key: CONNECTORS-254
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Lucene/SOLR connector
>    Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3
>            Reporter: Shinichiro Abe
>            Priority: Minor
>             Fix For: ManifoldCF 0.4
>
>         Attachments: CONNECTORS-254-1.patch, sample0byte.zip
>
>
> It seems that httpposter brings about bad request when posting 0 byte file.
> Solr log say the below. "missing content stream". Status code is 400. 
> On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.
>  
> 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
> ???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
> 2011/09/13 12:30:40 org.apache.solr.common.SolrException log
> ?v???I: org.apache.solr.common.SolrException: missing content stream
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Posted by "Shinichiro Abe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shinichiro Abe updated CONNECTORS-254:
--------------------------------------

    Attachment: sample0byte.zip

> Bad request when posting 0 byte file to Solr
> --------------------------------------------
>
>                 Key: CONNECTORS-254
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Lucene/SOLR connector
>    Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3
>            Reporter: Shinichiro Abe
>            Priority: Minor
>             Fix For: ManifoldCF 0.3
>
>         Attachments: sample0byte.zip
>
>
> It seems that httpposter brings about bad request when posting 0 byte file.
> Solr log say the below. "missing content stream". Status code is 400. 
> On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.
>  
> 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
> ???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
> 2011/09/13 12:30:40 org.apache.solr.common.SolrException log
> ?v???I: org.apache.solr.common.SolrException: missing content stream
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Posted by "Karl Wright (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13103639#comment-13103639 ] 

Karl Wright commented on CONNECTORS-254:
----------------------------------------

The curl command you have described is not even a POST, it's a GET.  The document itself is not being sent, just the file name.  The stream.file argument may well be used by Solr on the update handler side to open the file directly.  That's not going to work with ManifoldCF though because there's no guarantee of a shared file system between ManifoldCF and the Solr instance.



> Bad request when posting 0 byte file to Solr
> --------------------------------------------
>
>                 Key: CONNECTORS-254
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Lucene/SOLR connector
>    Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3
>            Reporter: Shinichiro Abe
>            Priority: Minor
>             Fix For: ManifoldCF 0.3
>
>         Attachments: CONNECTORS-254-1.patch, sample0byte.zip
>
>
> It seems that httpposter brings about bad request when posting 0 byte file.
> Solr log say the below. "missing content stream". Status code is 400. 
> On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.
>  
> 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
> ???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
> 2011/09/13 12:30:40 org.apache.solr.common.SolrException log
> ?v???I: org.apache.solr.common.SolrException: missing content stream
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Posted by "Shinichiro Abe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13103670#comment-13103670 ] 

Shinichiro Abe commented on CONNECTORS-254:
-------------------------------------------

I'm sorry. 
I modified post.sh and posted 0 byte file. But the exception isn't thrown in this case. Is this a GET?
 
---
FILES=$*
URL=http://localhost:8983/solr/update/extract?literal.id=1

for f in $FILES; do
  curl $URL --data-binary @$f -H 'Content-type:application/octet-stream' 
done
---

> Bad request when posting 0 byte file to Solr
> --------------------------------------------
>
>                 Key: CONNECTORS-254
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Lucene/SOLR connector
>    Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3
>            Reporter: Shinichiro Abe
>            Priority: Minor
>             Fix For: ManifoldCF 0.3
>
>         Attachments: CONNECTORS-254-1.patch, sample0byte.zip
>
>
> It seems that httpposter brings about bad request when posting 0 byte file.
> Solr log say the below. "missing content stream". Status code is 400. 
> On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.
>  
> 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
> ???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
> 2011/09/13 12:30:40 org.apache.solr.common.SolrException log
> ?v???I: org.apache.solr.common.SolrException: missing content stream
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Posted by "Shinichiro Abe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shinichiro Abe updated CONNECTORS-254:
--------------------------------------

    Attachment: CONNECTORS-254-1.patch

When the stream length is zero, it replaces space. If this procedure is okay, I'll modify the indent around that.

> Bad request when posting 0 byte file to Solr
> --------------------------------------------
>
>                 Key: CONNECTORS-254
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Lucene/SOLR connector
>    Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3
>            Reporter: Shinichiro Abe
>            Priority: Minor
>             Fix For: ManifoldCF 0.3
>
>         Attachments: CONNECTORS-254-1.patch, sample0byte.zip
>
>
> It seems that httpposter brings about bad request when posting 0 byte file.
> Solr log say the below. "missing content stream". Status code is 400. 
> On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.
>  
> 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
> ???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
> 2011/09/13 12:30:40 org.apache.solr.common.SolrException log
> ?v???I: org.apache.solr.common.SolrException: missing content stream
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Posted by "Shinichiro Abe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13103632#comment-13103632 ] 

Shinichiro Abe commented on CONNECTORS-254:
-------------------------------------------

I agree. My approach was hasty. I'll examine again.(especially adding a space)

At least the following results in posting normally on Solr. the exception isn't thrown. 

curl "http://localhost:8983/solr/update/extract?literal.id=1&stream.file=/path/to/0bytefile&commit=true" 

I want to make the same behavior for httpposter. What do you think about this?

> Bad request when posting 0 byte file to Solr
> --------------------------------------------
>
>                 Key: CONNECTORS-254
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Lucene/SOLR connector
>    Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3
>            Reporter: Shinichiro Abe
>            Priority: Minor
>             Fix For: ManifoldCF 0.3
>
>         Attachments: CONNECTORS-254-1.patch, sample0byte.zip
>
>
> It seems that httpposter brings about bad request when posting 0 byte file.
> Solr log say the below. "missing content stream". Status code is 400. 
> On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.
>  
> 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
> ???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
> 2011/09/13 12:30:40 org.apache.solr.common.SolrException log
> ?v???I: org.apache.solr.common.SolrException: missing content stream
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Posted by "Karl Wright (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13104330#comment-13104330 ] 

Karl Wright commented on CONNECTORS-254:
----------------------------------------

I fooled around with curl and found the command we need.  Here it is (assuming hello.txt is a zero-length file):

curl --trace dump.out -location -F "id=123" -F "file=@hello.txt" http://localhost:8983/solr/update/extract

The --trace option dumps a trace file which is essentially equivalent to wireshark output.  Good to know.  Anyway, when I try this, I get the following in Solr:

Sep 14, 2011 3:45:45 AM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: missing content stream
        at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:50)
        at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
        at org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:238)
        at org.apache.solr.core.SolrCore.execute(SolrCore.java:1360)
        at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
        at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Sep 14, 2011 3:45:45 AM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/update/extract params={id=123} status=400 QTime=300

If this looks familiar, it's because we get the exact same trace when multi-part form posting from ManifoldCF.  So there is apparently a bug in Solr, and there's no magic here.

My suggestion is that you follow up by creating a Solr ticket, trying to be sure there isn't one already.  I'll ping Simon and see if he knows anything.


> Bad request when posting 0 byte file to Solr
> --------------------------------------------
>
>                 Key: CONNECTORS-254
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Lucene/SOLR connector
>    Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3
>            Reporter: Shinichiro Abe
>            Priority: Minor
>             Fix For: ManifoldCF 0.3
>
>         Attachments: CONNECTORS-254-1.patch, sample0byte.zip
>
>
> It seems that httpposter brings about bad request when posting 0 byte file.
> Solr log say the below. "missing content stream". Status code is 400. 
> On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.
>  
> 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
> ???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
> 2011/09/13 12:30:40 org.apache.solr.common.SolrException log
> ?v???I: org.apache.solr.common.SolrException: missing content stream
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CONNECTORS-254) Bad request when posting 0 byte file to Solr

Posted by "Karl Wright (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13103678#comment-13103678 ] 

Karl Wright commented on CONNECTORS-254:
----------------------------------------

The --data-binary switch to curl causes it to use POST.  Here's a bit of the manpage:

 --data-binary <data>
              (HTTP) This posts data exactly as specified with no  extra  proĆ¢
              cessing whatsoever.

So, what happens when you use curl to post your zero-length file?  Do you get back a 400 response?  Try using the CURL -vvv switch to see what it is doing.

If it comes back with a 200 OK response and not a 400, then either you or I should try to do the same thing while Wireshark is capturing packets.  If you are using a Linux system, you could instead want to use tcpdump to do the capture, and then examine the capture with Wireshark (on Windows).  If this is too confusing, now that I have a test case I can try to do this later today.


> Bad request when posting 0 byte file to Solr
> --------------------------------------------
>
>                 Key: CONNECTORS-254
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-254
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Lucene/SOLR connector
>    Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3
>            Reporter: Shinichiro Abe
>            Priority: Minor
>             Fix For: ManifoldCF 0.3
>
>         Attachments: CONNECTORS-254-1.patch, sample0byte.zip
>
>
> It seems that httpposter brings about bad request when posting 0 byte file.
> Solr log say the below. "missing content stream". Status code is 400. 
> On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally.
>  
> 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute
> ???: [] webapp=/solr path=/update/extract params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} status=400 QTime=367 
> 2011/09/13 12:30:40 org.apache.solr.common.SolrException log
> ?v???I: org.apache.solr.common.SolrException: missing content stream
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira