Closed khandelwal closed 9 years ago
So it looks like the tmp dir was an issue. However, now were are getting a new issue..
2015-04-29T13:41:40.42-0400 [App/0] ERR Traceback (most recent call last):
2015-04-29T13:41:40.42-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/db/backends/utils.py", line 65, in execute
2015-04-29T13:41:40.42-0400 [App/0] ERR return self.cursor.execute(sql, params)
2015-04-29T13:41:40.42-0400 [App/0] ERR psycopg2.IntegrityError: duplicate key value violates unique constraint "foia_hub_stats_agency_id_6b16dc7079dd4de9_uniq"
2015-04-29T13:41:40.42-0400 [App/0] ERR DETAIL: Key (agency_id, office_id, year, stat_type)=(20, 11, 2014, S) already exists.
2015-04-29T13:41:40.42-0400 [App/0] ERR The above exception was the direct cause of the following exception:
2015-04-29T13:41:40.42-0400 [App/0] ERR Traceback (most recent call last):
2015-04-29T13:41:40.42-0400 [App/0] ERR File "manage.py", line 10, in <module>
2015-04-29T13:41:40.42-0400 [App/0] ERR execute_from_command_line(sys.argv)
2015-04-29T13:41:40.42-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
2015-04-29T13:41:40.43-0400 [App/0] ERR utility.execute()
2015-04-29T13:41:40.43-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/core/management/__init__.py", line 377, in execute
2015-04-29T13:41:40.43-0400 [App/0] ERR self.fetch_command(subcommand).run_from_argv(self.argv)
2015-04-29T13:41:40.43-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/core/management/base.py", line 288, in run_from_argv
2015-04-29T13:41:40.44-0400 [App/0] ERR self.execute(*args, **options.__dict__)
2015-04-29T13:41:40.44-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/core/management/base.py", line 338, in execute
2015-04-29T13:41:40.44-0400 [App/0] ERR output = self.handle(*args, **options)
2015-04-29T13:41:40.44-0400 [App/0] ERR File "/home/vcap/app/foia_hub/management/commands/load_agency_contacts.py", line 26, in handle
2015-04-29T13:41:40.44-0400 [App/0] ERR process_yamls(yaml_folder)
2015-04-29T13:41:40.44-0400 [App/0] ERR File "/home/vcap/app/foia_hub/scripts/load_agency_contacts.py", line 209, in process_yamls
2015-04-29T13:41:40.44-0400 [App/0] ERR load_data(data)
2015-04-29T13:41:40.44-0400 [App/0] ERR File "/home/vcap/app/foia_hub/scripts/load_agency_contacts.py", line 200, in load_data
2015-04-29T13:41:40.44-0400 [App/0] ERR add_request_time_statistics(dept_rec, a, o)
2015-04-29T13:41:40.44-0400 [App/0] ERR File "/home/vcap/app/foia_hub/scripts/load_agency_contacts.py", line 111, in add_request_time_statistics
2015-04-29T13:41:40.44-0400 [App/0] ERR stat.save()
2015-04-29T13:41:40.44-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/db/models/base.py", line 590, in save
2015-04-29T13:41:40.44-0400 [App/0] ERR force_update=force_update, update_fields=update_fields)
2015-04-29T13:41:40.44-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/db/models/base.py", line 618, in save_base
2015-04-29T13:41:40.44-0400 [App/0] ERR updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
2015-04-29T13:41:40.44-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/db/models/base.py", line 699, in _save_table
2015-04-29T13:41:40.45-0400 [App/0] ERR result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
2015-04-29T13:41:40.45-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/db/models/base.py", line 732, in _do_insert
2015-04-29T13:41:40.45-0400 [App/0] ERR using=using, raw=raw)
2015-04-29T13:41:40.45-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/db/models/manager.py", line 92, in manager_method
2015-04-29T13:41:40.45-0400 [App/0] ERR return getattr(self.get_queryset(), name)(*args, **kwargs)
2015-04-29T13:41:40.45-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/db/models/query.py", line 921, in _insert
2015-04-29T13:41:40.45-0400 [App/0] ERR return query.get_compiler(using=using).execute_sql(return_id)
2015-04-29T13:41:40.45-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/db/models/sql/compiler.py", line 920, in execute_sql
2015-04-29T13:41:40.45-0400 [App/0] ERR cursor.execute(sql, params)
2015-04-29T13:41:40.45-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/db/backends/utils.py", line 65, in execute
2015-04-29T13:41:40.45-0400 [App/0] ERR return self.cursor.execute(sql, params)
2015-04-29T13:41:40.45-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/db/utils.py", line 94, in __exit__
2015-04-29T13:41:40.45-0400 [App/0] ERR six.reraise(dj_exc_type, dj_exc_value, traceback)
2015-04-29T13:41:40.45-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/utils/six.py", line 549, in reraise
2015-04-29T13:41:40.45-0400 [App/0] ERR raise value.with_traceback(tb)
2015-04-29T13:41:40.45-0400 [App/0] ERR File "/app/.heroku/python/lib/python3.4/site-packages/django/db/backends/utils.py", line 65, in execute
2015-04-29T13:41:40.46-0400 [App/0] ERR return self.cursor.execute(sql, params)
2015-04-29T13:41:40.46-0400 [App/0] ERR django.db.utils.IntegrityError: duplicate key value violates unique constraint "foia_hub_stats_agency_id_6b16dc7079dd4de9_uniq"
2015-04-29T13:41:40.46-0400 [App/0] ERR DETAIL: Key (agency_id, office_id, year, stat_type)=(20, 11, 2014, S) already exists.
It appears that Stats.objects.filter(agency=agency, office=office).delete()
is not actually deleting the old object.
I think it's worth figuring out what's going on here.
This should be fixed now.
It looks like data loading is failing in production and staging.