josh / imdb-trakt-sync

Sync IMDb watchlist and ratings to Trakt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Container Health Check unhealthy in Portainer

Warstomper opened this issue · comments

commented

Hi,

It appears the container has a healthcheck that is currently marking it as "Unhealthy" in my Portainer environment. It does seem to work normally, and I can see hourly checks happening, and the Trakt watchlist being updated. Is this expected behaviour?

See some logging below.

  "not_found": []
}
+ ./diff-watchlist.sh show
+ ./trakt-update-watchlist.sh shows
trakt-watchlist: 6 shows
imdb-watchlist: 6 shows
diff-watchlist: add 0 shows
diff-watchlist: remove 0 shows
{
  "added": 0,
  "existing": 0,
  "not_found": []
}
{
  "deleted": 0,
  "not_found": []
}
+ ./diff-ratings.sh movie
+ ./trakt-update-ratings.sh movies
trakt-ratings: 6 movies
imdb-ratings: 6 movies
diff-ratings: add/update 0 movies
diff-ratings: remove 0 movies
{
  "added": 0,
  "not_found": []
}
{
  "deleted": 0,
  "not_found": []
}
+ ./diff-ratings.sh show
+ ./trakt-update-ratings.sh shows
trakt-ratings: 14 shows
[]
{
  "added": 0,
  "not_found": []
}
{
  "deleted": 0,
  "not_found": []
}
exit status 1

# Mon May 30 02:54:19 2022
+ /app/main.sh
+ ./diff-watchlist.sh movie
+ ./trakt-update-watchlist.sh movies
imdb-watchlist: 580 movies
true
exit status 22

# Mon May 30 03:54:19 2022
+ /app/main.sh
+ ./diff-watchlist.sh movie
+ ./trakt-update-watchlist.sh movies
imdb-watchlist: 580 movies
true
exit status 22

# Mon May 30 04:54:19 2022
+ /app/main.sh
+ ./diff-watchlist.sh movie
+ ./trakt-update-watchlist.sh movies
imdb-watchlist: 580 movies
true
exit status 22

# Mon May 30 05:54:19 2022
+ /app/main.sh
+ ./diff-watchlist.sh movie
+ ./trakt-update-watchlist.sh movies
imdb-watchlist: 580 movies
true
exit status 22

# Mon May 30 06:54:19 2022
+ /app/main.sh
+ ./diff-watchlist.sh movie
+ ./trakt-update-watchlist.sh movies
imdb-watchlist: 580 movies
true
exit status 22

# Mon May 30 07:54:19 2022
+ /app/main.sh
+ ./diff-watchlist.sh movie
+ ./trakt-update-watchlist.sh movies
imdb-watchlist: 580 movies
true
exit status 22

# Mon May 30 08:54:19 2022
+ /app/main.sh
+ ./diff-watchlist.sh movie
+ ./trakt-update-watchlist.sh movies
imdb-watchlist: 580 movies
true
exit status 22

It seems like the diff-watchlist.sh script is actually crashing. Are you sure it's actually working? You might want to check if see if your TRAKT_ACCESS_TOKEN is valid.

commented

