[
https://issues.apache.org/jira/browse/SOLR-18178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18120970#comment-18120970
]
Nick Shanin commented on SOLR-18178:
------------------------------------
I opened PR #4968 for SOLR-18178.
Configset archives built ZIP entry names with OS-native separators, so archives
produced on Windows carried backslash entry names that broke extraction. The PR
normalizes archive entry names to forward slashes in DownloadConfigSet,
UploadConfigSet, and FileSystemConfigSetService, with test coverage for
archives containing subdirectories.
Focused tests and core formatting checks passed.
PR: https://github.com/apache/solr/pull/4968
> 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, pull-request-available, windows
> Attachments: films_configset.zip
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> 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]