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

Git fatal: name consists only of disallowed characters when trying to commit translations #9462

Closed
2 tasks done
hhyyrylainen opened this issue Jun 26, 2023 · 11 comments
Closed
2 tasks done
Labels
bug Something is broken.
Milestone

Comments

@hhyyrylainen
Copy link

Describe the issue

I was trying to get weblate to play nice with a rewritten git history. I tried all the buttons in the maintenance GUI and even deleting the repo on disk, but I could not manage to get the change count listed in the repository maintenance page on weblate to go down to 0. Now I have probably messed something up as I can't even commit the changes in weblate. I just get an internal server error when trying to commit changes in weblate:

Internal Server Error: /commit/thrive/thrive-game/

RepositoryException at /commit/thrive/thrive-game/
fatal: name consists only of disallowed characters: "
 (128)

Request Method: POST
Request URL: https://translate.revolutionarygamesstudio.com/commit/thrive/thrive-game/

I found an earlier issue about a translator having forbidden characters in their username causing git to fail. I don't know how I would check to confirm if this is the same problem. I tried using the git squash plugin to put all changes into a single commit but I still get the same error.

I already tried

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

Steps to reproduce the behavior

  1. Go to "repository maintenance" admin page
  2. Click on "commit"
  3. Get an internal server error

Expected behavior

I expect some of the repo maintenance / deleting things manually to get things at least fixed enough to be able to resume using weblate.

Screenshots

No response

Exception traceback

