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

Make sure we handle ProblemDetail response from _crawlable_feed (PP-1975) #2199

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

jonathangreen
Copy link
Member

@jonathangreen jonathangreen commented Nov 27, 2024

Description

Make sure we are checking for a ProblemDetail response from _crawlable_feed.

Motivation and Context

We are seeing this exception happening in our logs:

Traceback (most recent call last):
  File "/var/www/circulation/env/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/circulation/env/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/var/www/circulation/src/palace/manager/api/routes.py", line 120, in decorated
    return f(*args, **kwargs)
  File "/var/www/circulation/src/palace/manager/api/routes.py", line 93, in wrapped_function
    resp = make_response(f(*args, **kwargs))
  File "/var/www/circulation/src/palace/manager/core/app_server.py", line 87, in decorated
    v = f(*args, **kwargs)
  File "/var/www/circulation/src/palace/manager/core/app_server.py", line 163, in compressor
    return f(*args, **kwargs)
  File "/var/www/circulation/src/palace/manager/api/routes.py", line 288, in crawlable_library_feed
    return app.manager.opds_feeds.crawlable_library_feed()
  File "/var/www/circulation/src/palace/manager/api/controller/opds_feed.py", line 203, in crawlable_library_feed
    return self._crawlable_feed(title=title, url=url, worklist=lane)
  File "/var/www/circulation/src/palace/manager/api/controller/opds_feed.py", line 274, in _crawlable_feed
    return feed_class.page(
  File "src/dependency_injector/_cwiring.pyx", line 28, in dependency_injector._cwiring._get_sync_patched._patched
  File "/var/www/circulation/src/palace/manager/feed/acquisition.py", line 461, in page
    works = worklist.works(
  File "src/dependency_injector/_cwiring.pyx", line 28, in dependency_injector._cwiring._get_sync_patched._patched
  File "/var/www/circulation/src/palace/manager/sqlalchemy/model/lane.py", line 1892, in works
    filter = self.filter(_db, facets)
  File "/var/www/circulation/src/palace/manager/sqlalchemy/model/lane.py", line 1906, in filter
    filter = Filter.from_worklist(_db, self, facets)
  File "/var/www/circulation/src/palace/manager/search/external_search.py", line 1477, in from_worklist
    return cls(
  File "/var/www/circulation/src/palace/manager/search/external_search.py", line 1660, in __init__
    facets.modify_search_filter(self)
AttributeError: 'ProblemDetail' object has no attribute 'modify_search_filter'

JIRA:
PP-1975
PP-1860

How Has This Been Tested?

  • Running unit tests

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@jonathangreen jonathangreen requested a review from a team November 27, 2024 21:11
@jonathangreen jonathangreen added the bug Something isn't working label Nov 27, 2024
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.09%. Comparing base (be1b50e) to head (c41f452).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2199      +/-   ##
==========================================
- Coverage   91.09%   91.09%   -0.01%     
==========================================
  Files         363      363              
  Lines       41215    41218       +3     
  Branches     8830     8831       +1     
==========================================
+ Hits        37544    37546       +2     
- Misses       2406     2407       +1     
  Partials     1265     1265              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jonathangreen jonathangreen changed the title Make sure we handle ProblemDetail response from _crawlable_feed (PP-1860) Make sure we handle ProblemDetail response from _crawlable_feed (PP-1975) Nov 27, 2024
Copy link
Contributor

@tdilauro tdilauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪛 🚀

@jonathangreen jonathangreen force-pushed the bugfix/unhandled-problem-detail branch from 81622f2 to c41f452 Compare December 3, 2024 10:48
@jonathangreen jonathangreen merged commit 5f769ad into main Dec 3, 2024
21 checks passed
@jonathangreen jonathangreen deleted the bugfix/unhandled-problem-detail branch December 3, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants