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

Status checker issue: JSON.parse: unexpected character at line 1 column 1 of the JSON data #1727

Closed
4 tasks done
pbarone opened this issue Dec 2, 2023 · 12 comments
Closed
4 tasks done
Labels
🐛 Bug Something isn't working Fixed in 1.0 This issue has been fixed in our upcoming version 1.0 and is not crucial enough to be backported Stale

Comments

@pbarone
Copy link

pbarone commented Dec 2, 2023

Environment

Docker

Version

No response

Describe the problem

When using the status checker to report if a service is up, for a number of the tiles I have I get a red dot with an error message saying JSON.parse: unexpected character at line 1 column 1 of the JSON data

This happens for sonarr, radarr, plex, jellyfin, tautulli and more

Is there something I can do to fix this?

Logs

No response

Context

No response

Please tick the boxes

  • I confirm that I attached the proper logs
  • I've read the docs
  • I've checked for duplicate issues
  • I've tried to debug myself
@pbarone pbarone added the 🐛 Bug Something isn't working label Dec 2, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Homarr Kanban Dec 2, 2023
@lersveen
Copy link

I'm experiencing the same error message for everything I've tried – Plex, Sonarr, Radarr, Overseerr, Qbittorrent. Also seeing the widgets from these apps being slow and unstable. The exact same dashboard worked before upgrading to 0.14.x.

The behaviour of the status dot is also not consistent. It's usually red, but entering edit mode typically makes it green immediately. Going out of edit mode it will stay green. Refresh the page and it's red again.

It might also be relevant that all the apps have internal addresses without TLS, e.g. http://radarr:7878 where this is a hostname handled by Podmans internal DNS, but I know the Homarr container is able to resolve the hostnames and gets a 200 response. Could still be something related to DNS or plain HTTP though.

@manuel-rw
Copy link
Collaborator

@Meierschlumpf can you look into this?

@Meierschlumpf
Copy link
Collaborator

@pbarone @lersveen can someone of you send the docker logs you get when it gives you the error

@pbarone
Copy link
Author

pbarone commented Dec 29, 2023

running "docker logs homarr" I get this (after a fresh restart of the container):

Exporting hostname...
Migrating database...
yarn run v1.22.19
$ ts-node ./migrate.ts
Done in 3.13s.
Starting production server...
Listening on port 7575 url: http://daa028722984:7575

ERROR Unexpected response: Maximum number of redirects exceeded

Then after running it for a while I get a lot of the "ERROR Unexpected response: Maximum number of redirects exceeded" entries

Is this helpful?

@Meierschlumpf
Copy link
Collaborator

Okay it seems like there is an issue with at least one of the apps. At least one of the apps is redirecting in a loop, maybe because we are not authenticated. Can you find out which app is having this behaviour. Easiest to do so is to disable pings for each app until you can refresh and the pings work.

@lersveen
Copy link

lersveen commented Dec 29, 2023

I don't have any redirect errors in the server logs, in fact nothing is logged server side about this.

I'm getting the below error message on all apps, even e.g. http://radarr:7878/ping, which I've verified is returning JSON:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Fri, 29 Dec 2023 13:14:36 GMT
Server: Kestrel
Cache-Control: max-age=31536000, public
Last-Modified: Fri, 10 Nov 2023 03:50:40 GMT
Transfer-Encoding: chunked

{
  "status": "OK"
}
Skjermbilde 2023-12-29 kl  13 49 55

Browser console

In the browser console I get something like this when it fails:
Skjermbilde 2023-12-29 kl  13 58 49

The full URL that gives HTTP 500 (parameters decoded and hostname removed):
https://HOSTNAME/api/trpc/app.ping,app.ping,app.ping,app.ping,app.ping,app.ping,mediaRequest.allMedia?batch=1&input={"0":{"json":{"id":"edee3980-ad66-4657-9bd1-121d93a0efab","configName":"default"}},"1":{"json":{"id":"2425deef-63d0-4931-8bdd-ee769b2d5cf1","configName":"default"}},"2":{"json":{"id":"4066785d-ce83-4e6d-af38-137e1d5d92c1","configName":"default"}},"3":{"json":{"id":"4411603d-e446-4370-a54a-21dc9108ddad","configName":"default"}},"4":{"json":{"id":"2f673888-e927-4bc7-892d-f8da875fdced","configName":"default"}},"5":{"json":{"id":"bf7407b2-fcf2-480a-b0cc-baca1e90c935","configName":"default"}},"6":{"json":{"configName":"default","widget":{"id":"ba8dfb94-02b7-49e3-8d3c-56cd2eb92849","type":"media-requests-stats","properties":{"replaceLinksWithExternalHost":false,"openInNewTab":true},"area":{"type":"wrapper","properties":{"id":"default"}},"shape":{"sm":{"location":{"x":0,"y":0},"size":{"width":2,"height":2}},"md":{"location":{"x":0,"y":0},"size":{"width":2,"height":2}},"lg":{"location":{"x":5,"y":0},"size":{"width":3,"height":2}}}}}}}

