Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot Error - Node App Instance 0 loop [SOLVED] #19

Open
god-father-xuez opened this issue Jan 16, 2019 · 12 comments
Open

Bot Error - Node App Instance 0 loop [SOLVED] #19

god-father-xuez opened this issue Jan 16, 2019 · 12 comments
Labels
Fixed - 4 Reference Known Issue question Further information is requested

Comments

@god-father-xuez
Copy link
Contributor

I cant seem to pass this error - Codebase, wallet and dependencies installed but still cant seem to get the bot to work.
These errors are found within the pm2 monit section

x TipBot > WARNING: NODE_APP_INSTANCE value of '0'      x
x                      xx did not match any instance config file names.         x
x                      xx PM2 > Change detected on path logs/tipbot-err-0.log   x
x                      xx for app TipBot - restarting                           x
x                      xx TipBot > WARNING: See https://github.com/lorenwest/n  x
x                      xx ode-config/wiki/Strict-Mode                           x
x                      xx PM2 > Stopping app:TipBot id:0                        x
x                      xx TipBot > [01-15-2019 06:25 pm PST][TipBot] 11         x
x                      xx aliases Loaded!                                       x
x                      xx PM2 > pid=19852 msg=failed to kill - retrying in      x
x                      xx NaNms                                                 x
x                      xx PM2 > pid=19852 msg=failed to kill - retrying in      x
x                      xx NaNms                                                 x
x                      xx PM2 > App [TipBot:0] exited with code [0] via         x
x                      xx signal [SIGINT]                                       x
x                      xx PM2 > pid=19852 msg=process killed                    x
x                      xx PM2 > App [TipBot:0] starting in -fork mode-          x
x                      xx PM2 > App [TipBot:0] online                           x
@god-father-xuez
Copy link
Contributor Author

Additional Details

[PM2] Applying action restartProcessId on app [TipBot](ids: 0)
[PM2] [TipBot](0) ✓
┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬────
│ App name │ id │ mode │ pid   │ status │ restart │ uptime │ cpu │ mem       │ use
├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼────
│ TipBot   │ 0  │ fork │ 15587 │ online │ 629     │ 0s     │ 0%  │ 13.1 MB   │ tes
└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴────
 Use `pm2 show <id|name>` to get more details about an app
Done in 0.44s.
#:~/Documents/TipBot$ pm2 update
Be sure to have the latest version by doing `npm install pm2@latest -g` before doi
[PM2] Saving current process list...
[PM2] [v] Modules Stopped
[PM2] Applying action deleteProcessId on app [all](ids: 0)
[PM2] [TipBot](0) ✓
[PM2] [v] All Applications Stopped
[PM2] [v] PM2 Daemon Stopped
[PM2] Spawning PM2 daemon with pm2_home=/home/testserver/.pm2
[PM2] Restoring processes located in /home/testserver/.pm2/dump.pm2
[PM2] Process /home/testserver/Documents/TipBot/bot/bot.js restored
>>>>>>>>>> PM2 updated
┌──────────┬────┬─────────┬──────┬───────┬────────┬─────────┬────────┬─────┬──────
│ App name │ id │ version │ mode │ pid   │ status │ restart │ uptime │ cpu │ mem
├──────────┼────┼─────────┼──────┼───────┼────────┼─────────┼────────┼─────┼──────
│ TipBot   │ 0  │ 1.0.0   │ fork │ 15909 │ online │ 0       │ 0s     │ 0%  │ 24.2
└──────────┴────┴─────────┴──────┴───────┴────────┴─────────┴────────┴─────┴──────
 Use `pm2 show <id|name>` to get more details about an app

@god-father-xuez
Copy link
Contributor Author

Seems like Yimp|NPM is causing this issue?

warning discord.js > [email protected]: use node-fetch instead
warning [email protected]: Creating embeds is a simple task that should not be done through one function. Please use Discord.js's functions instead.
warning jsonpath > jison > [email protected]: Package no longer supported. Contact [email protected] for more info.
warning jsonpath > jison > jison-lex > [email protected]: Package no longer supported. Contact [email protected] for more info.
warning regex > jison > [email protected]: Package no longer supported. Contact [email protected] for more info.
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "bufferutil@^3.0.3".
warning " > [email protected]" has unmet peer dependency "erlpack@discordapp/erlpack".
warning " > [email protected]" has unmet peer dependency "node-opus@^0.2.7".
warning " > [email protected]" has unmet peer dependency "opusscript@^0.0.6".
warning " > [email protected]" has unmet peer dependency "sodium@^2.0.3".
warning " > [email protected]" has unmet peer dependency "libsodium-wrappers@^0.7.3".
warning " > [email protected]" has unmet peer dependency "uws@^9.14.0".
[4/4] Building fresh packages...```

@MSFTserver
Copy link
Owner

solved in discord DM, suggested adding new folder name logs to ignore watch list

@MSFTserver MSFTserver reopened this Jan 16, 2019
@MSFTserver MSFTserver changed the title Bot Error Bot Error - Node App Instance 0 loop [SOLVED] Jan 16, 2019
@MSFTserver MSFTserver added Fixed - 4 Reference question Further information is requested Known Issue labels Jan 16, 2019
@telostia
Copy link

where to put logs folder? in root? I tried that, didnt help solve it

@MSFTserver
Copy link
Owner

@telostia doesnt matter just has to coincide with whats inside ecosystem.config.js so pm2 knows where to write the logs to

@telostia
Copy link

telostia commented Apr 23, 2019

whats odd is that. even with the right ecosystem.config.js configs. its stil giving the error... nodejs updated, tried on both windows and linux , updated pm2. there is something really wrong here. Heres the details to the file:
module.exports = {
apps: [
{
name: 'tipbot',
script: './bot/bot.js',
cwd: './botfolder',
instance_id_env: '0',
watch: true,
ignore_watch : ['node_modules', 'logs', 'Downloads', '.git'],
error_file:
'./tipbot-err.log',
out_file: './tipbot-out.log',
env: {
NODE_ENV: 'development'
},
env_production: {
NODE_ENV: 'production'
}
}
]
};

and heres whats in the default.json :
"moderation":{
"pm2Name": "tipbot",
"perms": ["Admin","Moderator","Community Leader","Bots", "bots"],
"botDev": "bots",
"logchannel": "ommited",
"botspamchannels": ["ommited"]
}

Heres the screenshot of it constantly restarting pm2:
image

Heres the error from the log:

image

Those are just pretty much default values. Am I doing something wrong there?

@MSFTserver
Copy link
Owner

did you rename the config file...says it cant see one

@telostia
Copy link

telostia commented Apr 23, 2019

ecosystem.config.js? yes. those are the first things i do. If I haven't then there wouldnt be any log files generated right?

@telostia
Copy link

ok I found the problem. cwd: './botfolder', should be pointing to ./ since I only renamed the ecosystem.js and its looking for the file in botfolder folder.

@telostia
Copy link

hm.. that leads to another error:

WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
TypeError: bot.user.setActivity is not a function

Don't know why its not finding app instance 0. It is in ecosystem.config.js
name: 'tipbot',
script: './bot/bot.js',
cwd: './',
instance_id_env: '0',
I haven't made any changes to the bot.js yet also.

@MSFTserver
Copy link
Owner

thats a normal issue with, the config package conflicts with node.js config it looks for so they sorta clash but nothing to worry about the other issue is completely different, probably has to do with setting up the bot properly with discord

@telostia
Copy link

ok I just had to remove the yarn.lock and yarn install again. works :D thanks @MSFTserver !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed - 4 Reference Known Issue question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants