{"action":"created","issue":{"url":"https://api.github.com/repos/Murodese/pynab/issues/204","labels_url":"https://api.github.com/repos/Murodese/pynab/issues/204/labels{/name}","comments_url":"https://api.github.com/repos/Murodese/pynab/issues/204/comments","events_url":"https://api.github.com/repos/Murodese/pynab/issues/204/events","html_url":"https://github.com/Murodese/pynab/issues/204","id":89202622,"number":204,"title":"Post-processing error","user":{"login":"boo1234","id":12946953,"avatar_url":"https://avatars.githubusercontent.com/u/12946953?v=3","gravatar_id":"","url":"https://api.github.com/users/boo1234","html_url":"https://github.com/boo1234","followers_url":"https://api.github.com/users/boo1234/followers","following_url":"https://api.github.com/users/boo1234/following{/other_user}","gists_url":"https://api.github.com/users/boo1234/gists{/gist_id}","starred_url":"https://api.github.com/users/boo1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boo1234/subscriptions","organizations_url":"https://api.github.com/users/boo1234/orgs","repos_url":"https://api.github.com/users/boo1234/repos","events_url":"https://api.github.com/users/boo1234/events{/privacy}","received_events_url":"https://api.github.com/users/boo1234/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-18T05:22:18Z","updated_at":"2015-06-19T04:43:13Z","closed_at":null,"body":"So after a few weeks of no movies being snatched by CouchPotato, I decided to look into what was going on. Checking my supervisor stderr logs for the `postproc` script, I see the following. Further, I see that supervisor is constantly trying to start postproc after it dies, which is to be expected.\r\n\r\n```\r\n2015-06-17 22:17:41 INFO  log: started pynab logger\r\n2015-06-17 22:17:41 INFO  postprocess: starting post-processing...\r\n2015-06-17 22:17:41 INFO  postprocess: starting with a quick post-process to clear out the cruft that's available locally...\r\nTraceback (most recent call last):\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/engine/base.py\", line 1139, in _execute_context\r\n    context)\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/engine/default.py\", line 442, in do_execute\r\n    cursor.execute(statement, parameters)\r\npsycopg2.IntegrityError: update or delete on table \"metablack\" violates foreign key constraint \"releases_movie_metablack_id_fkey\" on table \"releases\"\r\nDETAIL:  Key (id)=(190062) is still referenced from table \"releases\".\r\n\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/boo1234/software/pynab/postprocess.py\", line 223, in <module>\r\n    main()\r\n  File \"/home/boo1234/software/pynab/postprocess.py\", line 79, in main\r\n    scripts.quick_postprocess.local_postprocess()\r\n  File \"/home/boo1234/software/pynab/scripts/quick_postprocess.py\", line 13, in local_postprocess\r\n    db.query(MetaBlack).filter(MetaBlack.status=='IMPOSSIBLE').filter((MetaBlack.movie!=None)|(MetaBlack.tvshow!=None)).delete(synchronize_session=False)\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/orm/query.py\", line 2818, in delete\r\n    delete_op.exec_()\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/orm/persistence.py\", line 1074, in exec_\r\n    self._do_exec()\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/orm/persistence.py\", line 1252, in _do_exec\r\n    mapper=self.mapper)\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/orm/session.py\", line 1023, in execute\r\n    bind, close_with_result=True).execute(clause, params or {})\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/engine/base.py\", line 914, in execute\r\n    return meth(self, multiparams, params)\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/sql/elements.py\", line 323, in _execute_on_connection\r\n    return connection._execute_clauseelement(self, multiparams, params)\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/engine/base.py\", line 1010, in _execute_clauseelement\r\n    compiled_sql, distilled_params\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/engine/base.py\", line 1146, in _execute_context\r\n    context)\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/engine/base.py\", line 1339, in _handle_dbapi_exception\r\n    exc_info\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/util/compat.py\", line 188, in raise_from_cause\r\n    reraise(type(exception), exception, tb=exc_tb, cause=exc_value)\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/util/compat.py\", line 181, in reraise\r\n    raise value.with_traceback(tb)\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/engine/base.py\", line 1139, in _execute_context\r\n    context)\r\n  File \"/home/boo1234/.virtualenvs/pynab/lib/python3.4/site-packages/sqlalchemy/engine/default.py\", line 442, in do_execute\r\n    cursor.execute(statement, parameters)\r\nsqlalchemy.exc.IntegrityError: (psycopg2.IntegrityError) update or delete on table \"metablack\" violates foreign key constraint \"releases_movie_metablack_id_fkey\" on table \"releases\"\r\nDETAIL:  Key (id)=(190062) is still referenced from table \"releases\".\r\n [SQL: 'DELETE FROM metablack WHERE metablack.status = %(status_1)s AND ((EXISTS (SELECT 1 \\nFROM releases \\nWHERE metablack.id = releases.movie_metablack_id)) OR (EXISTS (SELECT 1 \\nFROM releases \\nWHERE metablack.id = releases.tvshow_metablack_id)))'] [parameters: {'status_1': 'IMPOSSIBLE'}]\r\n```"},"comment":{"url":"https://api.github.com/repos/Murodese/pynab/issues/comments/113366111","html_url":"https://github.com/Murodese/pynab/issues/204#issuecomment-113366111","issue_url":"https://api.github.com/repos/Murodese/pynab/issues/204","id":113366111,"user":{"login":"Murodese","id":86297,"avatar_url":"https://avatars.githubusercontent.com/u/86297?v=3","gravatar_id":"","url":"https://api.github.com/users/Murodese","html_url":"https://github.com/Murodese","followers_url":"https://api.github.com/users/Murodese/followers","following_url":"https://api.github.com/users/Murodese/following{/other_user}","gists_url":"https://api.github.com/users/Murodese/gists{/gist_id}","starred_url":"https://api.github.com/users/Murodese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Murodese/subscriptions","organizations_url":"https://api.github.com/users/Murodese/orgs","repos_url":"https://api.github.com/users/Murodese/repos","events_url":"https://api.github.com/users/Murodese/events{/privacy}","received_events_url":"https://api.github.com/users/Murodese/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T04:43:13Z","updated_at":"2015-06-19T04:43:13Z","body":"Try that: `./pynab.py update`"}}