[ 
https://issues.apache.org/jira/browse/SOLR-16814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Will White updated SOLR-16814:
------------------------------
    Description: 
When building a Docker image from {{main}} the mime type handling no longer 
handles application/json presented as text/plain when it previously did so (as 
of 9.2).

Cause of change: https://github.com/apache/solr/pull/1575

Reproduction steps:
* Checkout Solr to {{main}}
* Build local image via {{./gradlew docker}}
* Run this image in cloud mode, including {{-Denable.packages=true}}
* Open shell on container (e.g. {{docker compose exec NAME /bin/bash}})
* Run {{bin/solr package add-repo data-import-handler 
"https://raw.githubusercontent.com/searchscale/dataimporthandler/master/repo"}}

This will attempt to pull down the repository.json file (which 
githubusercontent provides as text/plain), and it will throw an error.

Error message:
{code:bash}
/opt/solr-10.0.0-SNAPSHOT$ bin/solr package add-repo data-import-handler 
"https://raw.githubusercontent.com/searchscale/dataimporthandler/master/repo";

Found 1 Solr nodes: 

Solr process 14 running on port 8983
com.fasterxml.jackson.databind.JsonMappingException: Error from server at 
https://raw.githubusercontent.com/searchscale/dataimporthandler/master/repo/repository.json?wt=json&version=2.2:
 Expected mime type in [application/json] but got text/plain.
{code}

The contents of that file are valid JSON, but don't have the correct header 
type sent back.

This does correctly reduce the attack surface of the image (as SOLR-16752 
intends), but I've opened this ticket as a loss of behaviour which might impact 
SolrCloud users.

  was:
When building a Docker image from {{main}} the mime type handling no longer 
handles application/json presented as text/plain when it previously did so (as 
of 9.2).

Cause of change: https://github.com/apache/solr/pull/1575

Reproduction steps:
* Checkout Solr to {{main}}
* Build local image via {{./gradlew docker}}
* Run this image in cloud mode, including {{-Denable.packages=true}}
* Open shell on container (e.g. {{docker compose exec NAME /bin/bash}})
* Run {{bin/solr package add-repo data-import-handler 
"https://raw.githubusercontent.com/searchscale/dataimporthandler/master/repo"}}

This will attempt to pull down the repository.json file (which 
githubusercontent provides as text/plain), and it will throw an error.

Error message:
{code:bash}
/opt/solr-10.0.0-SNAPSHOT$ bin/solr package add-repo data-import-handler 
"https://raw.githubusercontent.com/searchscale/dataimporthandler/master/repo";

Found 1 Solr nodes: 

Solr process 14 running on port 8983
com.fasterxml.jackson.databind.JsonMappingException: Error from server at 
https://raw.githubusercontent.com/searchscale/dataimporthandler/master/repo/repository.json?wt=json&version=2.2:
 Expected mime type in [application/json] but got text/plain.
{code}


> Package tool 'add-repo' command fails on mime type handling inside Docker 
> image for text/plain sources
> ------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-16814
>                 URL: https://issues.apache.org/jira/browse/SOLR-16814
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Package Manager
>    Affects Versions: main (10.0)
>            Reporter: Will White
>            Priority: Minor
>
> When building a Docker image from {{main}} the mime type handling no longer 
> handles application/json presented as text/plain when it previously did so 
> (as of 9.2).
> Cause of change: https://github.com/apache/solr/pull/1575
> Reproduction steps:
> * Checkout Solr to {{main}}
> * Build local image via {{./gradlew docker}}
> * Run this image in cloud mode, including {{-Denable.packages=true}}
> * Open shell on container (e.g. {{docker compose exec NAME /bin/bash}})
> * Run {{bin/solr package add-repo data-import-handler 
> "https://raw.githubusercontent.com/searchscale/dataimporthandler/master/repo"}}
> This will attempt to pull down the repository.json file (which 
> githubusercontent provides as text/plain), and it will throw an error.
> Error message:
> {code:bash}
> /opt/solr-10.0.0-SNAPSHOT$ bin/solr package add-repo data-import-handler 
> "https://raw.githubusercontent.com/searchscale/dataimporthandler/master/repo";
> Found 1 Solr nodes: 
> Solr process 14 running on port 8983
> com.fasterxml.jackson.databind.JsonMappingException: Error from server at 
> https://raw.githubusercontent.com/searchscale/dataimporthandler/master/repo/repository.json?wt=json&version=2.2:
>  Expected mime type in [application/json] but got text/plain.
> {code}
> The contents of that file are valid JSON, but don't have the correct header 
> type sent back.
> This does correctly reduce the attack surface of the image (as SOLR-16752 
> intends), but I've opened this ticket as a loss of behaviour which might 
> impact SolrCloud users.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to