Comments (17)
Are there any errors in the console when the bot stops/shuts down? Threads that linger are not an issue, I've had plenty of those on multiple servers where I host modmail.
from modmailbot.
`
^E(node:9731) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: 404 NOT FOUND on POST /channels/345194807536386049/messages
{"code": 10003, "message": "Unknown Channel"}
(node:9731) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
events.js:182
throw er; // Unhandled 'error' event
^
TypeError: Cannot read property 'id' of undefined
at CommandClient.onMessageCreate (/home/daddy/modmailbot/node_modules/eris/lib/command/CommandClient.js:136:58)
at emitOne (events.js:120:20)
at CommandClient.emit (events.js:210:7)
at Shard.wsEvent (/home/daddy/modmailbot/node_modules/eris/lib/gateway/Shard.js:394:33)
at WebSocket.ws.onmessage (/home/daddy/modmailbot/node_modules/eris/lib/gateway/Shard.js:1462:34)
at WebSocket.onMessage (/home/daddy/modmailbot/node_modules/ws/lib/EventTarget.js:103:16)
at emitTwo (events.js:125:13)
at WebSocket.emit (events.js:213:7)
at Receiver._receiver.onmessage (/home/daddy/modmailbot/node_modules/ws/lib/WebSocket.js:146:54)
at Receiver.dataMessage (/home/daddy/modmailbot/node_modules/ws/lib/Receiver.js:389:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node src/index.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/daddy/.npm/_logs/2017-08-13T06_47_47_413Z-debug.log
`
This is what I get
from modmailbot.
Have you deleted any of the modmail threads (the channels, e.g. #dragory-8537) manually? If so, that will break the bot, use !close
instead (not ideal that it breaks, will need to fix this).
A possible fix:
- Shut down the bot
- Delete
db/threads.json
- Delete all channels on the modmail inbox server except the default channel
- Restart bot
from modmailbot.
Will do, also I don't know if this is relevant or not but there's two other channels in the modmail server, one for bot testing and another for bot logs, just so I can have an additional way of knowing who leaves/joins and name changes
from modmailbot.
I don't know if that'd cause this too, should I just remove those?
from modmailbot.
Debug logs
0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/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/local/lib/node_modules/npm/bin/node-gyp-bin:/home/daddy/modmailbot/node_modules/.bin:/home/daddy/bin:/home/daddy/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin 9 verbose lifecycle [email protected]~start: CWD: /home/daddy/modmailbot 10 silly lifecycle [email protected]~start: Args: [ '-c', 'node src/index.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 src/index.js13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:289:16) 13 verbose stack at emitTwo (events.js:125:13) 13 verbose stack at EventEmitter.emit (events.js:213:7) 13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) 13 verbose stack at emitTwo (events.js:125:13) 13 verbose stack at ChildProcess.emit (events.js:213:7) 13 verbose stack at maybeClose (internal/child_process.js:921:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) 14 verbose pkgid [email protected] 15 verbose cwd /home/daddy/modmailbot 16 verbose Linux 4.4.0-83-generic 17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 18 verbose node v8.2.1 19 verbose npm v5.3.0 20 error code ELIFECYCLE 21 error errno 1 22 error [email protected] start:
node src/index.js22 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 ]
from modmailbot.
Ive deleted all the channels except for the default and its still happening
from modmailbot.
Bot started, listening to DMs
events.js:182
throw er; // Unhandled 'error' event
^
TypeError: Cannot read property 'id' of undefined
at CommandClient.onMessageCreate (/home/daddy/test/modmailbot/node_modules/eris/lib/command/CommandClient.js:136:58)
at emitOne (events.js:120:20)
at CommandClient.emit (events.js:210:7)
at Shard.wsEvent (/home/daddy/test/modmailbot/node_modules/eris/lib/gateway/Shard.js:394:33)
at WebSocket.ws.onmessage (/home/daddy/test/modmailbot/node_modules/eris/lib/gateway/Shard.js:1462:34)
at WebSocket.onMessage (/home/daddy/test/modmailbot/node_modules/ws/lib/EventTarget.js:103:16)
at emitTwo (events.js:125:13)
at WebSocket.emit (events.js:213:7)
at Receiver._receiver.onmessage (/home/daddy/test/modmailbot/node_modules/ws/lib/WebSocket.js:146:54)
at Receiver.dataMessage (/home/daddy/test/modmailbot/node_modules/ws/lib/Receiver.js:389:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node src/index.js "app"
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/daddy/.npm/_logs/2017-08-18T09_45_02_465Z-debug.log
daddy@streconn:~/test/modmailbot$
from modmailbot.
Hmm, this seems to be an issue in Eris (the Discord library I'm using), possibly related to the new "X has joined the server" welcome messages. It seems to trip on messages that don't have an author (e.g. system messages).
While we wait for a fix upstream for eris, you can disable these welcome messages by going to server settings and setting "new member messages channel" to "No New Member Messages" like so:
from modmailbot.
Alright I've done so, although the issue is still persisting and dying, giving me that error message.
from modmailbot.
Ive done all the steps, ive deleted the threads.json, deleted all of the channels except for default, correctly closed the channel with !close and then set no to welcome messages... and the issue is still persisting for some reason
from modmailbot.
:\
from modmailbot.
im sad
from modmailbot.
- I have similar issue; it will constantly error out sys clock different from discords UTC time
(an eris issue) despite fixes, it still happens A LOT
2)The bot will create empty text channels just before a crash, example Anon-1234.
After restarting the bot if the same user msgs the bot it makes a 2nd user room Anon-1234
the bot has no checks if a room already exists. I dono if thats something easy to add.
- currently unable to get npm start to work. the old start method works fine. But it will not reboot/restart if it gets an error (sys time mismatch).
error from Git
events.js:182
throw er; // Unhandled 'error' event
^
Error: Your clock is 2572ms behind Discord's server clock. Please check your con
nection and system time.
at ClientRequest.req.once (C:\Server Programs\Discord Bots\modmailbot-old\no
de_modules\eris\lib\rest\RequestHandler.js:170:56)
at Object.onceWrapper (events.js:316:30)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:564:21
)
at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
at TLSSocket.socketOnData (_http_client.js:453:20)
at emitOne (events.js:115:13)
at TLSSocket.emit (events.js:210:7)
at addChunk (_stream_readable.js:252:12)
from modmailbot.
1 & 3) Make sure your computer's clock is synchonized. I don't think there's anything I can do to fix that issue since it's on eris's/discord's side.
2) Checking if a room exists is done for channels that have been created without the bot crashing. I can't really use the channel name for the check since it could result in collisions (since some names need to be transliterated into ASCII).
from modmailbot.
Closing issue due to inactivity
from modmailbot.
from modmailbot.
Related Issues (20)
- Suggestion: Whitelist Bots HOT 1
- EADDRINUSE error HOT 1
- Option to include the ticket's log-link in the Information Header Message HOT 1
- Restrict bot usage to certain time periods
- Error: TypeError: Cannot read properties of undefined (reading 'add') HOT 1
- !r do not work HOT 1
- Modmail
- Slash command HOT 1
- Multi server HOT 1
- Suggestion: Regex Replies HOT 1
- Automatically reconnect after connection is interrupted instead of crashing HOT 5
- New setting: firstTimeResponseMessage
- Translatable responseMessage HOT 1
- confirmation message when moving a thread HOT 1
- Secure logs with the oauth2 system HOT 1
- Adding a multi-command alias guide to the docs
- Adding a multi-line alias guide to the docs
- Category select menu on thread open HOT 1
- CRITICAL: TOKEN must be set HOT 2
- Feature Request: Per Category Role
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modmailbot.