-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
fixed: data-transfer import [Invalid schema changes detected during integrity checks] #15996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This pull request has been mentioned on Strapi Community Forum. There might be relevant details there: https://forum.strapi.io/t/data-import-fatal-error-on-4-6-0/25285/10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for your contribution.
Using backslashes instead of / will only fix the issue on Windows, we need to find a way to make it work both on Unix and windows systems.
Ideally, I would say we can use path.sep, but I'm kinda worried about what will happen if the archive has been created on one OS (win) and is read from a different one (Unix).
| } | ||
|
|
||
| const parts = path.relative('.', filePath).split('/'); | ||
| const parts = path.relative('.', filePath).split('\\'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing this will break the feature on all OS except Windows. We might want to look into another solution here 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as you said i also think path.sep will work for both kind of os.......can you elaborate more about archive issue by a scenario ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!
I have one doubt in mind: what happens if you make an export on an unix system on then try to import this backup on a windows machine? Are the paths resolved dynamically? Or are they stored directly in the archive signature? (honestly have no idea there)
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #15996 +/- ##
==========================================
- Coverage 60.68% 51.58% -9.11%
==========================================
Files 1495 374 -1121
Lines 36878 14078 -22800
Branches 7359 3165 -4194
==========================================
- Hits 22380 7262 -15118
+ Misses 12417 5615 -6802
+ Partials 2081 1201 -880
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1122 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
|
Even if there is a remaining bug, (exporting from one platform and importing in another), this fix can still be merged, because it is very simple and will unblock many. Meanwhile another issue can be created with I believe much lower priority. |
|
Hi, why is this issue closed? Is there a current solution to export from Linux to Windows and vice versa? It seems that the patch mentioned here will only work for files generated on Linux and imported to Windows. |
Fix: #15616
What does it do?
path.relative() method is converting
filePath = schemas\\schemas_00001.jsonlfromschemas/schemas_00001.jsonlso split method was unable to find / that's whyparts = [ 'schemas\\schemas_00001.jsonl' ]instead of['schemas', 'schemas_00001.jsonl']. Now split method splits filepath with \\ which is returned by path.relative().Why is it needed?
On
npm run strapi importwe are getting errorerror: [FATAL] Invalid schema changes detected during integrity checks (using the strict strategy)because of sourceProvider.getSchema is getting no entry from tar parse() beacuse of its filter.How to test it?
you can test it on windows by
npm run strapi importthis should successfully import all and sourceProvider.getSchema is getting schema from export fileRelated issue(s)/PR(s)
no related PRs and READY TO MERGE