WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.46k stars 988 forks source link

InvalidHeaderDefect #12067

Closed sal0max closed 1 month ago

sal0max commented 1 month ago

Describe the issue

I'm using the Weblate instance on https://translate.codeberg.org for quite some time now. Never had a problem, until now.

Currently, there are 8 pending changes, made by 3 users. When I try to commit them, I get following error:

Server Error The server had serious problems serving your request. You might want to contact server admins in case the error persists.

I contacted the host and received the error log, tied to my problem. I've attatched them in this issue.

I already tried

Steps to reproduce the behavior

You can check out the repository here: https://translate.codeberg.org/projects/currencies/#history

All fine, until the translation of Persian by Vasilis_Kos. This or one of the following changes seems to cause the problem.

Expected behavior

No response

Screenshots

No response

Exception traceback

Traceback (most recent call last):
  File "/app/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/django/views/decorators/http.py", line 64, in inner
    return func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/weblate/trans/views/git.py", line 140, in commit
    return execute_locked(

  File "/app/venv/lib/python3.12/site-packages/weblate/trans/views/git.py", line 21, in execute_locked
    result = call(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/weblate/trans/models/project.py", line 389, in commit_pending
    return self.on_repo_components(True, "commit_pending", reason, user)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/weblate/trans/models/project.py", line 383, in on_repo_components
    return all(list(generator))
               ^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/weblate/trans/models/project.py", line 378, in <genexpr>
    getattr(component, func)(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/weblate/trans/models/component.py", line 199, in on_link_wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/weblate/trans/models/component.py", line 1990, in commit_pending
    translation._commit_pending(reason, user)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/weblate/trans/models/translation.py", line 604, in _commit_pending
    author_name = author.get_author_name()
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/weblate/auth/models.py", line 782, in get_author_name
    return format_address(

  File "/app/venv/lib/python3.12/site-packages/weblate/auth/utils.py", line 139, in format_address
    Address(
    ^
  File "/usr/local/lib/python3.12/email/headerregistry.py", line 49, in __init__
    raise a_s.all_defects[0]
    ^^^^^^^^^^^^^^^^^^^^^^^^

Exception Type: InvalidHeaderDefect at /commit/currencies/
Exception Value: local-part is not dot-atom, quoted-string, or obs-local-part
Raised during: weblate.trans.views.git.commit

How do you run Weblate?

Other

Weblate versions

5.6.2

Weblate deploy checks

No response

Additional context

No response

nijel commented 1 month ago

Seems like that user has an invalid e-mail address. https://github.com/WeblateOrg/weblate/pull/12073 should avoid such an e-mail from being used by Weblate in the future, but you will have to fix it for this user manually.

github-actions[bot] commented 1 month ago

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

github-actions[bot] commented 1 month ago

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