palewire / django-calaccess-downloads-website

An open-source archive of campaign finance and lobbying disclosure data from the California Secretary of State’s CAL-ACCESS database
http://calaccess.californiacivicdata.org
MIT License
3 stars 4 forks source link

Occasional Cloudfront errors when createlatestlinks command is trying to invalidate the cache #167

Closed palewire closed 6 years ago

palewire commented 8 years ago
Admin Command Error: /apps/calaccess/repo/manage.py updatedownloadswebsite --noinput --publish --verbosity=3

ParamValidationError
Parameter validation failed:
Invalid type for parameter DistributionId, value: None, type: <type 'NoneType'>, valid types: <type 'basestring'>

Django Version: 1.10
Python Executable: /apps/calaccess/bin/python
Python Version: 2.7.6
Python Path: ['/apps/calaccess/repo', '/apps/calaccess/src/django-calaccess-processed-data', '/apps/calaccess/lib/python2.7', '/apps/calaccess/lib/python2.7/plat-x86_64-linux-gnu', '/apps/calaccess/lib/python2.7/lib-tk', '/apps/calaccess/lib/python2.7/lib-old', '/apps/calaccess/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/apps/calaccess/local/lib/python2.7/site-packages', '/apps/calaccess/lib/python2.7/site-packages']
Server time: Mon, 19 Sep 2016 13:24:13 +0000
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'bakery',
 'compressor',
 'calaccess_raw',
 'calaccess_website',
 'storages',
 'toolbox']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback:  

File "/apps/calaccess/repo/manage.py" in <module>
  35.         execute_from_command_line(sys.argv)

File "/apps/calaccess/local/lib/python2.7/site-packages/django/core/management/__init__.py" in execute_from_command_line
  367.     utility.execute()

File "/apps/calaccess/local/lib/python2.7/site-packages/django/core/management/__init__.py" in execute
  359.             self.fetch_command(subcommand).run_from_argv(self.argv)

File "/apps/calaccess/local/lib/python2.7/site-packages/django/core/management/base.py" in run_from_argv
  305.             self.execute(*args, **cmd_options)

File "/apps/calaccess/local/lib/python2.7/site-packages/django/core/management/base.py" in execute
  356.             output = self.handle(*args, **options)

File "/apps/calaccess/repo/calaccess_website/management/commands/updatedownloadswebsite.py" in handle
  38.         call_command('createlatestlinks')

File "/apps/calaccess/local/lib/python2.7/site-packages/django/core/management/__init__.py" in call_command
  130.     return command.execute(*args, **defaults)

File "/apps/calaccess/local/lib/python2.7/site-packages/django/core/management/base.py" in execute
  356.             output = self.handle(*args, **options)

File "/apps/calaccess/repo/calaccess_website/management/commands/createlatestlinks.py" in handle
  100.             self.invalidate_keys(latest_key_list)

File "/apps/calaccess/repo/calaccess_website/management/commands/createlatestlinks.py" in invalidate_keys
  168.                 'CallerReference': str(random.getrandbits(128))

File "/apps/calaccess/local/lib/python2.7/site-packages/botocore/client.py" in _api_call
  278.             return self._make_api_call(operation_name, kwargs)

File "/apps/calaccess/local/lib/python2.7/site-packages/botocore/client.py" in _make_api_call
  548.             api_params, operation_model, context=request_context)

File "/apps/calaccess/local/lib/python2.7/site-packages/botocore/client.py" in _convert_to_request_dict
  601.             api_params, operation_model)

File "/apps/calaccess/local/lib/python2.7/site-packages/botocore/validate.py" in serialize_to_request
  270.                 raise ParamValidationError(report=report.generate_report())

Exception Type: ParamValidationError
Exception Value: Parameter validation failed:
Invalid type for parameter DistributionId, value: None, type: <type 'NoneType'>, valid types: <type 'basestring'>
Request data not supplied

