Bug #16874

Weblate commits changes to wiki/src/templates/page.tmpl

Added by intrigeri 2019-07-11 19:29:18 . Updated 2019-07-12 19:28:18 .

Status:
Resolved
Priority:
Elevated
Assignee:
intrigeri
Category:
Infrastructure
Target version:
Start date:
Due date:
% Done:

0%

Feature Branch:
https://salsa.debian.org/hefee/puppet-tails/tree/hefee/16874-lock-repository
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Translation Platform
Deliverable for:

Description

See commit:179e0bdabaec0f6f242f05a71cc261be9dff2d32 and commit:fc87cf823ef1e070852226ac1998a381931d0c8c. Weblate should not mess with this page. It seems like there’s something wrong in the mapping between files in Git and Weblate components. Additionally, I’m not sure if our update Git hook should have allowed this push (maybe it’s OK if both commits were pushed at the same time and since they cancel each other, the resulting diff did not modify any non-PO file).


Subtasks


Related issues

Related to Tails - Bug #16844: Don't use the same working copy in Weblate as in update_weblate_git.py Resolved

History

#1 Updated by hefee 2019-07-12 11:35:13

I think these are both commits happend while our scripts are running and our scripts were failing. I think we now hit a race condition, like we expected and why we want to split the repos Bug #16844.

2019-07-11 11:25:07,034 - root(ERROR): Something unexpected happened. Giving up.
Traceback (most recent call last):
  File "/var/lib/weblate/scripts/update_weblate_components.py", line 223, in <module>
    main()
  File "/var/lib/weblate/scripts/update_weblate_components.py", line 199, in main
    uwg.main(repoPath, 'master', None, remoteBranch, pushChanges=True)
  File "/var/lib/weblate/scripts/update_weblate_git.py", line 419, in main
    index = Index(git.IndexFile.from_tree(r, base, local, remote))
  File "/usr/lib/python3/dist-packages/git/index/base.py", line 348, in from_tree
    repo.git.read_tree(*arg_list, **kwargs)
  File "/usr/lib/python3/dist-packages/git/cmd.py", line 424, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/git/cmd.py", line 873, in _call_process
    return self.execute(call, **_kwargs)
  File "/usr/lib/python3/dist-packages/git/cmd.py", line 687, in execute
    raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git read-tree --reset --aggressive --index-output=/var/lib/weblate/repositories/vcs/tails/index/.git/k9vetxnk 72137b2c0c08de8e1dc80578d81135f3e816aa36 master 72137b2c0c08de8e1dc80578d81135f3e816aa36
  stderr: 'fatal: Unable to create '/var/lib/weblate/repositories/vcs/tails/index/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.'

#2 Updated by hefee 2019-07-12 11:35:28

  • related to Bug #16844: Don't use the same working copy in Weblate as in update_weblate_git.py added

#3 Updated by hefee 2019-07-12 11:45:16

The commits are made by Weblate itself and not by our scripts. But the scripts do strange stuff to the working directory, when preparing the merge. IMO Weblate just take the current working directory when committing.

I saw, that we are able to lock the repository, this may be interesting to lock the repository while we are updating the repo.

weblate/trans/vcs.py l.113
self.lock = FileLock(

Our Git hook accepts the push, when both changes are pushed together, as it is a noop together, as we check only the overall diff and not each diff of each commit.

#4 Updated by hefee 2019-07-12 12:50:10

  • Status changed from Confirmed to Needs Validation
  • Assignee changed from hefee to intrigeri
  • Feature Branch set to https://salsa.debian.org/hefee/puppet-tails/tree/hefee/16874-lock-repository

Let’s lock the respository while updating the repository.

#5 Updated by intrigeri 2019-07-12 19:28:18

  • Status changed from Needs Validation to Resolved

Merged! Closing even though the real fix is to use a different repo: locking it here will only prevent Weblate from committing changes it did not produce (and from losing the changes it meant to commit).