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

Crash when changing review state to Approved #11420

Closed
2 tasks done
dngduy132 opened this issue Apr 17, 2024 · 2 comments
Closed
2 tasks done

Crash when changing review state to Approved #11420

dngduy132 opened this issue Apr 17, 2024 · 2 comments
Labels
bug Something is broken. duplicate Similar issue or pull request already exists.
Milestone

Comments

@dngduy132
Copy link

dngduy132 commented Apr 17, 2024

Describe the issue

Hello. When trying to change the review state to Approved, we get hit by a server error like the one uploaded at the screen shot and the state not being updated

I already tried

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

Steps to reproduce the behavior

  1. Go to the component that needs to change the state
  2. Change the review state to "Approved"
  3. Click "save and stay"

Expected behavior

State of the string change to "Approved"

Screenshots

  1. Server error
    image
  2. Step to reproduce
    2.1. Go to the component that needs to change the state
    image
    2.2. Change the review state to "Approved"
    image

Exception traceback

Traceback (most recent call last):
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
gunicorn stderr |     response = get_response(request)
gunicorn stderr |                ^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
gunicorn stderr |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
gunicorn stderr |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/contextlib.py", line 81, in inner
gunicorn stderr |     return func(*args, **kwds)
gunicorn stderr |            ^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/trans/views/edit.py", line 641, in translate
gunicorn stderr |     response = handle_translate(request, unit, this_unit_url, next_unit_url)
gunicorn stderr |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/utils/ratelimit.py", line 132, in rate_wrap
gunicorn stderr |     return function(request, *args, **kwargs)
gunicorn stderr |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/trans/views/edit.py", line 421, in handle_translate
gunicorn stderr |     go_next = perform_translation(unit, form, request)
gunicorn stderr |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/trans/views/edit.py", line 335, in perform_translation
gunicorn stderr |     saved = unit.translate(
gunicorn stderr |             ^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/contextlib.py", line 81, in inner
gunicorn stderr |     return func(*args, **kwds)
gunicorn stderr |            ^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/trans/models/unit.py", line 1476, in translate
gunicorn stderr |     saved = self.save_backend(
gunicorn stderr |             ^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/trans/models/unit.py", line 1065, in save_backend
gunicorn stderr |     self.commit_if_pending(author)
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/trans/models/unit.py", line 1040, in commit_if_pending
gunicorn stderr |     self.translation.commit_pending("pending unit", None)
gunicorn stderr |   File "/usr/local/lib/python3.12/contextlib.py", line 81, in inner
gunicorn stderr |     return func(*args, **kwds)
gunicorn stderr |            ^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/trans/models/translation.py", line 560, in commit_pending
gunicorn stderr |     return self.component.commit_pending(reason, user, skip_push=skip_push)
gunicorn stderr |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/trans/models/component.py", line 194, in on_link_wrapper
gunicorn stderr |     return getattr(linked, func.__name__)(*args, **kwargs)
gunicorn stderr |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/trans/models/component.py", line 195, in on_link_wrapper
gunicorn stderr |     return func(self, *args, **kwargs)
gunicorn stderr |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/trans/models/component.py", line 1957, in commit_pending
gunicorn stderr |     translation._commit_pending(reason, user)
gunicorn stderr |   File "/usr/local/lib/python3.12/contextlib.py", line 81, in inner
gunicorn stderr |     return func(*args, **kwds)
gunicorn stderr |            ^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/trans/models/translation.py", line 611, in _commit_pending
gunicorn stderr |     self.update_units(units, store, author_name, author.id)
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/trans/models/translation.py", line 807, in update_units
gunicorn stderr |     store.save()
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/formats/ttkit.py", line 334, in save
gunicorn stderr |     self.save_atomic(self.storefile, self.save_content)
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/formats/base.py", line 434, in save_atomic
gunicorn stderr |     callback(temp)
gunicorn stderr |   File "/usr/local/lib/python3.12/site-packages/weblate/formats/external.py", line 63, in save_content
gunicorn stderr |     ILLEGAL_CHARACTERS_RE.sub("", data[field]),
gunicorn stderr |                                   ~~~~^^^^^^^
gunicorn stderr | KeyError: ''

How do you run Weblate?

Docker container

Weblate versions

5.4.1

Weblate deploy checks

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented Apr 17, 2024

Please upgrade, I think this has been already fixed

@nijel nijel added this to the 5.4.3 milestone Apr 17, 2024
@nijel nijel added bug Something is broken. duplicate Similar issue or pull request already exists. labels Apr 17, 2024
@nijel
Copy link
Member

nijel commented Apr 17, 2024

Duplicate of #11231

@nijel nijel marked this as a duplicate of #11231 Apr 17, 2024
@nijel nijel closed this as not planned Won't fix, can't repro, duplicate, stale Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken. duplicate Similar issue or pull request already exists.
Projects
None yet
Development

No branches or pull requests

2 participants