WeblateOrg / weblate

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

Internal Server Error when adding new JSON translations key without leading dot #3031

Closed sebastienvermeille closed 5 years ago

sebastienvermeille commented 5 years ago

Describe the bug

Adding translations key via the web user interface is unstable. Sometimes works great sometimes it fails and redirect to an error page + send an error email.

To Reproduce Steps to reproduce the behavior:

  1. go to the source language, and in menu I select Tools > Add new translations string
  2. the page is displayed
  3. add a new translation key and the english translation.
  4. See error (sometimes it redirect to an error page Internal server error)

Expected behavior It succeed

Screenshots https://i.ibb.co/xGzmYrT/weblate-issue.png

Received email

Internal Server Error: /new-unit/project/i18n-develop/en_US/

RepositoryException at /new-unit/project/i18n-develop/en_US/
On branch develop
Your branch is up to date with 'origin/develop'.

nothing to commit, working tree clean (1)

Request Method: POST
Request URL: http://192.168.150.118:8999/new-unit/project/i18n-develop/en_US/
Django Version: 2.2.4
Python Executable: /usr/bin/uwsgi-core
Python Version: 3.7.3
Python Path: ['/', '/usr/local/lib/python3.7/dist-packages/', '.', '', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7/dist-packages', '/usr/lib/python3/dist-packages']
Server time: Wed, 18 Sep 2019 07:03:21 +0000
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin.apps.SimpleAdminConfig',
 'django.contrib.admindocs',
 'django.contrib.sitemaps',
 'django.contrib.humanize',
 'social_django',
 'crispy_forms',
 'compressor',
 'rest_framework',
 'rest_framework.authtoken',
 'weblate.addons',
 'weblate.auth',
 'weblate.checks',
 'weblate.formats',
 'weblate.machinery',
 'weblate.trans',
 'weblate.lang',
 'weblate.langdata',
 'weblate.memory',
 'weblate.screenshots',
 'weblate.fonts',
 'weblate.accounts',
 'weblate.utils',
 'weblate.vcs',
 'weblate.wladmin',
 'weblate',
 'weblate.gitexport']
Installed Middleware:
['weblate.middleware.ProxyMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'weblate.accounts.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'social_django.middleware.SocialAuthExceptionMiddleware',
 'weblate.accounts.middleware.RequireLoginMiddleware',
 'weblate.middleware.SecurityMiddleware']

Traceback:

File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.7/dist-packages/django/views/decorators/http.py" in inner
  40.             return func(request, *args, **kwargs)

File "/usr/local/lib/python3.7/dist-packages/django/contrib/auth/decorators.py" in _wrapped_view
  21.                 return view_func(request, *args, **kwargs)

File "/usr/local/lib/python3.7/dist-packages/weblate/trans/views/edit.py" in new_unit
  816.             translation.new_unit(request, key, value)

File "/usr/local/lib/python3.7/dist-packages/weblate/trans/models/translation.py" in new_unit
  999.                 timezone.now()

File "/usr/local/lib/python3.7/dist-packages/weblate/trans/models/translation.py" in __git_commit
  503.             msg, author, timestamp, files + self.addon_commit_files

File "/usr/local/lib/python3.7/dist-packages/weblate/vcs/git.py" in commit
  258.         self.execute(cmd)

File "/usr/local/lib/python3.7/dist-packages/weblate/vcs/base.py" in execute
  194.             args, self.path, fullcmd=fullcmd, local=self.local

File "/usr/local/lib/python3.7/dist-packages/weblate/vcs/base.py" in _popen
  178.                 output.decode('utf-8')

Exception Type: RepositoryException at /new-unit/project/i18n-develop/en_US/
Exception Value: On branch develop
Your branch is up to date with 'origin/develop'.

nothing to commit, working tree clean (1)
Request information:
USER: Guillaume Serneels

GET: No GET data

POST:
csrfmiddlewaretoken = 'RzMtb15qTSKzESgcP0dQOlSsiguCyWUbscVmeVaXKf3G7aRRxHCgO0aJyUZjcnuV'
key = 'COMMUNICATION'
value_0 = 'Communication Control'

FILES: No FILES data

COOKIES:
sessionid = '7tdp59atdiqsmskbf1ei9cxwfm5537y8'

META:
CONTENT_LENGTH = '132'
CONTENT_TYPE = 'application/x-www-form-urlencoded'
CSRF_COOKIE = '8o7ikJbc2NftriitHgXIWPzp1JonywY4J1gbnDgJTayAUAT8pXm8WuRGhnT4cXyO'
CSRF_COOKIE_USED = True
DOCUMENT_ROOT = '/app/data/static'
HTTP_ACCEPT = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
HTTP_ACCEPT_ENCODING = 'gzip, deflate'
HTTP_ACCEPT_LANGUAGE = 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3'
HTTP_CONNECTION = 'keep-alive'
HTTP_CONTENT_LENGTH = '132'
HTTP_CONTENT_TYPE = 'application/x-www-form-urlencoded'
HTTP_COOKIE = 'sessionid=7tdp59atdiqsmskbf1ei9cxwfm5537y8'
HTTP_HOST = '192.168.150.118:8999'
HTTP_REFERER = 'http://192.168.150.118:8999/'
HTTP_UPGRADE_INSECURE_REQUESTS = '1'
HTTP_USER_AGENT = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0'
PATH_INFO = '/new-unit/project/i18n-develop/en_US/'
QUERY_STRING = ''
REMOTE_ADDR = '192.168.8.134'
REMOTE_PORT = '52502'
REQUEST_METHOD = 'POST'
REQUEST_SCHEME = 'http'
REQUEST_URI = '/new-unit/project/i18n-develop/en_US/'
SCRIPT_NAME = ''
SERVER_NAME = ''
SERVER_PORT = '8080'
SERVER_PROTOCOL = 'HTTP/1.1'
WEBLATE_LANGUAGE = ''
WEBLATE_USER = "'jdoe'"
WEBLATE_VERSION:Celery = '4.3.0'
WEBLATE_VERSION:Django = '2.2.4'
WEBLATE_VERSION:Git = '2.20.1'
WEBLATE_VERSION:Mercurial = '4.8.2'
WEBLATE_VERSION:Pillow = '5.4.1'
WEBLATE_VERSION:Python = '3.7.3'
WEBLATE_VERSION:Weblate = '3.8'
WEBLATE_VERSION:Whoosh = '2.7.4'
WEBLATE_VERSION:celery-batches = '0.2'
WEBLATE_VERSION:defusedxml = '0.6.0'
WEBLATE_VERSION:diff-match-patch = '20181111'
WEBLATE_VERSION:django-appconf = '1.0.3'
WEBLATE_VERSION:django-crispy-forms = '1.7.2'
WEBLATE_VERSION:django_compressor = '2.3'
WEBLATE_VERSION:djangorestframework = '3.10.2'
WEBLATE_VERSION:git-svn = '2.20.1'
WEBLATE_VERSION:jellyfish = '0.7.2'
WEBLATE_VERSION:lxml = '4.3.2'
WEBLATE_VERSION:python-dateutil = '2.8.0'
WEBLATE_VERSION:ruamel.yaml = '0.16.2'
WEBLATE_VERSION:six = '1.12.0'
WEBLATE_VERSION:social-auth-app-django = '3.1.0'
WEBLATE_VERSION:social-auth-core = '3.2.0'
WEBLATE_VERSION:tesserocr = '2.4.0'
WEBLATE_VERSION:translate-toolkit = '2.4.0'
WEBLATE_VERSION:translation-finder = '1.6'
WEBLATE_VERSION:user-agents = '2.0'
uwsgi.node = b'a8104090b5f7'
uwsgi.version = b'2.0.18-debian'
wsgi.errors = <_io.TextIOWrapper name=2 mode='w' encoding='UTF-8'>
wsgi.file_wrapper = ''
wsgi.input = <uwsgi._Input object at 0x7fa649f90e88>
wsgi.multiprocess = True
wsgi.multithread = False
wsgi.run_once = False
wsgi.url_scheme = 'http'
wsgi.version = '(1, 0)'

