causefx / Organizr

HTPC/Homelab Services Organizer - Written in PHP
GNU General Public License v3.0
5.16k stars 290 forks source link

qBittorrent Connect Function - Error: Could not get session ID [Execution Time: yzz ms] #1287

Closed Tuumke closed 4 years ago

Tuumke commented 4 years ago
Organizr Version: V 2.0.325
Branch: Master
WebServer: Nginx
Operating System: Docker

Problem Description:

Getting title error in the logs. qBittorrent Connect Function - Error: Could not get session ID [Execution Time: xyz ms]


Reproduction Steps:

Just updated my working install and got this error.


Errors on screen? If so paste here:

Combined downloader says:

Connection Error to qBittorrent

qBittorrent v4.2.0 Web UI (64-bit)

causefx commented 4 years ago

@rob1998 You want to try looking at this? Are you stilll using qBit?

Tuumke commented 4 years ago

qBittorrent has been updated 3 days ago:

https://registry.hub.docker.com/r/binhex/arch-qbittorrentvpn/builds

Tuesday December 3rd 2019 - qBittorrent v4.2.0 release

A loooooot of bugfixes and changes: https://www.qbittorrent.org/news.php

rob1998 commented 4 years ago

@causefx I'm a bit busy atm, but if some free time comes up I'll take a look at it. Not using qbit as my main torrent client anymore, but I do still use it for some quick torrenting on my laptop.

causefx commented 4 years ago

@rob1998 no worries if you arent using it. Hopefully I can find some time to install it lol

CplPwnies commented 4 years ago

Hey guys. Random new user of Ogranizr here. I started seeing this issue after qBittorrent updated on December 3rd. Seeing that no one was reporting this issue yet, I actually fixed this myself and been meaning to submit a PR, but life gets in the way. Basically qBittorrent bumped their API versions and have new paths

Here's the fix:

Dashboard/api/functions/homepage-connect-functions.php - Line 1034 Change: $url = $digest['scheme'] . '://' . $digest['host'] . $digest['port'] . $digest['path'] . '/login'; To: $url = $digest['scheme'] . '://' . $digest['host'] . $digest['port'] . $digest['path'] . '/api/v2/auth/login';

Dashboard/api/functions/homepage-connect-functions.php - Line 1047 Change: $url = $digest['scheme'] . '://' . $digest['host'] . $digest['port'] . $digest['path'] . '/query/torrents?sort=' . $GLOBALS['qBittorrentSortOrder'] . '&reverse=' . $reverse; To: $url = $digest['scheme'] . '://' . $digest['host'] . $digest['port'] . $digest['path'] . '/api/v2/torrents/info?sort=' . $GLOBALS['qBittorrentSortOrder'] . '&reverse=' . $reverse;

After I updated the Uri's with the new API paths, my homepage widget started working again.

*EDIT: As a note, I am also using the docker setup for both qBit and Organizr

causefx commented 4 years ago

@CplPwnies

does qbit have an api endpoint to get version?

CplPwnies commented 4 years ago

@causefx

Yes. Here is the full wiki page

And, Here is the link to the GET method for API version

causefx commented 4 years ago

Workaround has been posted to dev kinda based off of @CplPwnies code. Change API Version on homepage config in settings.

kakalaky commented 4 years ago

Working for me now with qBittorrent 4.2.0. Thanks.

Tuumke commented 4 years ago

Workaround has been posted to dev kinda based off of @CplPwnies code. Change API Version on homepage config in settings.

So not yet on the v2-master branch right? :)

waynetx383 commented 4 years ago

I've changed the api version in the homepage config settings and verified all of the updated files have the correct changes and I'm still seeing this error.

netcop82 commented 4 years ago

Hey guys. Random new user of Ogranizr here. I started seeing this issue after qBittorrent updated on December 3rd. Seeing that no one was reporting this issue yet, I actually fixed this myself and been meaning to submit a PR, but life gets in the way. Basically qBittorrent bumped their API versions and have new paths

Here's the fix:

Dashboard/api/functions/homepage-connect-functions.php - Line 1034 Change: $url = $digest['scheme'] . '://' . $digest['host'] . $digest['port'] . $digest['path'] . '/login'; To: $url = $digest['scheme'] . '://' . $digest['host'] . $digest['port'] . $digest['path'] . '/api/v2/auth/login';

Dashboard/api/functions/homepage-connect-functions.php - Line 1047 Change: $url = $digest['scheme'] . '://' . $digest['host'] . $digest['port'] . $digest['path'] . '/query/torrents?sort=' . $GLOBALS['qBittorrentSortOrder'] . '&reverse=' . $reverse; To: $url = $digest['scheme'] . '://' . $digest['host'] . $digest['port'] . $digest['path'] . '/api/v2/torrents/info?sort=' . $GLOBALS['qBittorrentSortOrder'] . '&reverse=' . $reverse;

After I updated the Uri's with the new API paths, my homepage widget started working again.

*EDIT: As a note, I am also using the docker setup for both qBit and Organizr

Hi! I'm sorry if this is a really noob question (probably is), but how could I manage to apply this fix using Organizr on Docker? I've tried to edit the homepage-connect-functions.php file, but it gets overwritten every time my container restarts.

Thanks!

CplPwnies commented 4 years ago

@netcop82 - I just made a copy of the homepage-connect-functions.php file on my host, made the necessary changes, then wrote a script that'll check the md5 sums of both files (which one should change if the container restarts). Then, I setup crontab to run that script every hour.

causefx commented 4 years ago

Sorry guys!!!! this is on master as of now... Version 2.0.362

MrHollowPS commented 1 year ago

@causefx this issue seems to have popped up again. how can i investigate?

EDIT: Okay this seems a bit weird. Qbittorrent runs on a docker container on my nas. It was in a bridge network and as soon as i changed the network from bridge to host everything was fine...

This might still be a bug though.

causefx commented 1 year ago

what error were you getting?

CplPwnies commented 1 year ago

Only because I contributed to this thread - I just checked my widget for this and everything is in working order on my docker instance.

causefx commented 1 year ago

thanks @CplPwnies