Repository: openstates/openstates-scrapers

Issue:
TN failing since at least 2019-03-14
TN has been failing since 2019-03-14

Based on automated runs it appears that TN has not run successfully in 2 days (2019-03-14).


```
  06:05:11 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Smith"}
06:05:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Love"}
06:05:14 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Hardaway"}
06:05:14 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Jernigan"}
06:05:14 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Cepicky"}
06:05:17 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Haston"}
06:05:18 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Wright"}
06:05:21 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "DeBerry"}
06:05:23 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Powell"}
06:05:24 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Cochran"}
06:05:26 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Hodges"}
06:05:26 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "McNally"}
06:05:29 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Van Huss"}
06:05:32 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Johnson C"}
06:05:32 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Whitson"}
06:05:32 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Helton"}
06:05:36 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Hulsey"}
06:05:40 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Lafferty"}
06:05:47 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Farmer"}
06:05:56 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Dixie"}
06:06:10 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Hakeem"}
06:10:49 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Mr. Speaker Casada"}
06:10:49 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Mr. Speaker McNally"}
06:10:50 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Rose"}
loaded Open States pupa settings...
tn (scrape, import)
  bills: {}
import jurisdictions...
import bills...
import vote events...
Traceback (most recent call last):
  File "/opt/**PGUSER**/venv-pupa//bin/pupa", line 11, in <module>
    load_entry_point('pupa', 'console_scripts', 'pupa')()
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/cli/__main__.py", line 68, in main
    subcommands[args.subcommand].handle(args, other)
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 278, in handle
    return self.do_handle(args, other, juris)
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 329, in do_handle
    report['import'] = self.do_import(juris, args)
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 225, in do_import
    report.update(vote_event_importer.import_directory(datadir))
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/importers/base.py", line 196, in import_directory
    return self.import_data(json_stream())
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/importers/base.py", line 233, in import_data
    obj_id, what = self.import_item(data)
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/importers/base.py", line 272, in import_item
    raise DuplicateItemError(data, obj, related.get('sources', []))
pupa.exceptions.DuplicateItemError: attempt to import data that would conflict with data already in the import: {'identifier': '', 'motion_text': 'HOUSE COMMERCE COMMITTEE: Rec. for pass. if am., ref. to Calendar & Rules Committee 3/5/2019 (1)', 'motion_classification': ['passage'], 'start_date': '2019-03-05', 'result': 'pass', 'extras': {}, 'legislative_session_id': UUID('f61663be-b9cf-490a-bdee-ee666c04b281'), 'organization_id': 'ocd-organization/47760e16-8071-49dd-bd9f-354198c8b653', 'bill_id': 'ocd-bill/dcf3a53d-3616-476f-a064-81c008eb276b'} (already imported as HOUSE COMMERCE COMMITTEE: Rec. for pass. if am., ref. to Calendar & Rules Committee 3/5/2019 (1) on HB 1064 in Tennessee 111th Regular Session (2019-2020))
obj1 sources: ['http://wapp.capitol.tn.gov/apps/BillInfo/default.aspx?BillNumber=HB1064&GA=111']
obj2 sources: ['http://wapp.capitol.tn.gov/apps/BillInfo/default.aspx?BillNumber=HB1064&GA=111']
```

Visit http://bobsled.openstates.org for more info.



Discussion:

Resolving patch:
diff --git a/openstates/tn/bills.py b/openstates/tn/bills.py
--- a/openstates/tn/bills.py
+++ b/openstates/tn/bills.py
@@ -285,10 +285,10 @@ def scrape_chamber(self, chamber, session):
             bill_list_page = lxml.html.fromstring(bill_list_page)
             bill_list_page.make_links_absolute(bill_listing)
 
-            for bill_link in bill_list_page.xpath(
+            for bill_link in set(bill_list_page.xpath(
                 '//h1[text()="Legislation"]/following-sibling::div/'
                 'div/div/div//a/@href'
-            ):
+            )):
                 bill = self.scrape_bill(session, bill_link)
                 if bill:
                     yield bill


Test patch: