Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

TypeError: Cannot read property 'clientGatewayService' of undefined #863

Open
3 tasks done
systemswizard opened this issue Feb 18, 2020 · 7 comments
Open
3 tasks done

Comments

@systemswizard
Copy link

systemswizard commented Feb 18, 2020

Type: Bug Report

  • Try to follow the update procedure described in the README and try again before opening this issue.
  • Please check the F.A.Q..
  • Please check the Troubleshooting wiki section.

Your Environment

  • Version used:

    • Version (stable release) v1.0.0
    • Commit ID (development release) commit bb55350 (HEAD -> master, origin/master, origin/HEAD)
  • Environment name and version:

    • Node.js version v13.8.0
    • npm version 6.13.6
    • Web browser Chrome 79 / Safari 13.0.2
  • Operating System and version: Debian 10 running rtorrent 0.9.7 lib torrent 0.13.7 (prepackaged by Debian)

Summary

There is a decent chance on a fresh install adding the rtorrent connection type of TCP or UNIX Socket, will cause flood to crash
If it manages to make it past this point there is a 50/50 chance flood will work for a minute and show current loaded torrent statues but shortly after crashes.
If it does not crash on its own, brining up the dialogue to add a torrent file or dropping it into the page causes flood to crash

Expected Behavior

adds the torrent file to rtorrent and don't crash

Current Behavior

$ npm start

[email protected] start /home/flynn/flood
node --use_strict server/bin/start.js

Flood server starting on http://0.0.0.0:3000.

GET /overview 304 3.575 ms - -
GET /static/js/main.ed991fb9.js 304 0.572 ms - -
GET /auth/verify?1582004960810 200 19.495 ms - 55
GET /static/media/Roboto-regular.f84cb1bf.woff2 304 2.817 ms - -
GET /static/media/Roboto-italic.4dcf65b9.woff2 304 2.816 ms - -
GET /static/media/Roboto-700.3b38c16e.woff2 304 2.841 ms - -
GET /static/media/Roboto-500.1afbee5a.woff2 304 2.844 ms - -
GET /favicon.ico 200 4.860 ms - -
GET /api/client/settings 200 4.777 ms - -
GET /api/settings 200 18.252 ms - 71
POST /api/client/connection-test 200 32.440 ms - 20
PATCH /auth/users/flynn 200 5.280 ms - -
GET /api/activity-stream?historySnapshot=fiveMin 200 16.312 ms - -
/home/flynn/flood/server/services/historyService.js:141
this.services.clientGatewayService
^

TypeError: Cannot read property 'clientGatewayService' of undefined
at HistoryService.fetchCurrentTransferSummary (/home/flynn/flood/server/services/historyService.js:141:19)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node --use_strict server/bin/start.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/flynn/.npm/_logs/2020-02-18T05_49_26_053Z-debug.log

$ cat /home/flynn/.npm/_logs/2020-02-18T05_49_26_053Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 info lifecycle [email protected]
start: [email protected]
7 verbose lifecycle [email protected]start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/flynn/flood/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
9 verbose lifecycle [email protected]start: CWD: /home/flynn/flood
10 silly lifecycle [email protected]
start: Args: [ '-c', 'node --use_strict server/bin/start.js' ]
11 silly lifecycle [email protected]start: Returned: code: 1 signal: null
12 info lifecycle [email protected]
start: Failed to exec start script
13 verbose stack Error: [email protected] start: node --use_strict server/bin/start.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:321:20)
13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:321:20)
13 verbose stack at maybeClose (internal/child_process.js:1026:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/flynn/flood
16 verbose Linux 4.19.0-6-amd64
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v13.8.0
19 verbose npm v6.13.6
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: node --use_strict server/bin/start.js
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Steps to Reproduce

  1. npm start
  2. add rtorrent connect
  3. add torrent
@Haarolean
Copy link

I keep getting the same exception when using flood behind a proxy.

@systemswizard
Copy link
Author

I keep getting the same exception when using flood behind a proxy.

I get this without using a reverse proxy, did try a reverse proxy with nginx and the issue persisted

@moooV252
Copy link

moooV252 commented Apr 22, 2020

Yes, exactly the same problem here. I've even registered an account to leave this commentary.
Previous version of Flood I had (installed a year ago) worked ok.

nodejs: v12.16.2
npm: 6.14.4
Flood latest cloned from git.

Steps to reproduce:

  1. Open Flood
  2. Register username and password
  3. fill in the unix socket path to rtorrent, test it, save it
  4. browser resets connection, flood server quits with error.

`Flood server starting on http://127.0.0.1:3000.

GET /overview 304 7.742 ms - -
GET /static/js/main.152fbc43.js 304 1.237 ms - -
GET /auth/verify?1587534901666 200 4.671 ms - 54
GET /api/client/settings 200 12.509 ms - -
GET /api/settings 200 177.811 ms - 2
POST /api/client/connection-test 200 20.622 ms - 20
PATCH /auth/users/test 200 12.030 ms - -
GET /api/activity-stream?historySnapshot=fiveMin 200 14.795 ms - -
/mnt/tr/flood/flood/server/services/historyService.js:141
this.services.clientGatewayService
^

TypeError: Cannot read property 'clientGatewayService' of undefined
at HistoryService.fetchCurrentTransferSummary (/mnt/tr/flood/flood/server/services/historyService.js:141:19)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)`

Maybe there's a commit which has affected it to have this behaviour? A year ago it worked ok, but had other bugs.

@christianhassler
Copy link

not running it behind a reverse proxy fixed it for me. still don't know what it is about the reverse proxy that's causing problems but i assume it's something to do with CGI. fwiw i was using lighttpd on arch linux. idk if it helps, but this was my config (which again, doesn't work):

$HTTP["host"] == "torrent.mydomain.tld" {
        proxy.server = ( "" => (
        ( "host" => "127.0.0.1", "port" => 3000 )
        ))
}

@aptkingston
Copy link

Same issue here running a reverse proxy (nginx in my case).

@JMarkin
Copy link

JMarkin commented Sep 5, 2020

I fixed it by remove line

@moooV252
Copy link

Thanks a lot, that really worked!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants