WeblateOrg / weblate

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

Error 500 on Avatar retrieval #2095

Closed raphaelm closed 6 years ago

raphaelm commented 6 years ago

Steps to reproduce

  1. Call somethign that displays an avatar on translate.pretix.eu

Actual behaviour

Avatar returns error 500

Internal Server Error: /avatar/32/raphael.png

UnicodeDecodeError at /avatar/32/raphael.png
'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)

Request Method: GET
Request URL: https://translate.pretix.eu/avatar/32/raphael.png
Django Version: 2.0.6
Python Executable: /usr/bin/uwsgi-core
Python Version: 3.5.3
Python Path: ['/usr/local/lib/python3.5/dist-packages/', '.', '', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
Server time: Thu, 21 Jun 2018 11:22:54 +0200
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',
 '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.permissions',
 'weblate.screenshots',
 'weblate.accounts',
 'weblate.utils',
 'weblate.vcs',
 'weblate.wladmin',
 'weblate',
 'weblate.gitexport')
Installed Middleware:
['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',
 'weblate.wladmin.middleware.ConfigurationErrorsMiddleware']

Traceback:

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

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

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

File "/usr/local/lib/python3.5/dist-packages/weblate/accounts/views.py" in user_avatar
  536.         content=get_avatar_image(request, user, size)

File "/usr/local/lib/python3.5/dist-packages/weblate/accounts/avatar.py" in get_avatar_image
  124.     image = cache.get(cache_key)

File "/usr/local/lib/python3.5/dist-packages/django/core/cache/backends/filebased.py" in get
  35.                     return pickle.loads(zlib.decompress(f.read()))

Exception Type: UnicodeDecodeError at /avatar/32/raphael.png
Exception Value: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)
Request information:
USER: Raphael Michel

GET: No GET data

POST: No POST data

FILES: No FILES data

COOKIES:

META:
CONTENT_LENGTH = ''
CONTENT_TYPE = ''
CSRF_COOKIE = '8G3Lx3fKKLr7Y51QbgieDHiVnhUbwMOYmA0I7IMlkx0oZzrb4gBsXu8wNZRdX3ae'
DOCUMENT_ROOT = '/app/data/static'
HTTP_ACCEPT = 'image/webp,image/apng,image/*,*/*;q=0.8'
HTTP_ACCEPT_ENCODING = 'gzip, deflate, br'
HTTP_ACCEPT_LANGUAGE = 'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,fr;q=0.6'
HTTP_CONNECTION = 'close'
HTTP_DNT = '1'
HTTP_HOST = 'translate.pretix.eu'
HTTP_REFERER = 'https://translate.pretix.eu/'
HTTP_USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36'
HTTP_X_FORWARDED_PROTO = 'https'
HTTP_X_FORWARDED_SSL = 'on'
PATH_INFO = '/avatar/32/raphael.png'
QUERY_STRING = ''
REMOTE_ADDR = '172.17.0.1'
REMOTE_PORT = '39038'
REQUEST_METHOD = 'GET'
REQUEST_SCHEME = 'http'
REQUEST_URI = '/avatar/32/raphael.png'
SCRIPT_NAME = ''
SERVER_NAME = ''
SERVER_PORT = '80'
SERVER_PROTOCOL = 'HTTP/1.0'
WEBLATE_LANGUAGE = ''
WEBLATE_USER = "'raphael'"
WEBLATE_VERSION:Django = '2.0.6'
WEBLATE_VERSION:Git = '2.11.0'
WEBLATE_VERSION:Mercurial = '4.0'
WEBLATE_VERSION:Pillow (PIL) = '1.1.7'
WEBLATE_VERSION:PyYAML = '3.12'
WEBLATE_VERSION:Python = '3.5.3'
WEBLATE_VERSION:Translate Toolkit = '2.3.0'
WEBLATE_VERSION:Weblate = '3.0.1'
WEBLATE_VERSION:Whoosh = '2.7.4'
WEBLATE_VERSION:compressor = '2.2'
WEBLATE_VERSION:dateutil = '2.5.3'
WEBLATE_VERSION:defusedxml = '0.5.0'
WEBLATE_VERSION:django-appconf = '1.0.2'
WEBLATE_VERSION:django-crispy-forms = '1.7.2'
WEBLATE_VERSION:djangorestframework = '3.8.2'
WEBLATE_VERSION:git-svn = '2.11.0'
WEBLATE_VERSION:hub = '2.2.9'
WEBLATE_VERSION:lxml = '3.7.1'
WEBLATE_VERSION:pyLibravatar = 'N/A'
WEBLATE_VERSION:pytz = '2018.4'
WEBLATE_VERSION:pyuca = 'N/A'
WEBLATE_VERSION:six = '1.10.0'
WEBLATE_VERSION:social-auth-app-django = '2.1.0'
WEBLATE_VERSION:social-auth-core = '1.7.0'
WEBLATE_VERSION:tesserocr = '2.2.2'
WEBLATE_VERSION:user-agents = '1.1.0'
uwsgi.node = b'f71f1ce685ba'
uwsgi.version = b'2.0.14-debian'
wsgi.errors = <_io.TextIOWrapper name=2 mode='w' encoding='UTF-8'>
wsgi.file_wrapper = ''
wsgi.input = <uwsgi._Input object at 0x7f8ac5732f90>
wsgi.multiprocess = True
wsgi.multithread = False
wsgi.run_once = False
wsgi.url_scheme = 'https'
wsgi.version = '(1, 0)'