Looks like I got my Trakt API access "locked" somewhere throughout playing with the container and will have to go through their support to get it fixed. (I made a mistake with another Trakt syncing project.. :') )

Ill get back to you once I have this fixed in case the health-check keeps failing.

commented

I got my access unblocked an it seems to be syncing the shows correctly again, however the Healthcheck remains unhealthy for now.

A sync from the moment of starting the container now looks like this:

2022-06-01T06:18:43.568240766Z 
2022-06-01T06:18:43.568375177Z # Wed Jun  1 06:18:43 2022
2022-06-01T06:18:43.568388626Z + /app/main.sh
2022-06-01T06:18:43.571528878Z + ./diff-watchlist.sh movie
2022-06-01T06:18:43.571646780Z + ./trakt-update-watchlist.sh movies
2022-06-01T06:18:44.654459019Z trakt-watchlist: 581 movies
2022-06-01T06:18:44.825320879Z imdb-watchlist: 582 movies
2022-06-01T06:18:44.921378598Z diff-watchlist: add 1 movies
2022-06-01T06:18:44.921955313Z diff-watchlist: remove 0 movies
2022-06-01T06:18:46.500742110Z {
2022-06-01T06:18:46.500783576Z   "added": 0,
2022-06-01T06:18:46.500801457Z   "existing": 0,
2022-06-01T06:18:46.500812374Z   "not_found": [
2022-06-01T06:18:46.500821448Z     {
2022-06-01T06:18:46.500830262Z       "ids": {
2022-06-01T06:18:46.500839363Z         "imdb": "tt13623016"
2022-06-01T06:18:46.500848674Z       }
2022-06-01T06:18:46.500857321Z     }
2022-06-01T06:18:46.500865487Z   ]
2022-06-01T06:18:46.500873571Z }
2022-06-01T06:18:48.303183755Z {
2022-06-01T06:18:48.303237197Z   "deleted": 0,
2022-06-01T06:18:48.303248473Z   "not_found": []
2022-06-01T06:18:48.303256602Z }
2022-06-01T06:18:48.305193155Z + ./diff-watchlist.sh show
2022-06-01T06:18:48.305312115Z + ./trakt-update-watchlist.sh shows
2022-06-01T06:18:48.530620675Z trakt-watchlist: 9 shows
2022-06-01T06:18:49.368053071Z imdb-watchlist: 23 shows
2022-06-01T06:18:49.440665903Z diff-watchlist: add 14 shows
2022-06-01T06:18:49.441282921Z diff-watchlist: remove 0 shows
2022-06-01T06:18:51.068375356Z {
2022-06-01T06:18:51.068433085Z   "added": 14,
2022-06-01T06:18:51.068445178Z   "existing": 0,
2022-06-01T06:18:51.068453354Z   "not_found": []
2022-06-01T06:18:51.068461470Z }
2022-06-01T06:18:53.757552302Z {
2022-06-01T06:18:53.757593431Z   "deleted": 0,
2022-06-01T06:18:53.757604346Z   "not_found": []
2022-06-01T06:18:53.757612664Z }
2022-06-01T06:18:53.759484168Z + ./diff-ratings.sh movie
2022-06-01T06:18:53.759600084Z + ./trakt-update-ratings.sh movies
2022-06-01T06:18:54.042345870Z imdb-ratings: 6 movies
2022-06-01T06:18:54.242577541Z trakt-ratings: 6 movies
2022-06-01T06:18:54.313644088Z diff-ratings: add/update 0 movies
2022-06-01T06:18:54.314237059Z diff-ratings: remove 0 movies
2022-06-01T06:18:55.847801553Z {
2022-06-01T06:18:55.847854379Z   "added": 0,
2022-06-01T06:18:55.847865429Z   "not_found": []
2022-06-01T06:18:55.847873500Z }
2022-06-01T06:18:57.398015882Z {
2022-06-01T06:18:57.398067157Z   "deleted": 0,
2022-06-01T06:18:57.398084915Z   "not_found": []
2022-06-01T06:18:57.398093811Z }
2022-06-01T06:18:57.400264879Z + ./diff-ratings.sh show
2022-06-01T06:18:57.400403927Z + ./trakt-update-ratings.sh shows
2022-06-01T06:18:57.675459702Z []
2022-06-01T06:18:57.911077845Z trakt-ratings: 14 shows
2022-06-01T06:18:59.242674636Z {
2022-06-01T06:18:59.242713406Z   "added": 0,
2022-06-01T06:18:59.242722942Z   "not_found": []
2022-06-01T06:18:59.242729469Z }
2022-06-01T06:19:00.781198225Z {
2022-06-01T06:19:00.781252637Z   "deleted": 0,
2022-06-01T06:19:00.781267338Z   "not_found": []
2022-06-01T06:19:00.781276168Z }
2022-06-01T06:19:00.783195288Z exit status 1

It looks like it's somewhere around downloading your IMDb rating. Not sure why. Maybe the IMDb related cookies are incorrect?

commented

I have retrieved the Cookies and recreated the container. It does not seem to make any difference, and it still ends with the log below, and only syncing the entries:

+ ./diff-ratings.sh show
+ ./trakt-update-ratings.sh shows
[]
trakt-ratings: 14 shows
{
  "added": 0,
  "not_found": []
}
{
  "deleted": 0,
  "not_found": []
}
exit status 1

Any way for additional logging to figure out what's happening?

Any way for additional logging to figure out what's happening?

You might have to try running the imdb-ratings.sh script standalone to see what kind of error curl might be returning.

commented

Okay, so for movies, I had some with ratings, but none of the shows had any rating, and the command to do ratings for shows only returned the following:

[ ]

Once I rated a single show, it seems it now finishes gracefully, and the health check goes green.

I have never really cared about ratings, so I guess Ill keep this 1 show with a rating and have it work as it should :)

but none of the shows had any rating

Interesting. Well glad that work around fixed it. I might look into this later. I would hope it could also work just fine without any shows rated. Thanks for debugging!