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

import_demo management command doesn't work in dockerized dev environment #4414

Closed
vladox opened this issue Aug 31, 2020 · 6 comments
Closed
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.

Comments

@vladox
Copy link
Contributor

vladox commented Aug 31, 2020

Describe the bug

When running docker-compose exec --user weblate weblate weblate import_demo the following error is produced:

WARNING File parse error: FileNotFoundError: [Errno 2] No such file or directory: '/app/data/vcs/demo/gettext/weblate/langdata/locale/django.pot'

To Reproduce

Steps to reproduce the behavior:

  1. Go to folder 'dev-docker': cd dev-docker from project root
  2. Run docker-compose exec --user weblate weblate weblate import_demo
  3. See error in docker-compose logs: 
WARNING File parse error: FileNotFoundError: [Errno 2] No such file or directory: '/app/data/vcs/demo/gettext/weblate/langdata/locale/django.pot'
WARNING Handled exception: ValidationError: {'new_base': ['Base file for new translations not found.'], 'new_lang': ['Base file for new translations not found.']}

Expected behavior

As described in the documentation here a demo translation is loaded in the DB

@vladox
Copy link
Contributor Author

vladox commented Aug 31, 2020

@nijel I'm guessing cloning the following repo needs to be done somehow: https://github.com/WeblateOrg/demo
But the structure doesn't seems to match the path where the management command is looking for it.
Do you have a more detailed instructions about how to proceed?

@nijel
Copy link
Member

nijel commented Aug 31, 2020

Maybe networking doesn't work in your Docker? There is often issue with DNS resolving.

@vladox
Copy link
Contributor Author

vladox commented Sep 1, 2020

To me looks like something else, but I need to debug it, until now I couldn't find an easy way with Docker, here the stacktrace in case it helps:

Traceback (most recent call last):
  File "/usr/local/bin/weblate", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/weblate/runner.py", line 32, in main
    execute_from_command_line(argv)
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 330, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.7/dist-packages/weblate/utils/management/base.py", line 42, in execute
    return super().execute(*args, **options)
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 371, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.7/dist-packages/weblate/trans/management/commands/import_demo.py", line 54, in handle
    component.clean()
  File "/usr/local/lib/python3.7/dist-packages/weblate/trans/models/component.py", line 2128, in clean
    self.clean_new_lang()
  File "/usr/local/lib/python3.7/dist-packages/weblate/trans/models/component.py", line 2010, in clean_new_lang
    raise ValidationError({"new_base": message, "new_lang": message})
django.core.exceptions.ValidationError: {'new_base': ['Base file for new translations not found.'], 'new_lang': ['Base file for new translations not found.']}

@nijel
Copy link
Member

nijel commented Sep 1, 2020

The repository access error should raise a validation error as well.

The file path seems correct:

new_base="weblate/langdata/locale/django.pot",

The file is there:

https://github.com/WeblateOrg/demo/blob/master/weblate/langdata/locale/django.pot

Most importantly it runs fine for me and it runs fine during the CI tests.

What is content of the /app/data/vcs/demo/gettext? Is there valid checkout of the demo repository?

@nijel nijel added the question This is more a question for the support than an issue. label Sep 3, 2020
@github-actions
Copy link

github-actions bot commented Sep 3, 2020

This issue looks like a support question. We try to answer these reasonably fast, but in case you are looking for faster resolution, please consider purchasing support subscription and make Weblate stronger.

@stale
Copy link

stale bot commented Sep 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Nobody will work on this. label Sep 13, 2020
@stale stale bot closed this as completed Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.
Projects
None yet
Development

No branches or pull requests

2 participants