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

Lidarr widget not working #180

Closed
2ndwonder opened this issue Sep 15, 2022 · 22 comments
Closed

Lidarr widget not working #180

2ndwonder opened this issue Sep 15, 2022 · 22 comments

Comments

@2ndwonder
Copy link

2ndwonder commented Sep 15, 2022

Lidarr widget is not working for me. Am I missing something? I don't see instructions for Lidarr.

    - Lidarr:
        icon: lidarr.png
        href: https://subdomain.domain.nl
        description: Music Managment
        server: docker
        container: lidarr
        widget:
          type: lidarr
          url: https://subdomain.domain.nl
          key: API KEY 

If I uncomment the "key" section, it loads. But with API Error.

image

with API key included

image

@JazzFisch
Copy link
Collaborator

Is your Lidarr instance, perhaps, on a sub-path such as https://subdomain.domain.nl/lidarr?

@2ndwonder
Copy link
Author

No it Is not

@JazzFisch
Copy link
Collaborator

JazzFisch commented Sep 16, 2022

Is there anything in the log output from the homepage container?

@benphelps
Copy link
Member

The services proxy is reporting that the API key is unauthorized, it forwards the API response 1:1, so that's the actual error returned by the API. I'd check and make sure your key is correct.

@2ndwonder
Copy link
Author

I double checked the API. It is correct. I'll try to generate another API key and see if that works

@2ndwonder
Copy link
Author

I changed the API and still the same results.

@JazzFisch this is what I'm only getting from the logs from Homepage

image

@mtompkins
Copy link

I can confirm that the Lidarr widget chokes on large libraries. Perhaps this is in play for this issue.

@benphelps
Copy link
Member

Ohhh, it very well could be. How large is your library?

This is also a problem with the Radarr and Sonarr integrations.

@bjgeiser
Copy link

bjgeiser commented Sep 16, 2022

Mine is failing the same way for Lidarr and Readarr. Seeing this in the container logs.

type=lidarr&group=Media+Management+%28Cont%29&service=Lidarr&endpoint=album exceeds 4MB. API Routes are meant to respond quickly. https://nextjs.org/docs/messages/api-routes-response-size-limit

@neildeadman
Copy link

My Lidarr is failling also:

API response for /api/services/proxy?type=lidarr&group=Media+Acquisition&service=Lidarr&endpoint=album exceeds 4MB. API Routes are meant to respond quickly. https://nextjs.org/docs/messages/api-routes-response-size-limit
TypeError: Cannot read properties of null (reading 'map')
    at handler (/app/.next/server/pages/api/bookmarks.js:61:36)
    at async Object.apiResolver (/app/node_modules/.pnpm/next@12.3.0_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/api-utils/node.js:366:9)
    at async NextNodeServer.runApi (/app/node_modules/.pnpm/next@12.3.0_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/next-server.js:469:9)
    at async Object.fn (/app/node_modules/.pnpm/next@12.3.0_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/next-server.js:719:37)
    at async Router.execute (/app/node_modules/.pnpm/next@12.3.0_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/router.js:247:36)
    at async NextNodeServer.run (/app/node_modules/.pnpm/next@12.3.0_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/base-server.js:346:29)
    at async NextNodeServer.handleRequest (/app/node_modules/.pnpm/next@12.3.0_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/base-server.js:284:20)

@JazzFisch
Copy link
Collaborator

JazzFisch commented Sep 16, 2022

Interesting. Also, ever so slightly jealous of the size of your libraries. 😁
Let me see if there's a way I can convince the underlying Lidarr API to return summary data.

@2ndwonder
Copy link
Author

I have over 1 TB shows on Sonarr and that widget is working without problems. On Lidarr I got like maybe max 5-10 GB music. So something else is going on

@JazzFisch
Copy link
Collaborator

I just looked at Lidarr's source code and they don't have a way to get summary data. I have an idea for a workaround that doesn't proxy the entire Lidarr response body to the client that runs in homepage server side.

@bjgeiser
Copy link

Could the 4MB limit be removed per this: https://nextjs.org/docs/messages/api-routes-response-size-limit. It's not like the API requests are going across the internet in most cases.

@2ndwonder
Copy link
Author

Lidarr still nog working.. all of the other widgets work for me.

image

JazzFisch added a commit to JazzFisch/homepage that referenced this issue Sep 17, 2022
@bjgeiser
Copy link

bjgeiser commented Sep 17, 2022

Just updated to the new release (0.3.55) and large libraries still aren't working.

From container logs:

TypeError: Cannot read properties of undefined (reading 'percentOfTracks')
    at /app/.next/server/pages/api/services/proxy.js:145:61
    at Array.filter (<anonymous>)
    at /app/.next/server/pages/api/services/proxy.js:116:50
    at jsonArrayTransform (/app/.next/server/pages/api/services/proxy.js:109:12)
    at jsonArrayFilter (/app/.next/server/pages/api/services/proxy.js:116:10)
    at Object.album (/app/.next/server/pages/api/services/proxy.js:145:15)
    at genericProxyHandler (/app/.next/server/pages/api/services/proxy.js:397:36)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/app/node_modules/.pnpm/next@12.3.0_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/api-utils/node.js:366:9)
    at async NextNodeServer.runApi (/app/node_modules/.pnpm/next@12.3.0_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/next-server.js:469:9)

This is similar to what the browser console was doing before the change, makes me think the json is still being truncated.

@JazzFisch
Copy link
Collaborator

I think if this were a data truncation issue, the JSON.parse inside of asJson would have failed. I'll try adding a little more null coalescing logic.

JazzFisch added a commit to JazzFisch/homepage that referenced this issue Sep 17, 2022
@JazzFisch
Copy link
Collaborator

Looks like Ben just submitted the almost exact same fix I was working on. 😁

@bjgeiser
Copy link

Lidarr and Readarr are working now with 0.3.57. Nice work.

@2ndwonder
Copy link
Author

I can confirm that Lidarr also works on my side. Thanks guy's!

@benphelps
Copy link
Member

Thanks all for getting this one ironed out :)

Copy link
Contributor

github-actions bot commented Feb 6, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants