Weblate: Adding a component based on SVN always fails with: No rebase in progress? (1)

Created on 15 Jan 2018  路  12Comments  路  Source: WeblateOrg/weblate

Steps to reproduce

  1. Create new component for existing project
  2. Use Subversion VCS on a repo on own SVN server, guaranteed to work if HOME=/app/data/home git svn clone <mysvnurl>

Actual behaviour

Borders Source code repository red and notes:
Failed to update repository: No rebase in progress? (1)

in error-log I see

weblate_1   | 2018-01-15 16:11:12,478 DEBG 'uwsgi' stderr output:
weblate_1   | ERROR testproj/testcomponent: failed merge on repo: perl: warning: Setting locale failed.
weblate_1   | perl: warning: Please check that your locale settings:
weblate_1   |   LANGUAGE = (unset),
weblate_1   |   LC_ALL = (unset),
weblate_1   |   LANG = "en_US.UTF-8"
weblate_1   |     are supported and installed on your system.
weblate_1   | perl: warning: Falling back to the standard locale ("C").
weblate_1   | Unable to determine upstream SVN information from working tree history (1)

Expected behaviour

It should just work and add the component.

Server configuration

I'm running the official docker image
v 2.18

bug

Most helpful comment

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

  • In case you see problem with the fix, please comment on this issue.
  • In case you see similar problem, please open separate issue.
  • If you are happy with the outcome, consider supporting Weblate by donating.

All 12 comments

I'm actually getting stack-traces now.

seems like the rebase --abort part isn't even the issue?
something in that try-block https://github.com/WeblateOrg/weblate/blob/14091ad1accb05fed366b4ad89214924bca6cf57/weblate/trans/models/subproject.py#L942 throws a RepositoryException

would greatly appreciate responses

weblate_1   | 2018-01-16 10:29:40,702 DEBG 'uwsgi' stderr output:
weblate_1   | Internal Server Error: /admin/trans/subproject/add/
weblate_1   | Traceback (most recent call last):
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 41, in inner
weblate_1   |     response = get_response(request)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 187, in _get_response
weblate_1   |     response = self.process_exception_by_middleware(e, request)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 185, in _get_response
weblate_1   |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 185, in inner
weblate_1   |     return func(*args, **kwargs)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/options.py", line 551, in wrapper
weblate_1   |     return self.admin_site.admin_view(view)(*args, **kwargs)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 149, in _wrapped_view
weblate_1   |     response = view_func(request, *args, **kwargs)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
weblate_1   |     response = view_func(request, *args, **kwargs)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py", line 224, in inner
weblate_1   |     return view(request, *args, **kwargs)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/options.py", line 1508, in add_view
weblate_1   |     return self.changeform_view(request, None, form_url, extra_context)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 67, in _wrapper
weblate_1   |     return bound_func(*args, **kwargs)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 149, in _wrapped_view
weblate_1   |     response = view_func(request, *args, **kwargs)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 63, in bound_func
weblate_1   |     return func.__get__(self, type(self))(*args2, **kwargs2)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/options.py", line 1408, in changeform_view
weblate_1   |     return self._changeform_view(request, object_id, form_url, extra_context)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/options.py", line 1448, in _changeform_view
weblate_1   |     self.save_model(request, new_object, form, not add)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/options.py", line 979, in save_model
weblate_1   |     obj.save()
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py", line 1426, in save
weblate_1   |     self.sync_git_repo(skip_push=kwargs.get('force_insert', False))
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py", line 1108, in sync_git_repo
weblate_1   |     self.update_branch()
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py", line 111, in wrapper
weblate_1   |     return func(self, *args, **kwargs)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py", line 990, in update_branch
weblate_1   |     method(abort=True)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/trans/vcs.py", line 708, in merge
weblate_1   |     self.rebase(abort)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/trans/vcs.py", line 715, in rebase
weblate_1   |     self.execute(['rebase', '--abort'])
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/trans/vcs.py", line 193, in execute
weblate_1   |     self.last_output = self._popen(args, self.path)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/trans/vcs.py", line 183, in _popen
weblate_1   |     output.decode('utf-8')
weblate_1   | RepositoryException: No rebase in progress? (1)