Traceback (most recent call last):
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/django/views/decorators/http.py", line 43, in inner
    return func(request, *args, **kwargs)
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/weblate/trans/views/git.py", line 129, in commit_component
    return perform_commit(request, obj)
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/weblate/trans/views/git.py", line 45, in perform_commit
    return execute_locked(
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/weblate/trans/views/git.py", line 21, in execute_locked
    result = call(*args, **kwargs)
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/weblate/trans/models/component.py", line 174, in on_link_wrapper
    return func(self, *args, **kwargs)
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/weblate/trans/models/component.py", line 1770, in commit_pending
    translation._commit_pending(reason, user)
  File "/usr/lib64/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/weblate/trans/models/translation.py", line 629, in _commit_pending
    self.git_commit(user, author_name, timestamp, skip_push=True, signals=False)
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/weblate/trans/models/translation.py", line 684, in git_commit
    if not self.component.commit_files(
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/weblate/trans/models/component.py", line 1822, in commit_files
    if not self.repository.commit(message, author, timestamp, files):
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/weblate/vcs/git.py", line 337, in commit
    self.execute(cmd, stdin=message)
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/weblate/vcs/base.py", line 221, in execute
    self.last_output = self._popen(
  File "/home/weblate/weblate-env/lib/python3.10/site-packages/weblate/vcs/base.py", line 200, in _popen
    raise RepositoryException(

How do you run Weblate?

PyPI module

Weblate versions

  • Weblate: 4.16.4
  • Django: 4.1.1
  • siphashc: 2.1
  • translate-toolkit: 3.8.6
  • lxml: 4.9.1
  • Pillow: 9.2.0
  • nh3: 0.2.8
  • python-dateutil: 2.8.2
  • social-auth-core: 4.3.0
  • social-auth-app-django: 5.0.0
  • django-crispy-forms: 2.0
  • oauthlib: 3.2.0
  • django-compressor: 4.1
  • djangorestframework: 3.13.1
  • django-filter: 22.1
  • django-appconf: 1.0.5
  • user-agents: 2.2.0
  • filelock: 3.8.0
  • rapidfuzz: 2.6.1
  • openpyxl: 3.0.10
  • celery: 5.2.7
  • django-celery-beat: 2.5.0
  • kombu: 5.2.4
  • translation-finder: 2.15
  • weblate-language-data: 2022.7
  • html2text: 2020.1.16
  • pycairo: 1.21.0
  • pygobject: 3.42.2
  • diff-match-patch: 20200713
  • requests: 2.28.1
  • django-redis: 5.2.0
  • hiredis: 2.0.0
  • sentry_sdk: 1.9.8
  • Cython: 0.29.32
  • misaka: 2.1.1
  • GitPython: 3.1.27
  • borgbackup: 1.2.2
  • pyparsing: 3.0.9
  • pyahocorasick: 1.4.4
  • python-redis-lock: 4.0.0
  • charset-normalizer: 2.1.1
  • Python: 3.10.11
  • Git: 2.40.1
  • psycopg2: 2.9.3
  • psycopg2-binary: 2.9.3
  • phply: 1.2.6
  • ruamel.yaml: 0.17.21
  • tesserocr: 2.5.2
  • boto3: 1.24.66
  • zeep: 4.1.0
  • aeidon: 1.11
  • iniparse: 0.5
  • Mercurial: 6.2.2
  • git-review: 2.3.1
  • Redis server: 6.2.12
  • PostgreSQL server: 14.3
  • Database backends: django.db.backends.postgresql
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: mail.revolutionarygamesstudio.com
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://localhost:6379, redis://localhost:6379, regular
  • Platform: Linux 6.2.15-100.fc36.x86_64 (x86_64)

Weblate deploy checks

System check identified some issues:

WARNINGS:
?: (weblate.W033.Subversion) Failure in loading VCS module for Subversion: git: 'svn' is not a git command. See 'git --help'.

The most similar commands are
        fsck
        mv
        show
 (1)
        HINT: https://docs.weblate.org/en/weblate-4.16.4/vcs.html

INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
        HINT: https://docs.weblate.org/en/weblate-4.16.4/admin/install.html#collecting-errors
?: (weblate.I031) New Weblate version is available, please upgrade to 4.18.1.
        HINT: https://docs.weblate.org/en/weblate-4.16.4/admin/upgrade.html

System check identified 3 issues (1 silenced).

Additional context

No response

@nijel
Copy link
Member

nijel commented Jun 27, 2023

Yes, it can be it, see #8766. Users created before the fix might still not be validated.

@hhyyrylainen
Copy link
Author

Are there any specific characters I should be on the lookout for in recently joined users? Would it help if I install the latest Weblate version from pypi?

@nijel
Copy link
Member

nijel commented Jun 27, 2023

The problematic name is in the error message: "

It can also be that you messed up git configuration files Weblate uses and set this as a committer.

@nijel nijel added the question This is more a question for the support than an issue. label Jun 27, 2023
@hhyyrylainen
Copy link
Author

Well the error message is seemingly saying the problem is just one newline character. I have not touched the configuration file when this problem started. Just checking now I'm pretty sure I don't have a custom committer name even specified there. Is there a way to entirely reset a git repo used by weblate? The web interface buttons leave a lot to be desired and I think manually deleting the files on disk caused this problem to start, though I don't know enough internal details to know what database data or something this might have caused to become invalid.

@nijel
Copy link
Member

nijel commented Jun 27, 2023

The whole problematic name is: "

The error message is printed here: https://github.com/git/git/blob/a9e066fa63149291a55f383cfa113d8bdbdaa6b3/ident.c#L517

@github-actions
Copy link

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger.

In case your question is already answered, making a donation is the right way to say thank you!

@hhyyrylainen
Copy link
Author

Assuming the user search page works with " as the search term, then there are no users with such a name. I'd assume this means that some internal mechanism has gone wrong and is the cause of why the commit name is showing up incorrectly. If I'm reading the admin UI correctly then weblate manages to make about 500 commits but there's still over 45000 changes uncommitted (well that was the situation this morning, now I just used the force reset on the repo again and this time weblate managed to make 16 commits). I know that's a lot but that's caused by the repository history rewrite and that's what I'm trying to fix, get weblate to not want to recommit all the historical changes.

I've got a new error today:

error: cannot rebase: Your index contains uncommitted changes.
error: Please commit or stash them.
 (1)

nijel added a commit that referenced this issue Jul 12, 2023
While this is valid RFC 5322, such string can confuse git and end up with

fatal: name consists only of disallowed characters: " (128)

Fixes WEBLATE-2WZ
Issue #9462
@nijel
Copy link
Member

nijel commented Jul 12, 2023

I've just discovered that this can also be caused by using <> characters in the user name. This was fixed by d137f73.

@github-actions
Copy link

This issue has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

@github-actions github-actions bot added the wontfix Nobody will work on this. label Jul 27, 2023
@nijel nijel added bug Something is broken. and removed question This is more a question for the support than an issue. wontfix Nobody will work on this. labels Jul 27, 2023
@nijel nijel added this to the 5.0 milestone Jul 27, 2023
@nijel nijel closed this as completed Jul 27, 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.

@hhyyrylainen
Copy link
Author

I just upgraded to Weblate 5.0 and I can confirm that I no longer have issues with getting all the changes in Weblate committed and things cleaned out. I can now resume using Weblate. Thank you so much for the fix!

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

No branches or pull requests

2 participants