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

[Bug]: Malformed request in Custom Metadata Provider crashes the ABS server #3390

Closed
valdearg opened this issue Sep 8, 2024 · 1 comment · Fixed by #3396
Closed

[Bug]: Malformed request in Custom Metadata Provider crashes the ABS server #3390

valdearg opened this issue Sep 8, 2024 · 1 comment · Fixed by #3396
Labels
bug Something isn't working

Comments

@valdearg
Copy link

valdearg commented Sep 8, 2024

What happened?

Taking a look at making a custom metadata provider per the docs.

When testing searching, it crashed the server with the following message:

[2024-09-08 16:01:36.738] FATAL: [Server] Unhandled rejection: Error: Custom provider returned malformed response, promise: Promise {

  <rejected> Error: Custom provider returned malformed response

      at CustomProviderAdapter.search (/server/providers/CustomProviderAdapter.js:65:13)

      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

      at async BookFinder.getCustomProviderResults (/server/finders/BookFinder.js:205:19)

      at async ApiRouter.findBooks (/server/controllers/SearchController.js:38:21)

} (Server.js:185)

What did you expect to happen?

When searching, I'd just expect it to give a "error when searching", maybe a reason in the debug logs?

Steps to reproduce the issue

Haven't published the API site externally just yet, but the response might be helpful, I'm also fully aware that this probably isn't the correct response type.

[
    {
        "title": "666 Charing Cross Road",
        "subtitle": null,
        "authors": "Paul Magrs",
        "series": [
            "Iris Wildthyme and Friends #666 Charing Cross Road"
        ],
        "genres": [
            "Audio Drama"
        ],
        "publishedYear": "2021",
        "publishedDate": null,
        "publisher": "Big Finish",
        "description": "New Yorker Elizabeth Bathory loves books, and when she is given the address of a very special bookshop in London, she writes to order herself a selection of paranormal romances and vampire fiction.\n\nBut one book has a mysterious dark bloodstain marking the pages, and soon, New York finds itself infected with vampires.\n\nOnly the Scottish Bride, an ancient effigy from the basement of the New York Museum of Outsider Art, and her new friends can stop it...\n\n666 Charing Cross Road was first published by Headline Review in 2012 and is still available as a paperback and ebook.",
        "isbn": "978-1-83868-575-1",
        "asin": null,
        "language": null,
        "explicit": false,
        "abridged": false,
        "cover": "https://www.bigfinish.com/image/release/2395/"
    }
]

This is when calling the API with: /big-finish/search?mediaType=book&query=7.1+.+Doctor+Who%3A+The+Ark&author=John+Lucarotti

EDIT: I've noticed that this is simply because it's expecting the results to come back in a "matches" node.

E.g.

{
    "matches": [
        {
            "title": "666 Charing Cross Road"
        }
    ]
}

Audiobookshelf version

v2.13.3

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

No response

Additional Notes

No response

@valdearg valdearg added the bug Something isn't working label Sep 8, 2024
@advplyr advplyr added the awaiting release Issue is resolved and will be in the next release label Sep 9, 2024
Copy link

github-actions bot commented Sep 9, 2024

Fixed in v2.13.4.

@github-actions github-actions bot removed the awaiting release Issue is resolved and will be in the next release label Sep 9, 2024
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 a pull request may close this issue.

2 participants