toptal / haste-server

open source pastebin written in node.js
https://www.toptal.com/developers/hastebin/about
2.94k stars 795 forks source link

Error: Invalid transport, must be an object with a log method #280

Closed Homie20006 closed 4 years ago

Homie20006 commented 5 years ago

After a fresh install with the recommended installation @ wiki on 3 different test servers (Ubuntu 18.04 + Debian 9.4) i get the following error if i execute the start command npm start:

haste@0.1.0 start /home/homie/haste-server node server.js

/home/homie/haste-server/node_modules/winston-transport/legacy.js:18 throw new Error('Invalid transport, must be an object with a log method.'); ^

Error: Invalid transport, must be an object with a log method. at new LegacyTransportStream (/home/homie/haste-server/node_modules/winston-transport/legacy.js:18:11) at DerivedLogger.add (/home/homie/haste-server/node_modules/winston/lib/winston/logger.js:345:11) at Object.winston.(anonymous function).args [as add] (/home/homie/haste-server/node_modules/winston/lib/winston.js:110:68) at Object. (/home/homie/haste-server/server.js:31:13) at Module._compile (internal/modules/cjs/loader.js:806:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:817:10) at Module.load (internal/modules/cjs/loader.js:676:32) at tryModuleLoad (internal/modules/cjs/loader.js:608:12) at Function.Module._load (internal/modules/cjs/loader.js:600:3) at Function.Module.runMain (internal/modules/cjs/loader.js:869:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! haste@0.1.0 start: node server.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the haste@0.1.0 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! /root/.npm/_logs/2019-02-25T19_06_39_037Z-debug.log

Content of the stated debug log:

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ] 2 info using npm@6.7.0 3 info using node@v12.0.0-pre 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle haste@0.1.0~prestart: haste@0.1.0 6 info lifecycle haste@0.1.0~start: haste@0.1.0 7 verbose lifecycle haste@0.1.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle haste@0.1.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/homie/haste-server/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 9 verbose lifecycle haste@0.1.0~start: CWD: /home/homie/haste-server 10 silly lifecycle haste@0.1.0~start: Args: [ '-c', 'node server.js' ] 11 silly lifecycle haste@0.1.0~start: Returned: code: 1 signal: null 12 info lifecycle haste@0.1.0~start: Failed to exec start script 13 verbose stack Error: haste@0.1.0 start: node server.js 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16) 13 verbose stack at EventEmitter.emit (events.js:197:13) 13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:197:13) 13 verbose stack at maybeClose (internal/child_process.js:984:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5) 14 verbose pkgid haste@0.1.0 15 verbose cwd /home/homie/haste-server 16 verbose Linux 4.9.0-6-amd64 17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 18 verbose node v12.0.0-pre 19 verbose npm v6.7.0 20 error code ELIFECYCLE 21 error errno 1 22 error haste@0.1.0 start: node server.js 22 error Exit status 1 23 error Failed at the haste@0.1.0 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

Versions of software used (installed like installation wiki) node v12.0.0-pre npm v6.7.0

The config is default:

{

"host": "0.0.0.0", "port": 7777,

"keyLength": 10,

"maxLength": 400000,

"staticMaxAge": 86400,

"recompressStaticAssets": true,

"logging": [ { "level": "verbose", "type": "Console", "colorize": true } ],

"keyGenerator": { "type": "phonetic" },

"rateLimits": { "categories": { "normal": { "totalRequests": 500, "every": 60000 } } },

"storage": { "type": "memcached", "host": "127.0.0.1", "port": 11211, "expire": 2592000 },

"documents": { "about": "./about.md" }

}

Does anyone knows how or if this is fixable? :(

Greetings Daniel

Homie20006 commented 5 years ago

my quoting bugged idk how to do that properly...

i put both into a hastebin: error: https://hastebin.com/umuxedifiw.rb log: https://hastebin.com/jiyufoxici.rb

hephaestus9 commented 5 years ago

I just got the same error.

seejohnrun commented 4 years ago

Hi if anyone is able to reproduce this on the newest version that would be super helpful. The information here from the stack trace is from an older version of Winston that is no longer being used. Thank you!

zneix commented 4 years ago

I believe this happens because of very old version of winston package, I had similar issue when I took up rewriting haste back in August and I had to rework whole winston from scratch.

ionstorm66 commented 2 years ago

Having the same error on a brand new install. Pulled commit 72863858338a57d54eb9dee55530e90ebbc22453 and having the same error.

Ubuntu 22.04