Settings:
Using settings module project.settings
ABSOLUTE_URL_OVERRIDES = {}
ADMINS = 
ALLOWED_HOSTS = []
APPEND_SLASH = True
AUTHENTICATION_BACKENDS = [u'django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS = u'********************'
AUTH_USER_MODEL = u'auth.User'
AWS_ACCESS_KEY_ID = u'********************'
AWS_BUCKET_NAME = u'django-calaccess-dev-baked-content'
AWS_S3_CALLING_FORMAT = 'boto.s3.connection.OrdinaryCallingFormat'
AWS_S3_HOST = u's3-us-west-2.amazonaws.com'
AWS_S3_REGION_NAME = u'us-west-2'
AWS_S3_USE_SSL = False
AWS_SECRET_ACCESS_KEY = u'********************'
AWS_STORAGE_BUCKET_NAME = u'django-calaccess-dev-data-archive'
BAKERY_VIEWS = 
BASE_DIR = '/apps/calaccess/repo'
BUILD_DIR = '/apps/calaccess/repo/.build'
CACHES = {u'default': {u'BACKEND': u'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS = u'default'
CACHE_MIDDLEWARE_KEY_PREFIX = u'********************'
CACHE_MIDDLEWARE_SECONDS = 600
CALACCESS_DAT_SOURCE = ''
CALACCESS_STORE_ARCHIVE = True
CLOUDFRONT_ARCHIVED_DATA_DISTRIBUTION = None
COMPRESS_CACHEABLE_PRECOMPILERS = 
COMPRESS_CACHE_BACKEND = u'default'
COMPRESS_CACHE_KEY_FUNCTION = u'********************'
COMPRESS_CLEAN_CSS_ARGUMENTS = u''
COMPRESS_CLEAN_CSS_BINARY = u'cleancss'
COMPRESS_CLOSURE_COMPILER_ARGUMENTS = u''
COMPRESS_CLOSURE_COMPILER_BINARY = u'java -jar compiler.jar'
COMPRESS_CSS_COMPRESSOR = u'compressor.css.CssCompressor'
COMPRESS_CSS_FILTERS = [u'compressor.filters.css_default.CssAbsoluteFilter']
COMPRESS_CSS_HASHING_METHOD = u'mtime'
COMPRESS_DATA_URI_MAX_SIZE = 1024
COMPRESS_DEBUG_TOGGLE = None
COMPRESS_ENABLED = False
COMPRESS_JINJA2_GET_ENVIRONMENT = <function JINJA2_GET_ENVIRONMENT at 0x7f36ae55b230>
COMPRESS_JS_COMPRESSOR = u'compressor.js.JsCompressor'
COMPRESS_JS_FILTERS = [u'compressor.filters.jsmin.JSMinFilter']
COMPRESS_MINT_DELAY = 30
COMPRESS_MTIME_DELAY = 10
COMPRESS_OFFLINE = False
COMPRESS_OFFLINE_CONTEXT = {u'STATIC_URL': '/static/'}
COMPRESS_OFFLINE_MANIFEST = u'manifest.json'
COMPRESS_OFFLINE_TIMEOUT = 31536000
COMPRESS_OUTPUT_DIR = u'CACHE'
COMPRESS_PARSER = u'compressor.parser.AutoSelectParser'
COMPRESS_PRECOMPILERS = 
COMPRESS_REBUILD_TIMEOUT = 2592000
COMPRESS_ROOT = '/apps/calaccess/repo/.static'
COMPRESS_STORAGE = u'compressor.storage.CompressorFileStorage'
COMPRESS_TEMPLATE_FILTER_CONTEXT = {u'STATIC_URL': '/static/'}
COMPRESS_URL = '/static/'
COMPRESS_VERBOSE = False
COMPRESS_YUGLIFY_BINARY = u'yuglify'
COMPRESS_YUGLIFY_CSS_ARGUMENTS = u'--terminal'
COMPRESS_YUGLIFY_JS_ARGUMENTS = u'--terminal'
COMPRESS_YUI_BINARY = u'java -jar yuicompressor.jar'
COMPRESS_YUI_CSS_ARGUMENTS = u''
COMPRESS_YUI_JS_ARGUMENTS = u''
CSRF_COOKIE_AGE = 31449600
CSRF_COOKIE_DOMAIN = None
CSRF_COOKIE_HTTPONLY = False
CSRF_COOKIE_NAME = u'csrftoken'
CSRF_COOKIE_PATH = u'/'
CSRF_COOKIE_SECURE = False
CSRF_FAILURE_VIEW = u'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME = u'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS = []
DATABASES = {'default': {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'AUTOCOMMIT': True, 'ATOMIC_REQUESTS': False, 'NAME': u'calaccess_website', 'CONN_MAX_AGE': 0, 'TIME_ZONE': None, 'PORT': '5432', 'HOST': u'downloads-website-dev.ccfcfvva9ujy.us-west-2.rds.amazonaws.com', 'USER': u'ccdc', 'TEST': {'COLLATION': None, 'CHARSET': None, 'NAME': None, 'MIRROR': None}, 'PASSWORD': u'********************', 'OPTIONS': {}}}
DATABASE_ROUTERS = []
DATA_UPLOAD_MAX_MEMORY_SIZE = 2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS = 1000
DATETIME_FORMAT = u'N j, Y, P'
DATETIME_INPUT_FORMATS = [u'%Y-%m-%d %H:%M:%S', u'%Y-%m-%d %H:%M:%S.%f', u'%Y-%m-%d %H:%M', u'%Y-%m-%d', u'%m/%d/%Y %H:%M:%S', u'%m/%d/%Y %H:%M:%S.%f', u'%m/%d/%Y %H:%M', u'%m/%d/%Y', u'%m/%d/%y %H:%M:%S', u'%m/%d/%y %H:%M:%S.%f', u'%m/%d/%y %H:%M', u'%m/%d/%y']
DATE_FORMAT = u'N j, Y'
DATE_INPUT_FORMATS = [u'%Y-%m-%d', u'%m/%d/%Y', u'%m/%d/%y', u'%b %d %Y', u'%b %d, %Y', u'%d %b %Y', u'%d %b, %Y', u'%B %d %Y', u'%B %d, %Y', u'%d %B %Y', u'%d %B, %Y']
DEBUG = True
DEBUG_PROPAGATE_EXCEPTIONS = False
DECIMAL_SEPARATOR = u'.'
DEFAULT_CHARSET = u'utf-8'
DEFAULT_CONTENT_TYPE = u'text/html'
DEFAULT_EXCEPTION_REPORTER_FILTER = u'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
DEFAULT_FROM_EMAIL = u'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE = u''
DEFAULT_TABLESPACE = u''
DISALLOWED_USER_AGENTS = []
EMAIL_BACKEND = u'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_PASSWORD = u'********************'
EMAIL_HOST_USER = u'cacivicdata@gmail.com'
EMAIL_PORT = 587
EMAIL_SSL_CERTFILE = None
EMAIL_SSL_KEYFILE = u'********************'
EMAIL_SUBJECT_PREFIX = u'[Django] '
EMAIL_TIMEOUT = None
EMAIL_USE_SSL = False
EMAIL_USE_TLS = True
FILE_CHARSET = u'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS = None
FILE_UPLOAD_HANDLERS = [u'django.core.files.uploadhandler.MemoryFileUploadHandler', u'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
IGNORABLE_404_URLS = []
INSTALLED_APPS = ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'bakery', 'compressor', 'calaccess_raw', 'calaccess_website', 'storages', 'toolbox']
INTERNAL_IPS = []
LANGUAGES = [(u'af', u'Afrikaans'), (u'ar', u'Arabic'), (u'ast', u'Asturian'), (u'az', u'Azerbaijani'), (u'bg', u'Bulgarian'), (u'be', u'Belarusian'), (u'bn', u'Bengali'), (u'br', u'Breton'), (u'bs', u'Bosnian'), (u'ca', u'Catalan'), (u'cs', u'Czech'), (u'cy', u'Welsh'), (u'da', u'Danish'), (u'de', u'German'), (u'dsb', u'Lower Sorbian'), (u'el', u'Greek'), (u'en', u'English'), (u'en-au', u'Australian English'), (u'en-gb', u'British English'), (u'eo', u'Esperanto'), (u'es', u'Spanish'), (u'es-ar', u'Argentinian Spanish'), (u'es-co', u'Colombian Spanish'), (u'es-mx', u'Mexican Spanish'), (u'es-ni', u'Nicaraguan Spanish'), (u'es-ve', u'Venezuelan Spanish'), (u'et', u'Estonian'), (u'eu', u'Basque'), (u'fa', u'Persian'), (u'fi', u'Finnish'), (u'fr', u'French'), (u'fy', u'Frisian'), (u'ga', u'Irish'), (u'gd', u'Scottish Gaelic'), (u'gl', u'Galician'), (u'he', u'Hebrew'), (u'hi', u'Hindi'), (u'hr', u'Croatian'), (u'hsb', u'Upper Sorbian'), (u'hu', u'Hungarian'), (u'ia', u'Interlingua'), (u'id', u'Indonesian'), (u'io', u'Ido'), (u'is', u'Icelandic'), (u'it', u'Italian'), (u'ja', u'Japanese'), (u'ka', u'Georgian'), (u'kk', u'Kazakh'), (u'km', u'Khmer'), (u'kn', u'Kannada'), (u'ko', u'Korean'), (u'lb', u'Luxembourgish'), (u'lt', u'Lithuanian'), (u'lv', u'Latvian'), (u'mk', u'Macedonian'), (u'ml', u'Malayalam'), (u'mn', u'Mongolian'), (u'mr', u'Marathi'), (u'my', u'Burmese'), (u'nb', u'Norwegian Bokm\xe5l'), (u'ne', u'Nepali'), (u'nl', u'Dutch'), (u'nn', u'Norwegian Nynorsk'), (u'os', u'Ossetic'), (u'pa', u'Punjabi'), (u'pl', u'Polish'), (u'pt', u'Portuguese'), (u'pt-br', u'Brazilian Portuguese'), (u'ro', u'Romanian'), (u'ru', u'Russian'), (u'sk', u'Slovak'), (u'sl', u'Slovenian'), (u'sq', u'Albanian'), (u'sr', u'Serbian'), (u'sr-latn', u'Serbian Latin'), (u'sv', u'Swedish'), (u'sw', u'Swahili'), (u'ta', u'Tamil'), (u'te', u'Telugu'), (u'th', u'Thai'), (u'tr', u'Turkish'), (u'tt', u'Tatar'), (u'udm', u'Udmurt'), (u'uk', u'Ukrainian'), (u'ur', u'Urdu'), (u'vi', u'Vietnamese'), (u'zh-hans', u'Simplified Chinese'), (u'zh-hant', u'Traditional Chinese')]
LANGUAGES_BIDI = [u'he', u'ar', u'fa', u'ur']
LANGUAGE_CODE = 'en-us'
LANGUAGE_COOKIE_AGE = None
LANGUAGE_COOKIE_DOMAIN = None
LANGUAGE_COOKIE_NAME = u'django_language'
LANGUAGE_COOKIE_PATH = u'/'
LOCALE_PATHS = []
LOGGING = {'loggers': {'bakery': {'handlers': ['console', 'logfile'], 'propagate': True, 'level': 'DEBUG'}, 'calaccess_raw.management': {'handlers': ['logfile', 'mail_admins'], 'propagate': True, 'level': 'DEBUG'}, 'management_commands': {'handlers': ['mail_admins', 'logfile'], 'propagate': True, 'level': 'ERROR'}, 'calaccess_website.management': {'handlers': ['console', 'logfile'], 'propagate': True, 'level': 'DEBUG'}}, 'disable_existing_loggers': False, 'handlers': {'console': {'formatter': 'verbose', 'class': 'logging.StreamHandler', 'level': 'DEBUG'}, 'logfile': {'backupCount': 0, 'level': 'DEBUG', 'filename': '/apps/calaccess/repo/django.log', 'formatter': 'verbose', 'class': 'logging.handlers.RotatingFileHandler', 'maxBytes': 5242880}, 'null': {'class': 'logging.NullHandler', 'level': 'DEBUG'}, 'mail_admins': {'class': 'django.utils.log.AdminEmailHandler', 'filters': [], 'level': 'INFO'}}, 'formatters': {'simple': {'format': '%(message)s'}, 'verbose': {'datefmt': '%d/%b/%Y %H:%M:%S', 'format': '%(levelname)s|%(asctime)s|%(module)s|%(message)s'}}, 'version': 1, 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}}}
LOGGING_CONFIG = u'logging.config.dictConfig'
LOGIN_REDIRECT_URL = u'/accounts/profile/'
LOGIN_URL = u'/accounts/login/'
LOGOUT_REDIRECT_URL = None
MANAGERS = []
MEDIA_ROOT = u''
MEDIA_URL = u''
MESSAGE_STORAGE = u'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE = None
MIDDLEWARE_CLASSES = ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware']
MIGRATION_MODULES = {}
MONTH_DAY_FORMAT = u'F j'
NUMBER_GROUPING = 0
PASSWORD_HASHERS = u'********************'
PASSWORD_RESET_TIMEOUT_DAYS = u'********************'
PREPEND_WWW = False
ROOT_URLCONF = 'project.urls'
SECRET_KEY = u'********************'
SECURE_BROWSER_XSS_FILTER = False
SECURE_CONTENT_TYPE_NOSNIFF = False
SECURE_HSTS_INCLUDE_SUBDOMAINS = False
SECURE_HSTS_SECONDS = 0
SECURE_PROXY_SSL_HEADER = None
SECURE_REDIRECT_EXEMPT = []
SECURE_SSL_HOST = None
SECURE_SSL_REDIRECT = False
SERVER_EMAIL = u'root@localhost'
SESSION_CACHE_ALIAS = u'default'
SESSION_COOKIE_AGE = 1209600
SESSION_COOKIE_DOMAIN = None
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_NAME = u'sessionid'
SESSION_COOKIE_PATH = u'/'
SESSION_COOKIE_SECURE = False
SESSION_ENGINE = u'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
SESSION_FILE_PATH = None
SESSION_SAVE_EVERY_REQUEST = False
SESSION_SERIALIZER = u'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE = 'project.settings'
SHORT_DATETIME_FORMAT = u'm/d/Y P'
SHORT_DATE_FORMAT = u'm/d/Y'
SIGNING_BACKEND = u'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS = []
STATICFILES_DIRS = []
STATICFILES_FINDERS = 
STATICFILES_STORAGE = u'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT = '/apps/calaccess/repo/.static'
STATIC_URL = '/static/'
TEMPLATES = [{'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'calaccess_website.context_processors.calaccess_website']}, 'BACKEND': 'django.template.backends.django.DjangoTemplates'}]
TEST_NON_SERIALIZED_APPS = []
TEST_RUNNER = u'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR = u','
TIME_FORMAT = u'P'
TIME_INPUT_FORMATS = [u'%H:%M:%S', u'%H:%M:%S.%f', u'%H:%M']
TIME_ZONE = 'UTC'
USE_ETAGS = False
USE_I18N = True
USE_L10N = False
USE_THOUSAND_SEPARATOR = False
USE_TZ = True
USE_X_FORWARDED_HOST = False
USE_X_FORWARDED_PORT = False
WSGI_APPLICATION = 'project.wsgi.application'
X_FRAME_OPTIONS = u'SAMEORIGIN'
YEAR_MONTH_FORMAT = u'F Y'
palewire commented 8 years ago

Ah, I think this error might be from the dev server not the production server.