When I enter, then exit edit mode and get HTTP 200 – I get this:
Skjermbilde 2023-12-29 kl  14 19 57

And the URL (again parameters decoded and hostname removed):
https://homarr.andre.party/api/trpc/app.ping,app.ping,app.ping,app.ping,app.ping,app.ping?batch=1&input={"0":{"json":{"id":"edee3980-ad66-4657-9bd1-121d93a0efab","configName":"default"}},"1":{"json":{"id":"2425deef-63d0-4931-8bdd-ee769b2d5cf1","configName":"default"}},"2":{"json":{"id":"4066785d-ce83-4e6d-af38-137e1d5d92c1","configName":"default"}},"3":{"json":{"id":"4411603d-e446-4370-a54a-21dc9108ddad","configName":"default"}},"4":{"json":{"id":"2f673888-e927-4bc7-892d-f8da875fdced","configName":"default"}},"5":{"json":{"id":"bf7407b2-fcf2-480a-b0cc-baca1e90c935","configName":"default"}}}

When I try to open both of those manually in a browser I get the same 500 and 200 responses, the 200 one giving me a JSON response like this:

[
   {
      "result":{
         "data":{
            "json":{
               "status":200,
               "statusText":"OK",
               "state":"online"
            }
         }
      }
   },
   {
      "result":{
         "data":{
            "json":{
               "status":200,
               "statusText":"OK",
               "state":"online"
            }
         }
      }
   }
]

Edit: Fixed wrong (same) URL for the 200 response. The difference between them is the one that fails has mediaRequest.allMedia and a corresponding element in the input parameter JSON.

@lersveen
Copy link

lersveen commented Dec 29, 2023

Ok, so to test a bit further I created a new dashboard with ONLY an app tile for Plex. It works perfectly. Then I added a widget and the same issue is back. So the problem seems to be that the batch requests with both pings and widget data fail. This also explains why I'm having the related issues of widgets not loading properly.

Edit: More specifically, the issue is with the Overseerr integration and the widgets Media request stats and Media Requests. Removing those, everything works fine. It is probably the ones getting the biggest amount of data and the requests between Homarr and Overseerr might take a little time. Could be about timeouts or something? Both those widgets do get their data sporadically.

Unsure what the solution here is, but probably making those batch requests a bit more robust? Maybe getting the widget data in separate requests, async?

Edit 2: I realize my issue might not be exactly the same as what @pbarone is experiencing, but still seems plausibly related.

Copy link

Hello 👋, this issue has been open for 60 days without activity. We mark issues to help prioritise and close dead issues. Can you confirm that this issue is still relevant on the latest version? I'll remove the stale label as soon as there is further activity on this issue. Thank you 🙏

@github-actions github-actions bot added the Stale label Feb 27, 2024
@lersveen
Copy link

Can confirm that my issue is still present on Homarr 0.15.0.

Could this be prioritized? This effectively breaks both the Media request stats and Media Requests widgets.

Happy to assist further if you're not immediately able to reproduce the issue!

@github-actions github-actions bot removed the Stale label Feb 28, 2024
Copy link

github-actions bot commented May 4, 2024

Hello 👋, this issue has been open for 60 days without activity. We mark issues to help prioritise and close dead issues. Can you confirm that this issue is still relevant on the latest version? I'll remove the stale label as soon as there is further activity on this issue. Thank you 🙏

@github-actions github-actions bot added the Stale label May 4, 2024
@manuel-rw
Copy link
Collaborator

Hi, this will be fixed in 1.0 (see #1993 for further information)

@Meierschlumpf Meierschlumpf added the Fixed in 1.0 This issue has been fixed in our upcoming version 1.0 and is not crucial enough to be backported label Jan 10, 2025
@Meierschlumpf
Copy link
Collaborator

As we'll release 1.0 in one of the upcoming weeks and it is a complete rewrite it is unlikely that the same issue still exists. If it does feel free to create a new issue on https://github.com/homarr-labs/homarr/ regarding it.

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Homarr Kanban Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working Fixed in 1.0 This issue has been fixed in our upcoming version 1.0 and is not crucial enough to be backported Stale
Projects
Status: ✅ Done
Development

No branches or pull requests

4 participants