Thought it's a regression for a moment, it's not a regression. Happens in 2.18 and 2.17.1.
Source code repository looks like this (stdlayout path [no trunk]): https://svn.myproject.com/foo/barproject/ (it has stdlayout).

no Repository branch specified

Can you check the log (/var/log/syslog in the container), it should contain more detailed information on what was going on.

Apparently there was some error when fetching the repository and recovery from it failed...

hey, thanks for your response!

I'm using docker-compose so I assume the /var/log/syslog you're mentioning is just my docker-compose up stdout-output? - I see no such /var/log/syslog inside the container.

It doesn't always throw a stack-trace like the one I posted above, but the error is always the same: Failed to update repository: No rebase in progress? (1)

e.g.:
syslog_error_nostacktrace.txt

If there's any other things I could be of help with please let me know!

I assume that the: perl: warning: Setting locale failed messages can be ignored?
Then the error that's left is Unable to determine upstream SVN information from working tree history (1)

@nijel can you tell me why it's even trying to merge/rebase on a normal/first checkout? - looks like update_branch is called after the checkout and then fails https://github.com/WeblateOrg/weblate/blob/21785152f26a91c480b90bd2479000b55ce530c9/weblate/trans/models/subproject.py#L924

but I assume that's not the problem because that shouldn't fail even if doing an update is not necessary

Weblate runs the following git commands until I get the Unable to determine upstream SVN information from working tree history (1)

git config push.default current
git svn init -s --prefix=origin/ https://svn.ourserver.com/svn/ourrepository/ourproject/locale <ourpath>
git config push.default current
git config
git config -e
git config svn-remote.svn.url
git config user.name Weblate
git config user.email [email protected]
git svn fetch
git branch
git log -n 1 --format=format:%H HEAD
git svn rebase
git config svn-remote.svn.url https://svn.ourserver.com/svn/ourrepository/ourproject/locale
git config user.name Weblate
git config user.email [email protected]
git svn fetch
git branch
git svn rebase

so the issue seems this:
git config svn-remote.svn.url https://svn.ourserver.com/svn/ourrepository/ourproject/locale
after setting this, git svn rebase errors out, before it, the same command runs fine and returns Current branch master is up to date.

before setting the svn-remote.svn.url, the config part of the svn-remote svn block looks like this:

[svn-remote "svn"]
    url = https://svn.ourserver.com/svn/ourrepository
    fetch = ourproject/locale/trunk:refs/remotes/origin/trunk
    branches = ourproject/locale/branches/*:refs/remotes/origin/*
    tags = ourproject/locale/tags/*:refs/remotes/origin/tags/*

the svn-remote.svn.url is set from here: https://github.com/WeblateOrg/weblate/blob/65a4f18e0c8403b8834467e730f7611301b5dd42/weblate/trans/models/subproject.py#L696

so when running the 2nd cmd (git svn init -s --prefix=origin/ https://svn.ourserver.com/svn/ourrepository/ourproject/locale <ourpath>)
it prints to stdout:
Using higher level of URL: https://svn.ourserver.com/svn/ourrepository/ourproject/locale => https://svn.ourserver.com/svn/ourrepository

afterwards we fetch and rebase and the world is fine, but then we do the whole

 def configure_repo(self, validate=False):
        """Ensure repository is correctly configured"""

and we change the svn-remote.svn.url back to https://svn.ourserver.com/svn/ourrepository/ourproject/locale

and get Unable to determine upstream SVN information from working tree history (1)

@nijel I have yet to do a bisect, nor do I know much of the internals of git-svn, but why do we re-set svn-remote.svn.url here again?
https://github.com/WeblateOrg/weblate/blob/65a4f18e0c8403b8834467e730f7611301b5dd42/weblate/trans/models/subproject.py#L696

This is there to handle changes in the component configuration - if the URL is changed, the repository needs to be adjusted. Apparently it doesn't handle well situation where there is additional path in the SVN repository...

...however this will apparently not work that easily with svn, see https://git.wiki.kernel.org/index.php/GitSvnSwitch. Probably time to remove this piece of code.

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

  • In case you see problem with the fix, please comment on this issue.
  • In case you see similar problem, please open separate issue.
  • If you are happy with the outcome, consider supporting Weblate by donating.
Was this page helpful?
0 / 5 - 0 ratings