mateoradman / bazarr-bulk

Bazarr Bulk Actions CLI - Bulk sync your subtitles with ease
https://crates.io/crates/bazarr-bulk
MIT License
30 stars 1 forks source link

Windows - reqwest error #2

Closed WallaWallaWA closed 5 months ago

WallaWallaWA commented 5 months ago

Running bb.exe on a Windows 10 machine, using the following command (elevated prompt):

bb.exe --config D:\utilities\bb\config.json movies sync

returns this error:

Error: reqwest::Error { kind: Decode, source: Error("invalid type: null, expected a string", line: 1, column: 351761) }

the config file contents are:

{
  "host": "192.168.1.165",
  "protocol": "http",
  "port": "6767",
  "apiKey": "****redacted****"
}
JuniperMS commented 5 months ago

Duplicate of my ticket. At least I'm not the only one having the issue. Have you tried a different OS?

WallaWallaWA commented 5 months ago

OK, tried it on a linux machine (Ubuntu 22.04.3 LTS), same results command run was:

bb --config config.json movies sync

error message:

Error: reqwest::Error { kind: Decode, source: Error("invalid type: null, expected a string", line: 1, column: 351795) }

config.json file is:

{
  "host": "192.168.1.165",
  "protocol": "http",
  "port": "6767",
  "apiKey": "****redacted****"
}

So, we're both getting the same type of error, so the dev needs to review and respond

JuniperMS commented 5 months ago

So I have radarr disabled in Bazarr but I went ahead and ran, "bb --config config.json movies sync" and it worked. It showed 0/0 but it still worked.

user1@docker:/opt$ sudo bb --config config.json movies sync [############################################################] 0/0
Finished performing action sync on all movies

WallaWallaWA commented 5 months ago

Radarr (and Sonarr) are and have been active in my Bazarr install; not sure why having it disabled would work, that doesn't seem to make sense. I'll attempt it with TV later today and we'll see how that goes.

JuniperMS commented 5 months ago

I tried earlier today to disable Sonarr and it didn't make a difference. The script gave the same error. It's a waiting game until we hear from @mateoradman

mateoradman commented 5 months ago

Hi, thanks for reporting the issue. I will look into it and push a patch as soon as possible 🙂

WallaWallaWA commented 5 months ago

Tried this a few different ways, with one positive result.

Same config as before, but trying TV instead of movies, same type of error.

command: bb --config config_bb_165.json tv-shows sync

error: Error: reqwest::Error { kind: Decode, source: Error("invalid type: null, expected a string", line: 1, column: 39647) }

config file:

{
  "host": "192.168.1.165",
  "protocol": "http",
  "port": "6767",
  "apiKey": "***redacted***"
}

Running bb on second instance of bazarr, set up for 4K movies (no TV), for which all media files are on the same PC, therefore same IP address - it worked.

command: bb --config config_bb_169.json movies sync result:

[############################################################]     132/132    
Finished performing action sync on all movies

config file:

{
  "host": "192.168.1.169",
  "protocol": "http",
  "port": "6767",
  "apiKey": "***redacted***"
}

For the first instance of bazarr, which handles both movies and tv shows, the media files reside on two separate PCs. Paths are set correctly and bazarr can see all media on both PCs and has pulled down subtitles for both movies and tv shows for the media files on both PCs.

So figure might as well try adding user/password to the config file along with a change in protocols from 'http' to 'https' to see if that helps with the fact that the files are spread over two PC, therefore two separate IP addresses; nope, errored out again, but different error message.

with user/pw added to config

command: bb --config config_bb_165.json movies sync

Error: reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(192.168.1.165)), port: Some(6767), path: "/api/movies", query: None, fragment: None }, source: hyper::Error(Connect, Ssl(Error { code: ErrorCode(5), cause: None }, X509VerifyResult { code: 0, error: "ok" })) }

config file:

