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

Server error when running "Forced synchronisation" #6138

Closed
Nick-Hall opened this issue Jun 3, 2021 · 4 comments
Closed

Server error when running "Forced synchronisation" #6138

Nick-Hall opened this issue Jun 3, 2021 · 4 comments
Assignees
Labels
bug Something is broken.
Milestone

Comments

@Nick-Hall
Copy link

Describe the issue

I uploaded a couple of translation files and accidentally set all strings to "Needs editing".

My attempted solution was:

  1. Lock translations.
  2. Commit and push changes.
  3. Remove the two translation updates.
  4. Merge the PR.
  5. Reset the repository.
  6. Unlock.

This didn't seem to reset the string status, so I tried the "Force synchronisation".

Unfortunately this gave a server error.

I already tried

I tried to find a description of "Force synchronisation" in the documentation.

Was running it the right thing to do?

Expected behavior

I expected that after a "Reset" and "Force synchronisation" Weblate would be synchronised with upstream.

Server configuration and status

Hosted Weblate - Gramps project

@sentry-io
Copy link

sentry-io bot commented Jun 4, 2021

Sentry issue: WEBLATE-6YE

@nijel
Copy link
Member

nijel commented Jun 4, 2021

The actual error:

DeadlockDetected: deadlock detected
DETAIL:  Process 27713 waits for ShareLock on transaction 69679058; blocked by process 23644.
Process 23644 waits for ShareLock on transaction 69678796; blocked by process 27713.
HINT:  See server log for query details.
CONTEXT:  while updating tuple (270539,11) in relation "trans_unit"

  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)

OperationalError: deadlock detected
DETAIL:  Process 27713 waits for ShareLock on transaction 69679058; blocked by process 23644.
Process 23644 waits for ShareLock on transaction 69678796; blocked by process 27713.
HINT:  See server log for query details.
CONTEXT:  while updating tuple (270539,11) in relation "trans_unit"

  File "django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "django/views/decorators/http.py", line 40, in inner
    return func(request, *args, **kwargs)
  File "weblate/trans/views/git.py", line 243, in file_sync_component
    return perform_file_sync(request, obj)
  File "weblate/trans/views/git.py", line 123, in perform_file_sync
    request,
  File "weblate/trans/views/git.py", line 35, in execute_locked
    result = call(*args, **kwargs)
  File "weblate/trans/models/component.py", line 155, in on_link_wrapper
    return func(self, *args, **kwargs)
  File "weblate/trans/models/component.py", line 1531, in do_file_sync
    ).update(pending=True)
  File "django/db/models/query.py", line 783, in update
    rows = query.get_compiler(self.db).execute_sql(CURSOR)
  File "django/db/models/sql/compiler.py", line 1559, in execute_sql
    cursor = super().execute_sql(result_type)
  File "django/db/models/sql/compiler.py", line 1175, in execute_sql
    cursor.execute(sql, params)
  File "django/db/backends/utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)

Seems like something else was updating the strings at the same time.

@nijel nijel self-assigned this Jun 4, 2021
@nijel nijel added the bug Something is broken. label Jun 4, 2021
@nijel nijel added this to the 4.7 milestone Jun 4, 2021
@nijel nijel closed this as completed in fbe927a Jun 4, 2021
@github-actions
Copy link

github-actions bot commented Jun 4, 2021

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.

nijel added a commit that referenced this issue Jun 4, 2021
@nijel
Copy link
Member

nijel commented Jun 4, 2021

I've added missing documentation in 43d171e

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