jesec / flood

A modern web UI for various torrent clients with a Node.js backend and React frontend.
https://flood.js.org
GNU General Public License v3.0
2.23k stars 135 forks source link

Unhandled rejection: undefined with Deluged 2.0.4 #351

Open mweinelt opened 3 years ago

mweinelt commented 3 years ago

Type: Bug Report

Your Environment

Summary

After creating an account flood crashes.

FATAL internal error. Please open an issue.
Unhandled rejection: undefined

It connects to Deluge and less than a second later gets disconnected due to the crash.

[INFO    ][deluge.core.rpcserver         :171 ] Deluge Client connection made from: 127.0.0.1:41282
[INFO    ][deluge.core.rpcserver         :197 ] Deluge client disconnected: Connection to the other side was lost in a non-clean fashion: Connection lost.

Expected Behavior

Don't crash, or give a more reasonable error than undefined.

Current Behavior

Crashes on startup.

Possible Solution

No idea. ## Steps to Reproduce
  1. Build flood from source
  2. Start flood
  3. Choose Deluge
  4. Create Account
  5. CRASH.

Context

Using Flood with Deluge.

mweinelt commented 3 years ago
% npm run start:development:server 

> flood@4.6.1 start:development:server
> NODE_ENV=development TS_NODE_PROJECT=server/tsconfig.json ts-node-dev --transpile-only -r tsconfig-paths/register server/bin/start.ts

[INFO] Invalid Date ts-node-dev ver. 1.1.7 (using ts-node ver. 9.1.1, typescript ver. 4.3.4)
Flood server 4.6.1 starting on http://127.0.0.1:3000

UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".
[ERROR] Invalid Date UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".

Connection to deluged gets established, then dies less than a second after that

jesec commented 3 years ago

I am aware of the instabilities of the Deluge support.

lukasa1993 commented 2 years ago

any love for this ?

awsms commented 2 years ago

mh funny, i run two deluge instances; one with <300 torrents and the other one with +1000. i could add the first one perfectly fine in flood, login etcetera. and as soon as i added the second one, flood immediatly crashes

i can 100% reproduce it by changing the users.db file, removing the deluge entries, and adding them back

just realized it made my 2nd deluge instance crash

dexter-dz commented 2 years ago

When I created an account with deluge I faced the same problem, here's some additional details if it helps: The webpage loaded a green blank page with link http://127.0.0.1:3000/overview I am unable to launch flood again through the release windows executable as well as running npm start .

npm install & npm run build output I have tried building Flood again, but when I run npm start it exits with an error. image image

npm start console output image


F:\dex\git\flood>npm start

> flood@4.7.0 start
> node --use_strict dist/index.js

Flood server 4.7.0 starting on http://127.0.0.1:3000

(node:19992) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
FATAL internal error. Please open an issue.
Unhandled rejection: undefined
dexter-dz commented 2 years ago

When ran node --trace-deprecation process.binding the console output as follows:

image

F:\dex\git\flood>node --trace-deprecation process.binding node:internal/modules/cjs/loader:936 throw err; ^

Error: Cannot find module 'F:\dex\git\flood\process.binding'
←[90m    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)←[39m
←[90m    at Function.Module._load (node:internal/modules/cjs/loader:778:27)←[39m
←[90m    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)←[39m
←[90m    at node:internal/main/run_main_module:17:47←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: []
}

Node.js v17.9.0

F:\dex\git\flood>

npm run start:development:server

F:\dex\git\flood>npm run start:development:server

> flood@4.7.0 start:development:server
> NODE_ENV=development TS_NODE_PROJECT=server/tsconfig.json ts-node-dev --transpile-only -r tsconfig-paths/register server/bin/start.ts

'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.

F:\dex\git\flood>

image

I hope this helps

dexter-dz commented 2 years ago

Deleted users.db and reproduced the steps. • imageimage

This is the first time the http://127.0.0.1:3000/overview completely loaded for me, but the command prompt crashed and I will have to delete users.db again 😉

ChristopherTheBoss commented 2 years ago

Had the same issue. Deleting the users.db from %UserProfile%\.local\share\flood\db made it so I could successfully launch flood again. Thanks @awsms & @dexter-dz the error it threw was so vague I got scared. Also the crash persisted after reinstalling flood.

SilverNetiX commented 1 year ago

issue is still open. and "cannot connect to the client." shows as background of the flood interface after deleting the user.db and restarting flood.

This project/experiment needs a lot more love than its getting lol

duhruh commented 1 year ago

Okay so I was also getting this error however my issue was probably different. Since this isn't documented anywhere I can tell, i'll just try to be as verbose as possible here.

tl;dr my problem was I was using the wrong username/password for deluge

Deluge has 2 main API's, the RPC API and the Web API. Each of them authenticate differently. If you're anything like me you're probably more familiar with the latter of the two. Which only requires a password to authenticate, the Web UI password being sufficient.

However this project uses the RPC API which requires a username & password. Here's how you can set that up.

Once I did this I put all the information into Flood and it just worked. Since my Flood was a fresh install I didn't bother with trying to mess with the old database, I just wiped everything and started fresh again.

Scrxtchy commented 1 year ago

a small part of this problem is that the (re)connection promise doesn't any rejections https://github.com/jesec/flood/blob/1192e14294734e3d8925da4b376e31bcc7b3fcac/server/services/Deluge/clientRequestManager.ts#L285

I was able to determine some issues by logging the errors to console. I get a Error: connect ETIMEDOUT 192.168.0.108:58846 response, so I have an issue with Deluge or my firewall, but it's criminal that these errors are being hidden