{
  "host": "192.168.1.165",
  "protocol": "https",
  "port": "6767",
  "apiKey": "***redacted***",
  "username": "***redacted***",
  "password": "***redacted***"
}

ok, tried same thing, but switched back to 'http' as protocol but left username/password in, and original error message gets repeated.

command: bb --config config_bb_165.json movies sync

error: Error: reqwest::Error { kind: Decode, source: Error("invalid type: null, expected a string", line: 1, column: 351795) }

config:

{
  "host": "192.168.1.165",
  "protocol": "http",
  "port": "6767",
  "apiKey": "***redacted***",
  "username": "***redacted***",
  "password": "***redacted***"
}

So, one possibility is that the bb app will work as is, but only if the media files for bazarr are on the same physical PC/IP.

mateoradman commented 5 months ago

@WallaWallaWA thank you very much for your effort in debugging this problem.

Could you please compare the versions of the two bazarr instances that you have up-and-running. Is the version of bazarr that worked different than the one that didn't? In your example, I suspect that Bazarr running on 192.168.1.165 is older than the one running on 192.168.1.169.

WallaWallaWA commented 5 months ago

bazarr_165.png

bazarr_169.png

Both are 1.40, so same version.

mateoradman commented 5 months ago

Hi @WallaWallaWA and @JuniperMS, please try with the new version (v0.1.2) again and let me know how it goes :slightly_smiling_face:

JuniperMS commented 5 months ago

@mateoradman it seems to be working!

mateoradman commented 5 months ago

So figure might as well try adding user/password

@WallaWallaWA, I've researched this a bit and even though I set up authentication in Bazarr with a username/password, I was still able to run bazarr-bulk using just the API key. It seems that the API key is sufficient to run these operations regardless of your UI authentication settings. Therefore, no username and password are needed in the configuration JSON file.

JuniperMS commented 5 months ago

@mateoradman seems the fix is good. Note, I only tested this on Linux. I didn't want to test on Windows and instead wait for @WallaWallaWA to test that portion. Many thanks for the swift fix!

WallaWallaWA commented 5 months ago

On Windows 10, from an elevated prompt, using bb vers 0.1.2

bb command

D:\utilities\bb\bb.exe --config D:\utilities\bb\config.json movies sync

output:

Bazarr API is healthy
[##########################################################] 4198/4198
"Successfully performed action 'sync' on English subtitle of movie xxxxxx" displayed for each movie
Finished performing action sync on all movies

config file:

{
  "host": "192.168.1.165",
  "protocol": "http",
  "port": "6767",
  "apiKey": "***redacted***"
}

Didn't really time it, but my estimate is that it took about 40 minutes to complete. Note that some of those movies, especially older ones (and some silent films), do not have subtitles, so presume those were skipped as the screen prompt moved through some in less than a fraction of a second. Another guess, based on watching the screen prompts, is that it took 2-3 seconds to sync a subtitle, so this is very fast.

I'll try this later today or tomorrow, dependent on time availability, and run this on the Ubuntu box, that run will be for tv shows (approximately 470 shows, about 28,000 episodes) just to confirm it's working on a linux system with media files on windows machines.

Thanks for the quick response and the fix!

WallaWallaWA commented 5 months ago

running on Ubuntu (22.04.03 LTS) bb version 0.1.2

command: bb --config config.json tv-shows sync

response:

Bazarr API is healthy.
[###########################################] 470/470
"Successfully perfromed action 'sync' on English subtitle of episode XXXX" returned for each show/episode
Finished performing action sync on all tv shows

config file:

{
  "host": "192.168.1.165",
  "protocol": "http",
  "port": "6767",
  "apiKey": "***redacted***"
}

So, no errors or other issues; not sure how long it took to run as I didn't babysit this run as I did with the movies earlier, but my best guess at a rough estimate is 2 hours. Thanks for developing this terrific utility, it's a feature that's sorely missing from Bazarr.