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

Christos Malliaridis updated SOLR-18178:
----------------------------------------
    Description: 
When a user exports a configset from a Windows instance via the Admin UI, file 
directories are flattened when the same ZIP file is reimported again. So a file 
located under {{lang/stopwords.txt}} (in {{lang/}} directory) is flattened to 
{{lang\stopwords.txt}} (not in directory). This is indicates that the exported 
ZIP is invalid. References to files under a directory like {{lang/}} are 
afterwards broken, leading to "Can't load schema null: 
org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 
'lang/contractions_it.txt".

API endpoint that was used (via Admin UI) is 
http://127.0.0.1:8983/api/schema-designer/download/films_configset.zip?configSet=films&wt=json
 (Download Config option in Schema Designer)

h2. Steps to Reproduce

To get an invalid zip export, you have to

1. Start a Solr instance on Windows
2. Create a configset via API or Admin UI
3. Download configset via 
  - the old Admin UI under Schema designer, select the configset and click 
"download config"
  - the above API endpoint (just adjust the file name and configset)

You may skip the above steps if you use the attached configset.

Then, you may use a Solr instance on any OS
1. Import the configset by uploading the ZIP file via the [Upload 
endpoint|https://solr.apache.org/guide/solr/latest/configuration-guide/configsets-api.html#configsets-upload]
2. Try editing the configset with the Schema Designer in the Admin UI

h2. Expected Behavior

The configsets can be exported and imported to allow quick and easy backup and 
restore

h2. Actual Behavior

The ZIP file is not the same after importing again and very likely cannot be 
used either (is corrupt).

h2. Workarounds

Unzip the configset and zip again the files so that the directories are "fixed" 
in the new ZIP.

h2. Additional Information

It was noticed that the exported ZIP file on all platforms contains a directory 
without any name. Perhaps this is an indicator for the root cause of the 
invalid directories.

  was:
When a user exports a configset from a Windows instance via the Admin UI, file 
directories are flattened when the same ZIP file is reimported again. This is 
indicates that the exported ZIP is invalid. References to files under a 
directory like {{lang/}} are afterwards broken, leading to "Can't load schema 
null: org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 
'lang/contractions_it.txt".

API endpoint that was used (via Admin UI) is 
http://127.0.0.1:8983/api/schema-designer/download/films_configset.zip?configSet=films&wt=json
 (Download Config option in Schema Designer)

h2. Steps to Reproduce

To get an invalid zip export, you have to

1. Start a Solr instance on Windows
2. Create a configset via API or Admin UI
3. Download configset via 
  - the old Admin UI under Schema designer, select the configset and click 
"download config"
  - the above API endpoint (just adjust the file name and configset)

You may skip the above steps if you use the attached configset.

Then, you may use a Solr instance on any OS
1. Import the configset by uploading the ZIP file via the [Upload 
endpoint|https://solr.apache.org/guide/solr/latest/configuration-guide/configsets-api.html#configsets-upload]
2. Try editing the configset with the Schema Designer in the Admin UI

h2. Expected Behavior

The configsets can be exported and imported to allow quick and easy backup and 
restore

h2. Actual Behavior

The ZIP file is not the same after importing again and very likely cannot be 
used either (is corrupt).

h2. Workarounds

Unzip the configset and zip again the files so that the directories are "fixed" 
in the new ZIP.

h2. Additional Information

It was noticed that the exported ZIP file on all platforms contains a directory 
without any name. Perhaps this is an indicator for the root cause of the 
invalid directories.


> Exported configsets from a windows instance are invalid
> -------------------------------------------------------
>
>                 Key: SOLR-18178
>                 URL: https://issues.apache.org/jira/browse/SOLR-18178
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 10.0
>         Environment: Tested on Windows 11 deployment (Solr 10.0.0).
>            Reporter: Christos Malliaridis
>            Priority: Major
>              Labels: configset, export, windows
>         Attachments: films_configset.zip
>
>
> When a user exports a configset from a Windows instance via the Admin UI, 
> file directories are flattened when the same ZIP file is reimported again. So 
> a file located under {{lang/stopwords.txt}} (in {{lang/}} directory) is 
> flattened to {{lang\stopwords.txt}} (not in directory). This is indicates 
> that the exported ZIP is invalid. References to files under a directory like 
> {{lang/}} are afterwards broken, leading to "Can't load schema null: 
> org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 
> 'lang/contractions_it.txt".
> API endpoint that was used (via Admin UI) is 
> http://127.0.0.1:8983/api/schema-designer/download/films_configset.zip?configSet=films&wt=json
>  (Download Config option in Schema Designer)
> h2. Steps to Reproduce
> To get an invalid zip export, you have to
> 1. Start a Solr instance on Windows
> 2. Create a configset via API or Admin UI
> 3. Download configset via 
>   - the old Admin UI under Schema designer, select the configset and click 
> "download config"
>   - the above API endpoint (just adjust the file name and configset)
> You may skip the above steps if you use the attached configset.
> Then, you may use a Solr instance on any OS
> 1. Import the configset by uploading the ZIP file via the [Upload 
> endpoint|https://solr.apache.org/guide/solr/latest/configuration-guide/configsets-api.html#configsets-upload]
> 2. Try editing the configset with the Schema Designer in the Admin UI
> h2. Expected Behavior
> The configsets can be exported and imported to allow quick and easy backup 
> and restore
> h2. Actual Behavior
> The ZIP file is not the same after importing again and very likely cannot be 
> used either (is corrupt).
> h2. Workarounds
> Unzip the configset and zip again the files so that the directories are 
> "fixed" in the new ZIP.
> h2. Additional Information
> It was noticed that the exported ZIP file on all platforms contains a 
> directory without any name. Perhaps this is an indicator for the root cause 
> of the invalid directories.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to