Settings:
Using settings module weblate.settings
ABSOLUTE_URL_OVERRIDES = {}
ADDITIONAL_CONFIG = '/app/data/settings-override.py'
ADMINS = "(('Admin team', 'admin@rami.io'),)"
ADMINS_CONTACT = []
ADMINS_HOSTING = []
AKISMET_API_KEY = '********************'
ALLOWED_HOSTS = ['translate.pretix.eu']
ANONYMOUS_USER_NAME = 'anonymous'
APPEND_SLASH = True
AUTHENTICATION_BACKENDS = "('social_core.backends.email.EmailAuth', 'social_core.backends.github.GithubOAuth2', 'weblate.accounts.auth.WeblateUserBackend')"
AUTH_CHECK_WINDOW = 300
AUTH_LOCKOUT_TIME = 600
AUTH_LOCK_ATTEMPTS = 10
AUTH_MAX_ATTEMPTS = 5
AUTH_PASSWORD_DAYS = '********************'
AUTH_PASSWORD_VALIDATORS = '********************'
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')"
AVATAR_DEFAULT_IMAGE = 'identicon'
AVATAR_URL_PREFIX = 'https://seccdn.libravatar.org/'
BACKGROUND_HOOKS = True
BASE_DIR = '/usr/local/lib/python3.5/dist-packages'
CACHES = {'default': {'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': 'cache:11211', 'KEY_PREFIX': '********************'}, 'avatar': {'TIMEOUT': 604800, 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', 'OPTIONS': {'MAX_ENTRIES': 1000}, 'LOCATION': '/app/data/avatar-cache'}}
CACHE_MIDDLEWARE_ALIAS = 'default'
CACHE_MIDDLEWARE_KEY_PREFIX = '********************'
CACHE_MIDDLEWARE_SECONDS = 600
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.format.PythonFormatCheck', 'weblate.checks.format.PythonBraceFormatCheck', 'weblate.checks.format.PHPFormatCheck', 'weblate.checks.format.CFormatCheck', 'weblate.checks.format.PerlFormatCheck', 'weblate.checks.format.JavascriptFormatCheck', 'weblate.checks.angularjs.AngularJSInterpolationCheck', '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.markup.XMLValidityCheck', 'weblate.checks.markup.XMLTagsCheck', 'weblate.checks.source.OptionalPluralCheck', 'weblate.checks.source.EllipsisCheck', 'weblate.checks.source.MultipleFailingCheck')"
COMMIT_PENDING_HOURS = 24
COMPONENT_NAME_LENGTH = 100
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_COMPRESSOR = 'compressor.css.CssCompressor'
COMPRESS_CSS_FILTERS = ['compressor.filters.css_default.CssAbsoluteFilter']
COMPRESS_CSS_HASHING_METHOD = 'mtime'
COMPRESS_DATA_URI_MAX_SIZE = 1024
COMPRESS_DEBUG_TOGGLE = None
COMPRESS_ENABLED = True
COMPRESS_JINJA2_GET_ENVIRONMENT = <function CompressorConf.JINJA2_GET_ENVIRONMENT at 0x7f8ac7402950>
COMPRESS_JS_COMPRESSOR = 'compressor.js.JsCompressor'
COMPRESS_JS_FILTERS = ['compressor.filters.jsmin.JSMinFilter']
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_SECURE = True
CSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME = 'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS = []
CSRF_USE_SESSIONS = True
DATABASES = {'default': {'NAME': 'weblate_pretix', 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'TEST': {'CHARSET': None, 'NAME': 'weblate_pretix', 'MIRROR': None, 'COLLATION': None}, 'TIME_ZONE': None, 'OPTIONS': {}, 'USER': 'weblate_pretix', 'PASSWORD': '********************', 'HOST': '172.17.0.1', 'PORT': '', 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql_psycopg2'}}
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_CHARSET = 'utf-8'
DEFAULT_COMMITER_EMAIL = 'noreply@weblate.org'
DEFAULT_COMMITER_NAME = 'Weblate'
DEFAULT_CONTENT_TYPE = 'text/html'
DEFAULT_CUSTOM_ACL = False
DEFAULT_EXCEPTION_REPORTER_FILTER = 'weblate.trans.debug.WeblateExceptionReporterFilter'
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL = 'translate@pretix.eu'
DEFAULT_INDEX_TABLESPACE = ''
DEFAULT_LOG = 'console'
DEFAULT_PUSH_ON_COMMIT = True
DEFAULT_TABLESPACE = ''
DEFAULT_TRANSLATION_PROPAGATION = True
DEFAULT_VCS = 'git'
DEMO_SERVER = False
DISALLOWED_USER_AGENTS = []
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = '172.17.0.1'
EMAIL_HOST_PASSWORD = '********************'
EMAIL_HOST_USER = ''
EMAIL_PORT = 25
EMAIL_SEND_HTML = True
EMAIL_SSL_CERTFILE = None
EMAIL_SSL_KEYFILE = '********************'
EMAIL_SUBJECT_PREFIX = '[Translate pretix] '
EMAIL_TIMEOUT = None
EMAIL_USE_LOCALTIME = False
EMAIL_USE_SSL = False
EMAIL_USE_TLS = False
ENABLE_AVATARS = True
ENABLE_HOOKS = True
ENABLE_HTTPS = True
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 = 'pretix-translations'
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', '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.permissions', 'weblate.screenshots', 'weblate.accounts', 'weblate.utils', 'weblate.vcs', 'weblate.wladmin', 'weblate', 'weblate.gitexport')"
INTERNAL_IPS = []
INVOICE_PATH = ''
IP_BEHIND_REVERSE_PROXY = True
IP_PROXY_HEADER = 'HTTP_X_FORWARDED_FOR'
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'), ('en-gb', 'English (United Kingdom)'), ('el', 'Ελληνικά'), ('es', 'Español'), ('fi', 'Suomi'), ('fr', 'Français'), ('fy', 'Frysk'), ('gl', 'Galego'), ('he', 'עברית'), ('hu', 'Magyar'), ('id', 'Indonesia'), ('it', 'Italiano'), ('ja', '日本語'), ('ko', '한국어'), ('ksh', 'Kölsch'), ('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 = '/'
LOCALE_PATHS = "('/usr/local/lib/python3.5/dist-packages/weblate/locale',)"
LOGGING = {'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}}, 'disable_existing_loggers': True, 'formatters': {'django.server': {'format': '[%(server_time)s] %(message)s', '()': 'django.utils.log.ServerFormatter'}, 'simple': {'format': '%(levelname)s %(message)s'}, 'syslog': {'format': 'weblate[%(process)d]: %(levelname)s %(message)s'}, 'logfile': {'format': '%(asctime)s %(levelname)s %(message)s'}}, 'version': 1, 'handlers': {'mail_admins': {'level': 'ERROR', 'filters': ['require_debug_false'], 'include_html': True, 'class': 'django.utils.log.AdminEmailHandler'}, 'django.server': {'level': 'INFO', 'formatter': 'django.server', 'class': 'logging.StreamHandler'}, 'console': {'level': 'DEBUG', 'formatter': 'simple', 'class': 'logging.StreamHandler'}}, 'loggers': {'django.request': {'level': 'ERROR', 'propagate': True, 'handlers': ['mail_admins', 'console']}, 'weblate': {'level': 'INFO', 'handlers': ['console']}, 'django.server': {'level': 'INFO', 'propagate': False, 'handlers': ['django.server']}}}
LOGGING_CONFIG = 'logging.config.dictConfig'
LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/accounts/login/'
LOGOUT_REDIRECT_URL = None
LOGOUT_URL = '/accounts/logout/'
MACHINE_TRANSLATION_SERVICES = "('weblate.trans.machine.weblatetm.WeblateTranslation', 'weblate.memory.machine.WeblateMemory')"
MANAGERS = "(('Admin team', 'admin@rami.io'),)"
MEDIA_ROOT = '/app/data/media'
MEDIA_URL = '/media/'
MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE = ['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', 'weblate.wladmin.middleware.ConfigurationErrorsMiddleware']
MIGRATION_MODULES = {}
MONTH_DAY_FORMAT = 'F j'
MT_APERTIUM_APY = None
MT_APERTIUM_KEY = '********************'
MT_DEEPL_KEY = '********************'
MT_GOOGLE_KEY = '********************'
MT_MICROSOFT_COGNITIVE_KEY = '********************'
MT_MICROSOFT_ID = None
MT_MICROSOFT_SECRET = '********************'
MT_MYMEMORY_EMAIL = 'admin@rami.io'
MT_MYMEMORY_KEY = '********************'
MT_MYMEMORY_USER = None
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_WEBLATE_LIMIT = 15
MT_YANDEX_KEY = '********************'
NEARBY_MESSAGES = 5
NUMBER_GROUPING = 0
OFFER_HOSTING = False
OFFLOAD_INDEXING = True
PASSWORD_HASHERS = '********************'
PASSWORD_RESET_TIMEOUT_DAYS = '********************'
PIWIK_SITE_ID = None
PIWIK_URL = None
PREPEND_WWW = False
REGISTRATION_CAPTCHA = True
REGISTRATION_EMAIL_MATCH = '.*'
REGISTRATION_OPEN = True
REST_FRAMEWORK = {'VIEW_DESCRIPTION_FUNCTION': 'weblate.api.views.get_view_description', 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', 'PAGE_SIZE': 20, 'DEFAULT_THROTTLE_RATES': {'anon': '100/day', 'user': '1000/day'}, 'DEFAULT_PERMISSION_CLASSES': ['rest_framework.permissions.IsAuthenticatedOrReadOnly'], 'UNAUTHENTICATED_USER': 'weblate.auth.models.get_anonymous', 'DEFAULT_THROTTLE_CLASSES': ('rest_framework.throttling.AnonRateThrottle', 'rest_framework.throttling.UserRateThrottle'), 'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework.authentication.TokenAuthentication', 'weblate.api.authentication.BearerAuthentication', 'rest_framework.authentication.SessionAuthentication')}
ROOT_URLCONF = 'weblate.urls'
SECRET_KEY = '********************'
SECURE_BROWSER_XSS_FILTER = False
SECURE_CONTENT_TYPE_NOSNIFF = False
SECURE_HSTS_INCLUDE_SUBDOMAINS = False
SECURE_HSTS_PRELOAD = False
SECURE_HSTS_SECONDS = 0
SECURE_PROXY_SSL_HEADER = None
SECURE_REDIRECT_EXEMPT = []
SECURE_SSL_HOST = None
SECURE_SSL_REDIRECT = False
SERVER_EMAIL = 'translate@pretix.eu'
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_SECURE = True
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 = []
SIMILAR_MESSAGES = 5
SIMPLIFY_LANGUAGES = True
SITE_ID = 1
SITE_TITLE = 'Translate pretix'
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_KEY = '********************'
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 = ['api']
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/#auth'
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 = True
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
TEMPLATES = [{'DIRS': ['/usr/local/lib/python3.5/dist-packages/weblate/templates'], 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'OPTIONS': {'loaders': [('django.template.loaders.cached.Loader', ['django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader'])], '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']}}]
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 = 'Europe/Berlin'
TTF_PATH = '/usr/local/lib/python3.5/dist-packages/weblate/ttf'
URL_PREFIX = ''
USE_ETAGS = False
USE_I18N = True
USE_L10N = True
USE_THOUSAND_SEPARATOR = False
USE_TZ = True
USE_X_FORWARDED_HOST = False
USE_X_FORWARDED_PORT = False
VCS_BACKENDS = "('weblate.vcs.git.GitRepository', 'weblate.vcs.git.GitWithGerritRepository', 'weblate.vcs.git.SubversionRepository', 'weblate.vcs.git.GithubRepository', '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.generate.GenerateFileAddon', 'weblate.addons.json.JSONCustomizeAddon', 'weblate.addons.properties.PropertiesSortAddon')"
WEBLATE_FORMATS = "('weblate.formats.auto.AutoFormat', '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.DTDFormat', 'weblate.formats.ttkit.WindowsRCFormat')"
WSGI_APPLICATION = None
X_FRAME_OPTIONS = 'SAMEORIGIN'
YEAR_MONTH_FORMAT = 'F Y'

Expected behaviour

No error

Server configuration

 * Weblate 3.0.1
 * Python 3.5.3
 * Django 2.0.6
 * six 1.10.0
 * social-auth-core 1.7.0
 * social-auth-app-django 2.1.0
 * django-appconf 1.0.2
 * Translate Toolkit 2.3.0
 * Whoosh 2.7.4
 * defusedxml 0.5.0
 * Git 2.11.0
 * Pillow (PIL) 1.1.7
 * dateutil 2.5.3
 * lxml 3.7.1
 * django-crispy-forms 1.7.2
 * compressor 2.2
 * djangorestframework 3.8.2
 * user-agents 1.1.0
 * pytz 2018.4
 * pyuca N/A
 * pyLibravatar N/A
 * PyYAML 3.12
 * tesserocr 2.2.2
 * Mercurial 4.0
 * git-svn 2.11.0
 * hub 2.2.9
 * Database backends: django.db.backends.postgresql_psycopg2
 * Cache backends: default:MemcachedCache, avatar:FileBasedCache
nijel commented 6 years ago

Did you upgrade from Python 2 to Python 3? Otherwise it seems unlikely that Python would be unable to read own pickled files.

raphaelm commented 6 years ago

I upgraded from the 2.9. docker container to 3.0.. Removing the avatar cache fixed the problem for me, so feel free to close this.

nijel commented 6 years ago

Yes, that did the upgrade, but this should be handled better there...

nijel commented 6 years ago

Thank you for your report, the issue you have reported has just been fixed in the Docker container and covered by docs for users who are not on Docker.

glensc commented 6 years ago

i'm using weblate/weblate:3.0.1-4 (Last Updated: 8 days ago) and the problem is not fixed

nijel commented 6 years ago

If you've upgrade to 3.0 before, the cleanup would not perform again. I've just added management command to do the cleanup of broken files only and it will be executed on container startup, so it should cover your case as well.