Settings:
Using settings module weblate.settings
ABSOLUTE_URL_OVERRIDES = {}
ADDITIONAL_CONFIG = '/app/data/settings-override.py'
ADMINS = "(('Weblate Admin', 'noreply@company.com'),)"
ADMINS_CONTACT = []
ADMINS_HOSTING = []
AKISMET_API_KEY = '********************'
ALLOWED_HOSTS = ['*']
ANONYMOUS_USER_NAME = 'anonymous'
APPEND_SLASH = True
AUDITLOG_EXPIRY = 180
AUTHENTICATION_BACKENDS = "('django_auth_ldap.backend.LDAPBackend', 'weblate.accounts.auth.WeblateUserBackend')"
AUTH_PASSWORD_DAYS = '********************'
AUTH_PASSWORD_VALIDATORS = '********************'
AUTH_RESTRICT_ADMINS = {}
AUTH_TOKEN_VALID = '********************'
AUTH_USER_MODEL = 'weblate_auth.User'
AUTH_VALIDATE_PERMS = False
AUTOFIX_LIST = "('weblate.trans.autofixes.whitespace.SameBookendingWhitespace', 'weblate.trans.autofixes.chars.ReplaceTrailingDotsWithEllipsis', 'weblate.trans.autofixes.chars.RemoveZeroSpace', 'weblate.trans.autofixes.chars.RemoveControlChars')"
AUTO_UPDATE = False
AVATAR_DEFAULT_IMAGE = 'identicon'
AVATAR_URL_PREFIX = 'https://www.gravatar.com/'
BASE_DIR = '/usr/local/lib/python3.7/dist-packages'
BILLING_ADMIN = True
CACHES = {'avatar': {'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', 'LOCATION': '/app/data/avatar-cache', 'TIMEOUT': 604800, 'OPTIONS': {'MAX_ENTRIES': 1000}}, 'default': {'BACKEND': 'django_redis.cache.RedisCache', 'LOCATION': 'redis://cache:6379/1', 'OPTIONS': {'CLIENT_CLASS': 'django_redis.client.DefaultClient', 'PARSER_CLASS': 'redis.connection.HiredisParser', 'PASSWORD': '********************'}, 'KEY_PREFIX': '********************'}}
CACHE_MIDDLEWARE_ALIAS = 'default'
CACHE_MIDDLEWARE_KEY_PREFIX = '********************'
CACHE_MIDDLEWARE_SECONDS = 600
CELERY_BEAT_SCHEDULE = {'commit': {'task': 'weblate.trans.tasks.commit_pending', 'kwargs': {'hours': 0}, 'schedule': 60}}
CELERY_BEAT_SCHEDULE_FILENAME = '/app/data/celery/beat-schedule'
CELERY_BROKER_URL = 'redis://cache:6379/1'
CELERY_IMPORTS = ['weblate.accounts.notifications', 'weblate.trans.discovery', 'weblate.trans.models', 'weblate.trans.search']
CELERY_RESULT_BACKEND = 'redis://cache:6379/1'
CELERY_TASK_ALWAYS_EAGER = False
CELERY_TASK_ROUTES = {'weblate.trans.search.*': {'queue': 'search'}, 'weblate.trans.tasks.optimize_fulltext': {'queue': 'search'}, 'weblate.trans.tasks.cleanup_fulltext': {'queue': 'search'}, 'weblate.memory.tasks.*': {'queue': 'memory'}, 'weblate.accounts.tasks.notify_change': {'queue': 'notify'}, 'weblate.accounts.tasks.send_mails': {'queue': 'notify'}}
CELERY_WORKER_MAX_MEMORY_PER_CHILD = 200000
CELERY_WORKER_PREFETCH_MULTIPLIER = 0
CHECK_LIST = "('weblate.checks.same.SameCheck', 'weblate.checks.chars.BeginNewlineCheck', 'weblate.checks.chars.EndNewlineCheck', 'weblate.checks.chars.BeginSpaceCheck', 'weblate.checks.chars.EndSpaceCheck', 'weblate.checks.chars.EndStopCheck', 'weblate.checks.chars.EndColonCheck', 'weblate.checks.chars.EndQuestionCheck', 'weblate.checks.chars.EndExclamationCheck', 'weblate.checks.chars.EndEllipsisCheck', 'weblate.checks.chars.EndSemicolonCheck', 'weblate.checks.chars.MaxLengthCheck', 'weblate.checks.chars.KashidaCheck', 'weblate.checks.format.PythonFormatCheck', 'weblate.checks.format.PythonBraceFormatCheck', 'weblate.checks.format.PHPFormatCheck', 'weblate.checks.format.CFormatCheck', 'weblate.checks.format.PerlFormatCheck', 'weblate.checks.format.JavaScriptFormatCheck', 'weblate.checks.format.CSharpFormatCheck', 'weblate.checks.format.JavaFormatCheck', 'weblate.checks.format.JavaMessageFormatCheck', 'weblate.checks.angularjs.AngularJSInterpolationCheck', 'weblate.checks.qt.QtFormatCheck', 'weblate.checks.qt.QtPluralCheck', 'weblate.checks.ruby.RubyFormatCheck', 'weblate.checks.consistency.PluralsCheck', 'weblate.checks.consistency.SamePluralsCheck', 'weblate.checks.consistency.ConsistencyCheck', 'weblate.checks.consistency.TranslatedCheck', 'weblate.checks.chars.NewlineCountingCheck', 'weblate.checks.markup.BBCodeCheck', 'weblate.checks.chars.ZeroWidthSpaceCheck', 'weblate.checks.render.MaxSizeCheck', 'weblate.checks.markup.XMLValidityCheck', 'weblate.checks.markup.XMLTagsCheck', 'weblate.checks.markup.MarkdownRefLinkCheck', 'weblate.checks.markup.MarkdownLinkCheck', 'weblate.checks.markup.MarkdownSyntaxCheck', 'weblate.checks.markup.URLCheck', 'weblate.checks.source.OptionalPluralCheck', 'weblate.checks.source.EllipsisCheck', 'weblate.checks.source.MultipleFailingCheck')"
COMMENT_CLEANUP_DAYS = None
COMMIT_PENDING_HOURS = 24
COMPRESSORS = {'css': 'compressor.css.CssCompressor', 'js': 'compressor.js.JsCompressor'}
COMPRESS_CACHEABLE_PRECOMPILERS = '()'
COMPRESS_CACHE_BACKEND = 'default'
COMPRESS_CACHE_KEY_FUNCTION = '********************'
COMPRESS_CLEAN_CSS_ARGUMENTS = ''
COMPRESS_CLEAN_CSS_BINARY = 'cleancss'
COMPRESS_CLOSURE_COMPILER_ARGUMENTS = ''
COMPRESS_CLOSURE_COMPILER_BINARY = 'java -jar compiler.jar'
COMPRESS_CSS_HASHING_METHOD = 'mtime'
COMPRESS_DATA_URI_MAX_SIZE = 1024
COMPRESS_DEBUG_TOGGLE = None
COMPRESS_ENABLED = True
COMPRESS_FILTERS = {'css': ['compressor.filters.css_default.CssAbsoluteFilter'], 'js': ['compressor.filters.jsmin.JSMinFilter']}
COMPRESS_JINJA2_GET_ENVIRONMENT = <function CompressorConf.JINJA2_GET_ENVIRONMENT at 0x7fa64e1b7bf8>
COMPRESS_MINT_DELAY = 30
COMPRESS_MTIME_DELAY = 10
COMPRESS_OFFLINE = False
COMPRESS_OFFLINE_CONTEXT = {'STATIC_URL': '/static/'}
COMPRESS_OFFLINE_MANIFEST = 'manifest.json'
COMPRESS_OFFLINE_TIMEOUT = 31536000
COMPRESS_OUTPUT_DIR = 'CACHE'
COMPRESS_PARSER = 'compressor.parser.AutoSelectParser'
COMPRESS_PRECOMPILERS = '()'
COMPRESS_REBUILD_TIMEOUT = 2592000
COMPRESS_ROOT = '/app/data/static'
COMPRESS_STORAGE = 'compressor.storage.CompressorFileStorage'
COMPRESS_TEMPLATE_FILTER_CONTEXT = {'STATIC_URL': '/static/'}
COMPRESS_URL = '/static/'
COMPRESS_URL_PLACEHOLDER = '/__compressor_url_placeholder__/'
COMPRESS_VERBOSE = False
COMPRESS_YUGLIFY_BINARY = 'yuglify'
COMPRESS_YUGLIFY_CSS_ARGUMENTS = '--terminal'
COMPRESS_YUGLIFY_JS_ARGUMENTS = '--terminal'
COMPRESS_YUI_BINARY = 'java -jar yuicompressor.jar'
COMPRESS_YUI_CSS_ARGUMENTS = ''
COMPRESS_YUI_JS_ARGUMENTS = ''
CRISPY_TEMPLATE_PACK = 'bootstrap3'
CSRF_COOKIE_AGE = 31449600
CSRF_COOKIE_DOMAIN = None
CSRF_COOKIE_HTTPONLY = True
CSRF_COOKIE_NAME = 'csrftoken'
CSRF_COOKIE_PATH = '/'
CSRF_COOKIE_SAMESITE = 'Lax'
CSRF_COOKIE_SECURE = False
CSRF_FAILURE_VIEW = 'weblate.trans.views.error.csrf_failure'
CSRF_HEADER_NAME = 'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS = []
CSRF_USE_SESSIONS = True
DATABASES = {'default': {'ENGINE': 'django.db.backends.postgresql', 'NAME': 'weblate', 'TEST': {'NAME': 'weblate', 'CHARSET': None, 'COLLATION': None, 'MIRROR': None}, 'USER': 'weblate', 'PASSWORD': '********************', 'HOST': 'database', 'PORT': '', 'OPTIONS': {'sslmode': 'prefer'}, 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'TIME_ZONE': None}}
DATABASE_ROUTERS = []
DATA_DIR = '/app/data'
DATA_UPLOAD_MAX_MEMORY_SIZE = 2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS = 1000
DATETIME_FORMAT = 'N j, Y, P'
DATETIME_INPUT_FORMATS = ['%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d %H:%M', '%Y-%m-%d', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', '%m/%d/%Y %H:%M', '%m/%d/%Y', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', '%m/%d/%y %H:%M', '%m/%d/%y']
DATE_FORMAT = 'N j, Y'
DATE_INPUT_FORMATS = ['%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y', '%b %d, %Y', '%d %b %Y', '%d %b, %Y', '%B %d %Y', '%B %d, %Y', '%d %B %Y', '%d %B, %Y']
DEBUG = False
DEBUG_PROPAGATE_EXCEPTIONS = False
DECIMAL_SEPARATOR = '.'
DEFAULT_ACCESS_CONTROL = 0
DEFAULT_ADDON_MESSAGE = 'Update translation files\n\nUpdated by "{{ addon_name }}" hook in Weblate.\n\nTranslation: {{ project_name }}/{{ component_name }}\nTranslate-URL: {{ url }}'
DEFAULT_ADD_MESSAGE = 'Added translation using Weblate ({{ language_name }})\n\n'
DEFAULT_CHARSET = 'utf-8'
DEFAULT_COMMITER_EMAIL = 'noreply@weblate.org'
DEFAULT_COMMITER_NAME = 'Weblate'
DEFAULT_COMMIT_MESSAGE = 'Translated using Weblate ({{ language_name }})\n\nCurrently translated at {{ stats.translated_percent }}% ({{ stats.translated }} of {{ stats.all }} strings)\n\nTranslation: {{ project_name }}/{{ component_name }}\nTranslate-URL: {{ url }}'
DEFAULT_CONTENT_TYPE = 'text/html'
DEFAULT_DELETE_MESSAGE = 'Deleted translation using Weblate ({{ language_name }})\n\n'
DEFAULT_EXCEPTION_REPORTER_FILTER = 'weblate.trans.debug.WeblateExceptionReporterFilter'
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL = 'noreply@company.com'
DEFAULT_INDEX_TABLESPACE = ''
DEFAULT_LOG = 'console'
DEFAULT_MERGE_MESSAGE = "Merge branch '{{ component_remote_branch }}' into Weblate.\n\n"
DEFAULT_MERGE_STYLE = 'rebase'
DEFAULT_PULL_MESSAGE = 'Update from Weblate'
DEFAULT_PUSH_ON_COMMIT = True
DEFAULT_SHARED_TM = True
DEFAULT_TABLESPACE = ''
DEFAULT_TRANSLATION_PROPAGATION = True
DEFAULT_VCS = 'git'
DISALLOWED_USER_AGENTS = []
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'mail.company.com'
EMAIL_HOST_PASSWORD = '********************'
EMAIL_HOST_USER = 'aaaa'
EMAIL_PORT = 432423
EMAIL_SEND_HTML = True
EMAIL_SSL_CERTFILE = None
EMAIL_SSL_KEYFILE = '********************'
EMAIL_SUBJECT_PREFIX = '[Company translation system] '
EMAIL_TIMEOUT = None
EMAIL_USE_LOCALTIME = False
EMAIL_USE_SSL = False
EMAIL_USE_TLS = True
ENABLE_AVATARS = True
ENABLE_HOOKS = True
ENABLE_HTTPS = False
ENABLE_SHARING = True
FILE_CHARSET = 'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS = None
FILE_UPLOAD_HANDLERS = ['django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440
FILE_UPLOAD_PERMISSIONS = None
FILE_UPLOAD_TEMP_DIR = None
FIRST_DAY_OF_WEEK = 0
FIXTURE_DIRS = []
FORCE_SCRIPT_NAME = None
FORMAT_MODULE_PATH = None
FORM_RENDERER = 'django.forms.renderers.DjangoTemplates'
GITHUB_USERNAME = None
GOOGLE_ANALYTICS_ID = ''
HAVE_SYSLOG = False
HIDE_REPO_CREDENTIALS = True
IGNORABLE_404_URLS = []
INSTALLED_APPS = ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin.apps.SimpleAdminConfig', 'django.contrib.admindocs', 'django.contrib.sitemaps', 'django.contrib.humanize', 'social_django', 'crispy_forms', 'compressor', 'rest_framework', 'rest_framework.authtoken', 'weblate.addons', 'weblate.auth', 'weblate.checks', 'weblate.formats', 'weblate.machinery', 'weblate.trans', 'weblate.lang', 'weblate.langdata', 'weblate.memory', 'weblate.screenshots', 'weblate.fonts', 'weblate.accounts', 'weblate.utils', 'weblate.vcs', 'weblate.wladmin', 'weblate', 'weblate.gitexport']
INTERNAL_IPS = []
INVOICE_PATH = ''
IP_BEHIND_REVERSE_PROXY = False
IP_PROXY_HEADER = ''
IP_PROXY_OFFSET = 0
LANGUAGES = "(('ar', 'العربية'), ('az', 'Azərbaycan'), ('be', 'Беларуская'), ('be@latin', 'Biełaruskaja'), ('bg', 'Български'), ('br', 'Brezhoneg'), ('ca', 'Català'), ('cs', 'Čeština'), ('da', 'Dansk'), ('de', 'Deutsch'), ('en', 'English'), ('el', 'Ελληνικά'), ('en-gb', 'English (United Kingdom)'), ('es', 'Español'), ('fi', 'Suomi'), ('fr', 'Français'), ('gl', 'Galego'), ('he', 'עברית'), ('hu', 'Magyar'), ('id', 'Indonesia'), ('it', 'Italiano'), ('ja', '日本語'), ('kk', 'Қазақ тілі'), ('ko', '한국어'), ('nb', 'Norsk bokmål'), ('nl', 'Nederlands'), ('pl', 'Polski'), ('pt', 'Português'), ('pt-br', 'Português brasileiro'), ('ru', 'Русский'), ('sk', 'Slovenčina'), ('sl', 'Slovenščina'), ('sr', 'Српски'), ('sv', 'Svenska'), ('tr', 'Türkçe'), ('uk', 'Українська'), ('zh-hans', '简体字'), ('zh-hant', '正體字'))"
LANGUAGES_BIDI = ['he', 'ar', 'fa', 'ur']
LANGUAGE_CODE = 'en-us'
LANGUAGE_COOKIE_AGE = None
LANGUAGE_COOKIE_DOMAIN = None
LANGUAGE_COOKIE_NAME = 'django_language'
LANGUAGE_COOKIE_PATH = '/'
LDAP_APPEND_DOMAIN = 'company.com'
LEGAL_URL = None
LIMIT_TRANSLATION_LENGTH_BY_SOURCE_LENGTH = True
LOCALE_PATHS = "('/usr/local/lib/python3.7/dist-packages/weblate/locale',)"
LOGGING = {'version': 1, 'disable_existing_loggers': False, 'handlers': {'mail_admins': {'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler'}, 'stream_to_console': {'level': 'DEBUG', 'class': 'logging.StreamHandler'}}, 'loggers': {'django.request': {'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True}, 'django_auth_ldap': {'handlers': ['stream_to_console'], 'level': 'DEBUG', 'propagate': True}}}
LOGGING_CONFIG = 'logging.config.dictConfig'
LOGIN_REDIRECT_URL = '/'
LOGIN_REQUIRED_URLS = "('/(.*)$',)"
LOGIN_REQUIRED_URLS_EXCEPTIONS = "('/accounts/(.*)$', '/admin/login/(.*)$', '/static/(.*)$', '/widgets/(.*)$', '/data/(.*)$', '/hooks/(.*)$', '/healthz/$', '/api/(.*)$', '/js/i18n/$', '/contact/$', '/legal/(.*)$')"
LOGIN_URL = '/accounts/login/'
LOGOUT_REDIRECT_URL = None
LOGOUT_URL = '/accounts/logout/'
MANAGERS = "(('Weblate Admin', 'noreply@company.com'),)"
MEDIA_ROOT = '/app/data/media'
MEDIA_URL = '/media/'
MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE = ['weblate.middleware.ProxyMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'weblate.accounts.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'social_django.middleware.SocialAuthExceptionMiddleware', 'weblate.accounts.middleware.RequireLoginMiddleware', 'weblate.middleware.SecurityMiddleware']
MIGRATION_MODULES = {}
MONTH_DAY_FORMAT = 'F j'
MT_APERTIUM_APY = None
MT_AWS_ACCESS_KEY_ID = '********************'
MT_AWS_REGION = None
MT_AWS_SECRET_ACCESS_KEY = '********************'
MT_BAIDU_ID = None
MT_BAIDU_SECRET = '********************'
MT_DEEPL_KEY = '********************'
MT_GOOGLE_KEY = '********************'
MT_MICROSOFT_COGNITIVE_KEY = '********************'
MT_MICROSOFT_ID = None
MT_MICROSOFT_SECRET = '********************'
MT_MYMEMORY_EMAIL = 'noreply@xyz.com'
MT_MYMEMORY_KEY = '********************'
MT_MYMEMORY_USER = None
MT_NETEASE_KEY = '********************'
MT_NETEASE_SECRET = '********************'
MT_SAP_BASE_URL = None
MT_SAP_PASSWORD = '********************'
MT_SAP_SANDBOX_APIKEY = '********************'
MT_SAP_USERNAME = None
MT_SAP_USE_MT = True
MT_SERVICES = "('weblate.machinery.weblatetm.WeblateTranslation', 'weblate.memory.machine.WeblateMemory')"
MT_TMSERVER = None
MT_YANDEX_KEY = '********************'
MT_YOUDAO_ID = None
MT_YOUDAO_SECRET = '********************'
NEARBY_MESSAGES = 5
NUMBER_GROUPING = 0
OFFER_HOSTING = False
PASSWORD_HASHERS = '********************'
PASSWORD_RESET_TIMEOUT_DAYS = '********************'
PIWIK_SITE_ID = None
PIWIK_URL = None
PREPEND_WWW = False
RATELIMIT_ATTEMPTS = 5
RATELIMIT_GLOSSARY_ATTEMPTS = 30
RATELIMIT_GLOSSARY_WINDOW = 60
RATELIMIT_LOCKOUT = 600
RATELIMIT_SEARCH_ATTEMPTS = 6
RATELIMIT_SEARCH_LOCKOUT = 60
RATELIMIT_SEARCH_WINDOW = 60
RATELIMIT_TRANSLATE_ATTEMPTS = 30
RATELIMIT_TRANSLATE_WINDOW = 60
RATELIMIT_WINDOW = 300
REDIS_PASSWORD = '********************'
REGISTRATION_CAPTCHA = True
REGISTRATION_EMAIL_MATCH = '.*'
REGISTRATION_OPEN = False
REST_FRAMEWORK = {'DEFAULT_PERMISSION_CLASSES': ['rest_framework.permissions.IsAuthenticatedOrReadOnly'], 'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework.authentication.TokenAuthentication', 'weblate.api.authentication.BearerAuthentication', 'rest_framework.authentication.SessionAuthentication'), 'DEFAULT_THROTTLE_CLASSES': ('rest_framework.throttling.AnonRateThrottle', 'rest_framework.throttling.UserRateThrottle'), 'DEFAULT_THROTTLE_RATES': {'anon': '100/day', 'user': '1000/day'}, 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', 'PAGE_SIZE': 20, 'VIEW_DESCRIPTION_FUNCTION': 'weblate.api.views.get_view_description', 'UNAUTHENTICATED_USER': 'weblate.auth.models.get_anonymous'}
ROOT_URLCONF = 'weblate.urls'
SECRET_KEY = '********************'
SECURE_BROWSER_XSS_FILTER = True
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_HSTS_INCLUDE_SUBDOMAINS = False
SECURE_HSTS_PRELOAD = False
SECURE_HSTS_SECONDS = 0
SECURE_PROXY_SSL_HEADER = None
SECURE_REDIRECT_EXEMPT = "('healthz/$',)"
SECURE_SSL_HOST = None
SECURE_SSL_REDIRECT = False
SERVER_EMAIL = 'test@company.com'
SESSION_CACHE_ALIAS = 'default'
SESSION_COOKIE_AGE = 1209600
SESSION_COOKIE_DOMAIN = None
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_NAME = 'sessionid'
SESSION_COOKIE_PATH = '/'
SESSION_COOKIE_SAMESITE = 'Lax'
SESSION_COOKIE_SECURE = False
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
SESSION_FILE_PATH = None
SESSION_SAVE_EVERY_REQUEST = False
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE = 'weblate.settings'
SHORT_DATETIME_FORMAT = 'm/d/Y P'
SHORT_DATE_FORMAT = 'm/d/Y'
SIGNING_BACKEND = 'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS = ['admin.E408']
SIMILAR_MESSAGES = 5
SIMPLIFY_LANGUAGES = True
SINGLE_PROJECT = False
SITE_ID = 1
SITE_TITLE = 'Company translation system'
SOCIAL_AUTH_AUTH0_IMAGE = 'btn_auth0_badge.png'
SOCIAL_AUTH_AUTH0_TITLE = 'Auth0'
SOCIAL_AUTH_AZUREAD_OAUTH2_KEY = '********************'
SOCIAL_AUTH_AZUREAD_OAUTH2_SECRET = '********************'
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_KEY = '********************'
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_SECRET = '********************'
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_TENANT_ID = ''
SOCIAL_AUTH_BITBUCKET_KEY = '********************'
SOCIAL_AUTH_BITBUCKET_SECRET = '********************'
SOCIAL_AUTH_BITBUCKET_VERIFIED_EMAILS_ONLY = True
SOCIAL_AUTH_DISCONNECT_PIPELINE = "('social_core.pipeline.disconnect.allowed_to_disconnect', 'social_core.pipeline.disconnect.get_entries', 'social_core.pipeline.disconnect.revoke_tokens', 'weblate.accounts.pipeline.cycle_session', 'weblate.accounts.pipeline.adjust_primary_mail', 'weblate.accounts.pipeline.notify_disconnect', 'social_core.pipeline.disconnect.disconnect', 'weblate.accounts.pipeline.cleanup_next')"
SOCIAL_AUTH_EMAIL_FORM_URL = '/accounts/email/'
SOCIAL_AUTH_EMAIL_VALIDATION_FUNCTION = 'weblate.accounts.pipeline.send_validation'
SOCIAL_AUTH_EMAIL_VALIDATION_URL = '/accounts/email-sent/'
SOCIAL_AUTH_FACEBOOK_API_VERSION = '********************'
SOCIAL_AUTH_FACEBOOK_KEY = '********************'
SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {'fields': 'id,name,email'}
SOCIAL_AUTH_FACEBOOK_SCOPE = ['email', 'public_profile']
SOCIAL_AUTH_FACEBOOK_SECRET = '********************'
SOCIAL_AUTH_GITHUB_KEY = '********************'
SOCIAL_AUTH_GITHUB_SCOPE = ['user:email']
SOCIAL_AUTH_GITHUB_SECRET = '********************'
SOCIAL_AUTH_GITLAB_KEY = '********************'
SOCIAL_AUTH_GITLAB_SCOPE = ['read_user']
SOCIAL_AUTH_GITLAB_SECRET = '********************'
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = '********************'
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = '********************'
SOCIAL_AUTH_LOGIN_ERROR_URL = '/accounts/login/'
SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL = '/accounts/profile/#account'
SOCIAL_AUTH_PIPELINE = "('social_core.pipeline.social_auth.social_details', 'social_core.pipeline.social_auth.social_uid', 'social_core.pipeline.social_auth.auth_allowed', 'social_core.pipeline.social_auth.social_user', 'weblate.accounts.pipeline.store_params', 'weblate.accounts.pipeline.verify_open', 'social_core.pipeline.user.get_username', 'weblate.accounts.pipeline.require_email', 'social_core.pipeline.mail.mail_validation', 'weblate.accounts.pipeline.revoke_mail_code', 'weblate.accounts.pipeline.ensure_valid', 'weblate.accounts.pipeline.remove_account', 'social_core.pipeline.social_auth.associate_by_email', 'weblate.accounts.pipeline.reauthenticate', 'weblate.accounts.pipeline.verify_username', 'social_core.pipeline.user.create_user', 'social_core.pipeline.social_auth.associate_user', 'social_core.pipeline.social_auth.load_extra_data', 'weblate.accounts.pipeline.cleanup_next', 'weblate.accounts.pipeline.user_full_name', 'weblate.accounts.pipeline.store_email', 'weblate.accounts.pipeline.notify_connect', 'weblate.accounts.pipeline.password_reset')"
SOCIAL_AUTH_PROTECTED_USER_FIELDS = "('email',)"
SOCIAL_AUTH_RAISE_EXCEPTIONS = True
SOCIAL_AUTH_REDIRECT_IS_HTTPS = False
SOCIAL_AUTH_SLUGIFY_FUNCTION = 'weblate.accounts.pipeline.slugify_username'
SOCIAL_AUTH_SLUGIFY_USERNAMES = True
SOCIAL_AUTH_STRATEGY = 'weblate.accounts.strategy.WeblateStrategy'
SPECIAL_CHARS = "('\\t', '\\n', '…')"
STATICFILES_DIRS = '()'
STATICFILES_FINDERS = "('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'compressor.finders.CompressorFinder')"
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT = '/app/data/static'
STATIC_URL = '/static/'
STATUS_URL = None
SUGGESTION_CLEANUP_DAYS = None
SUPPORT_API_URL = '********************'
TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['/usr/local/lib/python3.7/dist-packages/weblate/templates'], 'OPTIONS': {'context_processors': ['django.contrib.auth.context_processors.auth', 'django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.request', 'django.template.context_processors.csrf', 'django.contrib.messages.context_processors.messages', 'weblate.trans.context_processors.weblate_context'], 'loaders': [('django.template.loaders.cached.Loader', ['django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader'])]}}]
TEST_NON_SERIALIZED_APPS = []
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR = ','
TIME_FORMAT = 'P'
TIME_INPUT_FORMATS = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
TIME_ZONE = 'UTC'
URL_PREFIX = ''
USE_I18N = True
USE_L10N = True
USE_THOUSAND_SEPARATOR = False
USE_TZ = True
USE_X_FORWARDED_HOST = False
USE_X_FORWARDED_PORT = False
VAT_RATE = 1.21
VCS_BACKENDS = "('weblate.vcs.git.GitRepository', 'weblate.vcs.git.GitWithGerritRepository', 'weblate.vcs.git.SubversionRepository', 'weblate.vcs.git.GithubRepository', 'weblate.vcs.git.LocalRepository', 'weblate.vcs.mercurial.HgRepository')"
WEBLATE_ADDONS = "('weblate.addons.gettext.GenerateMoAddon', 'weblate.addons.gettext.UpdateLinguasAddon', 'weblate.addons.gettext.UpdateConfigureAddon', 'weblate.addons.gettext.MsgmergeAddon', 'weblate.addons.gettext.GettextCustomizeAddon', 'weblate.addons.gettext.GettextAuthorComments', 'weblate.addons.cleanup.CleanupAddon', 'weblate.addons.consistency.LangaugeConsistencyAddon', 'weblate.addons.discovery.DiscoveryAddon', 'weblate.addons.flags.SourceEditAddon', 'weblate.addons.flags.TargetEditAddon', 'weblate.addons.flags.SameEditAddon', 'weblate.addons.generate.GenerateFileAddon', 'weblate.addons.json.JSONCustomizeAddon', 'weblate.addons.properties.PropertiesSortAddon', 'weblate.addons.git.GitSquashAddon', 'weblate.addons.removal.RemoveComments', 'weblate.addons.removal.RemoveSuggestions')"
WEBLATE_FORMATS = "('weblate.formats.ttkit.PoFormat', 'weblate.formats.ttkit.PoMonoFormat', 'weblate.formats.ttkit.TSFormat', 'weblate.formats.ttkit.XliffFormat', 'weblate.formats.ttkit.PoXliffFormat', 'weblate.formats.ttkit.StringsFormat', 'weblate.formats.ttkit.StringsUtf8Format', 'weblate.formats.ttkit.PropertiesUtf8Format', 'weblate.formats.ttkit.PropertiesUtf16Format', 'weblate.formats.ttkit.PropertiesFormat', 'weblate.formats.ttkit.JoomlaFormat', 'weblate.formats.ttkit.PhpFormat', 'weblate.formats.ttkit.RESXFormat', 'weblate.formats.ttkit.AndroidFormat', 'weblate.formats.ttkit.JSONFormat', 'weblate.formats.ttkit.JSONNestedFormat', 'weblate.formats.ttkit.WebExtensionJSONFormat', 'weblate.formats.ttkit.I18NextFormat', 'weblate.formats.ttkit.CSVFormat', 'weblate.formats.ttkit.CSVSimpleFormat', 'weblate.formats.ttkit.CSVSimpleFormatISO', 'weblate.formats.ttkit.YAMLFormat', 'weblate.formats.ttkit.RubyYAMLFormat', 'weblate.formats.ttkit.SubRipFormat', 'weblate.formats.ttkit.MicroDVDFormat', 'weblate.formats.ttkit.AdvSubStationAlphaFormat', 'weblate.formats.ttkit.SubStationAlphaFormat', 'weblate.formats.ttkit.DTDFormat', 'weblate.formats.ttkit.WindowsRCFormat', 'weblate.formats.external.XlsxFormat', 'weblate.formats.txt.AppStoreFormat')"
WEBLATE_GPG_ALGO = 'default'
WEBLATE_GPG_IDENTITY = None
WSGI_APPLICATION = None
X_FRAME_OPTIONS = 'DENY'
YEAR_MONTH_FORMAT = 'F Y'

Additional context It works sometimes sometimes not and have to retry.

nijel commented 5 years ago

It seems that under some conditions the updated file is not saved to disk. What file format do you use?

sebastienvermeille commented 5 years ago

We are using json files

sebastienvermeille commented 5 years ago

Dunno if that helps but I activated the "push after changes" feature

nijel commented 5 years ago

Do you specify the new key with leading dot?

I think that you can actually specify existing key, but if it's without leading ., it's probably not detected properly and that leads to no change operation on the file, which then fails to commit as it's empty...

sebastienvermeille commented 5 years ago

@nijel no I do not specify the leading dot.

Ok I will write some doc on our confluence so that developers know they have to add this . before thank you

nijel commented 5 years ago

Thanks for confirming that. Still this is something to address (actually the dot should not be there, see #2530).

nijel commented 5 years ago

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