flood icon indicating copy to clipboard operation
flood copied to clipboard

Unhandled rejection: undefined with Deluged 2.0.4

Open mweinelt opened this issue 3 years ago • 11 comments

Type: Bug Report

  • [x] Try to follow the update procedure described in the README and try again before opening this issue.

Your Environment

  • Version used:
    • Version e66b6b6
  • Environment name and version:
    • Node.js version v15.14.0
    • npm version v7.9.0
    • Web browser Firefox 89.0.2
  • Operating system and version: Arch Linux
  • Torrent client and version: Deluge 2.0.4

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 avatar Jul 03 '21 21:07 mweinelt

% npm run start:development:server 

> [email protected] 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

mweinelt avatar Jul 05 '21 12:07 mweinelt

I am aware of the instabilities of the Deluge support.

jesec avatar Jul 06 '21 19:07 jesec

any love for this ?

lukasa1993 avatar Nov 17 '21 13:11 lukasa1993

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

awsms avatar Mar 12 '22 23:03 awsms

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

> [email protected] 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 avatar Apr 18 '22 01:04 dexter-dz

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

> [email protected] 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 avatar Apr 18 '22 01:04 dexter-dz

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 😉

dexter-dz avatar Apr 18 '22 02:04 dexter-dz

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.

ChristopherTheBoss avatar May 12 '22 04:05 ChristopherTheBoss

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

SilverNetiX avatar Dec 17 '22 11:12 SilverNetiX

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.

  • First you'll need to create a user on the deluge side that Flood will use: https://dev.deluge-torrent.org/wiki/UserGuide/Authentication
  • Next you'll need to ensure deluge is allowing remote connections, to enable this go to the deluge web ui then go to Preferences > Daemon > Allow Remote Connections
  • While there take note of the Daemon port that is the port you'll be using when setting up Flood.
  • This step probably isn't necessary but I restarted deluge to ensure these changes took effect.

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.

duhruh avatar Jan 29 '23 02:01 duhruh

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

Scrxtchy avatar Oct 23 '23 06:10 Scrxtchy