WeblateOrg / weblate

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

Commits are not pushed after celery run #2694

Closed shindler closed 5 years ago

shindler commented 5 years ago

Describe the bug Commits made by celery task weblate.trans.tasks.commit_pending aren't pushed automatically, ignoring the setting push on commit

To Reproduce Steps to reproduce the behavior:

  1. Make changes in one of the strings
  2. Wait for celery task to run
  3. Checkout repository maintenance page and see that there are new commit but they haven't been pushed

Expected behavior Changes pushed after commit

Server configuration and status weblate list_versions

 * Weblate 3.3
 * Python 3.6.7
 * Django 2.1.5
 * Celery 4.2.1
 * celery-batches 0.2
 * six 1.12.0
 * social-auth-core 3.0.0
 * social-auth-app-django 3.1.0
 * django-appconf 1.0.2
 * translate-toolkit 2.3.1
 * Whoosh 2.7.4
 * defusedxml 0.5.0
 * Git 2.17.1
 * Pillow 5.1.0
 * python-dateutil 2.7.5
 * lxml 4.2.1
 * django-crispy-forms 1.7.2
 * django_compressor 2.2
 * djangorestframework 3.9.1
 * user-agents 1.1.0
 * jellyfish 0.7.1
 * pytz 2018.9
 * pyuca 1.2
 * PyYAML 3.12
 * tesserocr 2.4.0
 * Mercurial 4.5.3
 * git-svn 2.17.1
 * Database backends: django.db.backends.postgresql
 * Cache backends: avatar:FileBasedCache, default:RedisCache
 * Celery: redis://cache:6379/1, redis://cache:6379/1, regular
 * Platform: Linux 4.4.0-145-generic (x86_64)

weblate check --deploy

SystemCheckError: System check identified some issues:

CRITICALS:
?: (weblate.E018) Failed to download avatar: <urlopen error [Errno 99] Cannot assign requested address>
    HINT: https://docs.weblate.org/en/weblate-3.3/admin/optionals.html#avatars

WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.

System check identified 4 issues (0 silenced).

Additional context I know we are using an older version of Weblate, but is it possible to quickly fix this problem without a need of upgrade? An extra celery task?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/73010179-commits-are-not-pushed-after-celery-run?utm_campaign=plugin&utm_content=tracker%2F253393&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F253393&utm_medium=issues&utm_source=github).
nijel commented 5 years ago

Do you have push URL configured for the component? See https://docs.weblate.org/en/latest/admin/continuous.html#pushing-changes

shindler commented 5 years ago

Yes we do in all "primary" components. All "linked" of course don't have this setting. I will verify if we have the same problem on "primary" and "linked" components and will get back with observations

nijel commented 5 years ago

Okay, there is different issue with the older versions - the push on commit has to be enabled on all components there, see #2634 and 249387157c3.

shindler commented 5 years ago

Ok so I did an extensive verification: 1) only "linked" components don't push 2) ALL, each one of our components has the same setting: "push on changes" set to "enabled"

So @nijel is there a way to overcome this problem without upgrading our docker farm ;)?

BTW can we run 3.5.1 straightaway just by upgrading image tag, or we should go version by version - what is your recommendation?

nijel commented 5 years ago

Hmm, there might be something else what got fixed meanwhile. This code was heavily modified recently, so it's quite likely.

It should be safe to skip any intermediate releases while upgrading in the 3.x series. If you don't hurry, I'd recommend you to wait after weekend when 3.6 will be released and it contains also fix for #2634...

shindler commented 5 years ago

Thank you. I will allow myself not to close this issue and return to you with an answer as soon we will be given a green light to perform an update

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.