Skip to content
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

Backup does not restore #8905

Closed
2 tasks done
fynngodau opened this issue Mar 9, 2023 · 3 comments · Fixed by #8926
Closed
2 tasks done

Backup does not restore #8905

fynngodau opened this issue Mar 9, 2023 · 3 comments · Fixed by #8926
Assignees
Labels
bug Something is broken.
Milestone

Comments

@fynngodau
Copy link

fynngodau commented Mar 9, 2023

Describe the issue

I am trying to import a backup from a project exported on another Weblate instance. This is not successful and yields the following cryptic error message:

Failed to load project backup: '' is too short Failed validating 'minLength' in schema['items']['properties']['source']: {'$id': '#/items/properties/source', 'default': '', 'examples': ['Hello'], 'minLength': 1, 'title': 'The Source String', 'type': 'string'} On instance[81]['source']: ''

Unfortunately I do not understand what this means and failed to find and fix the problem in my backup ZIP manually.

Both instances are running the same weblate version. Two other projects have successfully exported and imported in this combination of instances.

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

Expected behavior

The backup should import successfully.

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker

Weblate versions

Both instances run 4.16.2

Weblate deploy checks

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented Mar 10, 2023

The problem is that there is an empty string in the translation memory (inside weblate-memory.json):

  {
    "source": "",
    "target": " ",
    "source_language": "en",
    "target_language": "pt_BR",
    "origin": "librariesdirect/librariesdirect",
    "category": 10000003
  }

Removing it should fix the import.

Still, Weblate should handle this gracefully.

@nijel nijel added the bug Something is broken. label Mar 10, 2023
@nijel nijel added this to the 4.17 milestone Mar 10, 2023
@fynngodau
Copy link
Author

Thanks, I've removed the faulty entry from my JSON file and the import was now successful.

@nijel nijel self-assigned this Mar 14, 2023
nijel added a commit to nijel/weblate that referenced this issue Mar 14, 2023
nijel added a commit that referenced this issue Mar 14, 2023
@github-actions
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

@nijel nijel modified the milestones: 4.17, 5.0 Aug 22, 2023
nijel added a commit that referenced this issue Aug 22, 2023
The check was previously done at the unit level what skipped some of the
entries.

Fixes #8905
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants