{"action":"created","issue":{"url":"https://api.github.com/repos/Flexget/Flexget/issues/868","repository_url":"https://api.github.com/repos/Flexget/Flexget","labels_url":"https://api.github.com/repos/Flexget/Flexget/issues/868/labels{/name}","comments_url":"https://api.github.com/repos/Flexget/Flexget/issues/868/comments","events_url":"https://api.github.com/repos/Flexget/Flexget/issues/868/events","html_url":"https://github.com/Flexget/Flexget/issues/868","id":134287816,"number":868,"title":"api_tvmaze sqlite3.IntegrityError ","user":{"login":"fabrizio5680","id":1358758,"avatar_url":"https://avatars.githubusercontent.com/u/1358758?v=3","gravatar_id":"","url":"https://api.github.com/users/fabrizio5680","html_url":"https://github.com/fabrizio5680","followers_url":"https://api.github.com/users/fabrizio5680/followers","following_url":"https://api.github.com/users/fabrizio5680/following{/other_user}","gists_url":"https://api.github.com/users/fabrizio5680/gists{/gist_id}","starred_url":"https://api.github.com/users/fabrizio5680/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabrizio5680/subscriptions","organizations_url":"https://api.github.com/users/fabrizio5680/orgs","repos_url":"https://api.github.com/users/fabrizio5680/repos","events_url":"https://api.github.com/users/fabrizio5680/events{/privacy}","received_events_url":"https://api.github.com/users/fabrizio5680/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Flexget/Flexget/labels/Bug","name":"Bug","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"liiight","id":4374581,"avatar_url":"https://avatars.githubusercontent.com/u/4374581?v=3","gravatar_id":"","url":"https://api.github.com/users/liiight","html_url":"https://github.com/liiight","followers_url":"https://api.github.com/users/liiight/followers","following_url":"https://api.github.com/users/liiight/following{/other_user}","gists_url":"https://api.github.com/users/liiight/gists{/gist_id}","starred_url":"https://api.github.com/users/liiight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liiight/subscriptions","organizations_url":"https://api.github.com/users/liiight/orgs","repos_url":"https://api.github.com/users/liiight/repos","events_url":"https://api.github.com/users/liiight/events{/privacy}","received_events_url":"https://api.github.com/users/liiight/received_events","type":"User","site_admin":false},"milestone":null,"comments":17,"created_at":"2016-02-17T14:01:54Z","updated_at":"2016-03-07T07:26:22Z","closed_at":null,"body":"1.2.454 on Python 2.7.11 running on Android.\r\n\r\n```\r\n2016-02-17 13:56 DEBUG    api_tvmaze    tvshows         creating new episode for show Modern Family\r\n2016-02-17 13:56 CRITICAL task          tvshows         BUG: Unhandled error in plugin discover: (sqlite3.IntegrityError) UNIQUE constraint failed: tvmaze_episode.tvmaze_id [SQL: u'INSERT INTO tvmaze_episode (tvmaze_id, series_id, number, season_number, title, airdate, url, original_image, medium_image, airstamp, runtime, summary, last_update) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters: (574774, 80, 13, 7, u'Thunk in the Trunk', '2016-02-17 00:00:00.000000', u'http://www.tvmaze.com/episodes/574774/modern-family-7x13-thunk-in-the-trunk', None, None, '2016-02-17 21:00:00.000000', 30, u\"Now that Claire has been running the closet business for a while, she \\nand Phil have fallen into a new rhythm, with Claire assuming the role of \\nthe wheeling and dealing breadwinner and Phil as the invisible \\nhousewife, but Phil will not stand for being ignored and \\nunderappreciated for long. Meanwhile, Jay lets his jealousy get the best\\n of him when a life-size cutout of Gloria for her grocery store hot \\nsauce display solicits all kinds of unsavory attention from men, so he \\nenlists Manny as his accomplice in a poorly orchestrated heist. And, Cam\\n and Mitch are being extra hospitable to get better reviews for their \\nrental property, but when the new renters start acting undeniably \\nsuspicious, they can't help but snoop.\", '2016-02-17 13:56:24.786713')]\r\n2016-02-17 13:56 CRITICAL manager       tvshows         An unexpected crash has occurred. Writing crash report to /storage/external/mxq/.flexget/crash_report.2016.02.17.135624834568.log. Please verify you are running the latest version of flexget by using \"flexget -V\" from CLI or by using version_checker plugin at http://flexget.com/wiki/Plugins/version_checker. You are currently using version 1.2.454\r\n2016-02-17 13:56 DEBUG    manager       tvshows         Traceback:\r\nTraceback (most recent call last):\r\n  File \"/opt/lib/python2.7/site-packages/flexget/task.py\", line 438, in __run_plugin\r\n    return method(*args, **kwargs)\r\n  File \"/opt/lib/python2.7/site-packages/flexget/event.py\", line 22, in __call__\r\n    return self.func(*args, **kwargs)\r\n  File \"/opt/lib/python2.7/site-packages/flexget/plugins/input/discover.py\", line 268, in on_task_input\r\n    entries = self.estimated(entries)\r\n  File \"/opt/lib/python2.7/site-packages/flexget/plugins/input/discover.py\", line 190, in estimated\r\n    est_date = estimator.estimate(entry)\r\n  File \"/opt/lib/python2.7/site-packages/flexget/plugins/estimators/est_released.py\", line 28, in estimate\r\n    estimate = estimator(entry)\r\n  File \"/opt/lib/python2.7/site-packages/flexget/plugins/estimators/est_release_series_tvmaze.py\", line 51, in estimate\r\n    episode = lookup(**kwargs)\r\n  File \"/opt/lib/python2.7/site-packages/flexget/utils/database.py\", line 30, in wrapper\r\n    return func(*args, **kwargs)\r\n  File \"/opt/lib/python2.7/site-packages/flexget/utils/sqlalchemy_utils.py\", line 137, in __exit__\r\n    self.commit()\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 801, in commit\r\n    self.transaction.commit()\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 392, in commit\r\n    self._prepare_impl()\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 372, in _prepare_impl\r\n    self.session.flush()\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 2019, in flush\r\n    self._flush(objects)\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 2137, in _flush\r\n    transaction.rollback(_capture_exception=True)\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py\", line 60, in __exit__\r\n    compat.reraise(exc_type, exc_value, exc_tb)\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 2101, in _flush\r\n    flush_context.execute()\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py\", line 373, in execute\r\n    rec.execute(self)\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py\", line 532, in execute\r\n    uow\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py\", line 174, in save_obj\r\n    mapper, table, insert)\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py\", line 767, in _emit_insert_statements\r\n    execute(statement, multiparams)\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 914, in execute\r\n    return meth(self, multiparams, params)\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/sql/elements.py\", line 323, in _execute_on_connection\r\n    return connection._execute_clauseelement(self, multiparams, params)\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 1010, in _execute_clauseelement\r\n    compiled_sql, distilled_params\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 1146, in _execute_context\r\n    context)\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 1341, in _handle_dbapi_exception\r\n    exc_info\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/util/compat.py\", line 200, in raise_from_cause\r\n    reraise(type(exception), exception, tb=exc_tb, cause=cause)\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 1139, in _execute_context\r\n    context)\r\n  File \"/opt/lib/python2.7/site-packages/sqlalchemy/engine/default.py\", line 450, in do_execute\r\n    cursor.execute(statement, parameters)\r\nIntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: tvmaze_episode.tvmaze_id [SQL: u'INSERT INTO tvmaze_episode (tvmaze_id, series_id, number, season_number, title, airdate, url, original_image, medium_image, airstamp, runtime, summary, last_update) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters: (574774, 80, 13, 7, u'Thunk in the Trunk', '2016-02-17 00:00:00.000000', u'http://www.tvmaze.com/episodes/574774/modern-family-7x13-thunk-in-the-trunk', None, None, '2016-02-17 21:00:00.000000', 30, u\"Now that Claire has been running the closet business for a while, she \\nand Phil have fallen into a new rhythm, with Claire assuming the role of \\nthe wheeling and dealing breadwinner and Phil as the invisible \\nhousewife, but Phil will not stand for being ignored and \\nunderappreciated for long. Meanwhile, Jay lets his jealousy get the best\\n of him when a life-size cutout of Gloria for her grocery store hot \\nsauce display solicits all kinds of unsavory attention from men, so he \\nenlists Manny as his accomplice in a poorly orchestrated heist. And, Cam\\n and Mitch are being extra hospitable to get better reviews for their \\nrental property, but when the new renters start acting undeniably \\nsuspicious, they can't help but snoop.\", '2016-02-17 13:56:24.786713')]\r\n2016-02-17 13:56 WARNING  task          tvshows         Aborting task (plugin: discover)\r\n```\r\n\r\nAlso Attached log\r\n[log.txt](https://github.com/Flexget/Flexget/files/134434/log.txt)\r\n"},"comment":{"url":"https://api.github.com/repos/Flexget/Flexget/issues/comments/193135580","html_url":"https://github.com/Flexget/Flexget/issues/868#issuecomment-193135580","issue_url":"https://api.github.com/repos/Flexget/Flexget/issues/868","id":193135580,"user":{"login":"henriksjodahl","id":570521,"avatar_url":"https://avatars.githubusercontent.com/u/570521?v=3","gravatar_id":"","url":"https://api.github.com/users/henriksjodahl","html_url":"https://github.com/henriksjodahl","followers_url":"https://api.github.com/users/henriksjodahl/followers","following_url":"https://api.github.com/users/henriksjodahl/following{/other_user}","gists_url":"https://api.github.com/users/henriksjodahl/gists{/gist_id}","starred_url":"https://api.github.com/users/henriksjodahl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henriksjodahl/subscriptions","organizations_url":"https://api.github.com/users/henriksjodahl/orgs","repos_url":"https://api.github.com/users/henriksjodahl/repos","events_url":"https://api.github.com/users/henriksjodahl/events{/privacy}","received_events_url":"https://api.github.com/users/henriksjodahl/received_events","type":"User","site_admin":false},"created_at":"2016-03-07T07:26:22Z","updated_at":"2016-03-07T07:26:22Z","body":"Yeah, i guess that weren't that clear in any of the comments above"}}