Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process_stats.py erroring for some loans #4542

Closed
cdrini opened this issue Feb 4, 2021 · 2 comments
Closed

process_stats.py erroring for some loans #4542

cdrini opened this issue Feb 4, 2021 · 2 comments
Assignees
Labels
Lead: @cclauss Issues overseen by Chris (Python3 & Dev-ops lead 2019-2021) [managed] Needs: Lead Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Type: Bug Something isn't working. [managed]

Comments

@cdrini
Copy link
Collaborator

cdrini commented Feb 4, 2021

Evidence / Screenshot (if possible)

2021-02-04 19:47:02 [420] [openlibrary.solrwriter] [INFO] updating loans/loan-1944642791
2021-02-04 19:47:02 [420] [openlibrary.solrwriter] [ERROR] Error in normalizing 'loans/loan-1944635007'
Traceback (most recent call last):
File "/openlibrary/scripts/openlibrary-server", line 133, in
main()
File "/openlibrary/scripts/openlibrary-server", line 130, in main
start_server()
File "/openlibrary/scripts/openlibrary-server", line 46, in start_server
infogami.run(args)
File "/openlibrary/infogami/init.py", line 151, in run
run_action(args[0], args[1:])
File "/openlibrary/infogami/init.py", line 138, in run_action
a(*args)
File "/openlibrary/openlibrary/actions.py", line 11, in runmain
mod.main(*args)
File "/openlibrary/openlibrary/solr/process_stats.py", line 219, in main
add_events_to_solr(events)
File "/openlibrary/openlibrary/solr/process_stats.py", line 210, in add_events_to_solr
update_solr(solrdocs)
File "/openlibrary/openlibrary/solr/process_stats.py", line 261, in update_solr
solr.update(doc)
File "/openlibrary/openlibrary/solr/solrwriter.py", line 57, in update
self.flush()
File "/openlibrary/openlibrary/solr/solrwriter.py", line 64, in flush
node = dict2element(doc)
File "/openlibrary/openlibrary/solr/solrwriter.py", line 108, in dict2element
add_field(doc, k, v)
File "/openlibrary/openlibrary/solr/solrwriter.py", line 98, in add_field
value = value.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'

Steps to Reproduce

  1. python $SCRIPTS/openlibrary-server /olsystem/etc/openlibrary.yml runmain openlibrary.solr.process_stats --load-from-db
  • Actual: Error
  • Expected: No error

Details

NA

Proposal & Constraints

Related files

Stakeholders

@cclauss

@cdrini cdrini added Type: Bug Something isn't working. [managed] Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Lead: @cclauss Issues overseen by Chris (Python3 & Dev-ops lead 2019-2021) [managed] Needs: Lead labels Feb 4, 2021
@cdrini cdrini added this to the Active Sprint milestone Feb 4, 2021
@cdrini cdrini changed the title process_stats.py/ erroring for some loans process_stats.py erroring for some loans Feb 4, 2021
@dherbst
Copy link
Contributor

dherbst commented Feb 5, 2021

The issue is the .decode on py3 str does not exist. I put #4545 up to fix it.

@cclauss
Copy link
Collaborator

cclauss commented Feb 12, 2021

Closed by @dherbst in #4545

@cclauss cclauss closed this as completed Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lead: @cclauss Issues overseen by Chris (Python3 & Dev-ops lead 2019-2021) [managed] Needs: Lead Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Type: Bug Something isn't working. [managed]
Projects
None yet
Development

No branches or pull requests

3 participants