bigcapitalhq / bigcapital

💵 Bigcapital is financial accounting with intelligent reporting for faster decision-making, an open-source alternative to Quickbooks, Xero, etc.
https://bigcapital.app
GNU Affero General Public License v3.0
2.27k stars 176 forks source link

Error: New Relic requires that you name this application! #487

Closed calm108 closed 3 weeks ago

calm108 commented 3 weeks ago

Just deployed bigcapital via docker. Keep seeing this in the server logs and the app keeps crashing:

New Relic for Node.js was unable to bootstrap itself due to an error: 2024-06-06 15:03:34 Error: New Relic requires that you name this application! 2024-06-06 15:03:34 Set app_name in your newrelic.js or newrelic.cjs file or set environment variable 2024-06-06 15:03:34 NEW_RELIC_APP_NAME. Not starting! 2024-06-06 15:03:34 at createAgent (/app/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/index.js:160:11) 2024-06-06 15:03:34 at initialize (/app/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/index.js:105:15) 2024-06-06 15:03:34 at Object. (/app/node_modules/.pnpm/newrelic@11.17.0/node_modules/newrelic/index.js:39:3) 2024-06-06 15:03:34 at Module._compile (node:internal/modules/cjs/loader:1254:14) 2024-06-06 15:03:34 at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) 2024-06-06 15:03:34 at Module.load (node:internal/modules/cjs/loader:1117:32) 2024-06-06 15:03:34 at Module._load (node:internal/modules/cjs/loader:958:12) 2024-06-06 15:03:34 at Module.require (node:internal/modules/cjs/loader:1141:19) 2024-06-06 15:03:34 at require (node:internal/modules/cjs/helpers:110:18) 2024-06-06 15:03:34 at 15477 (/app/packages/server/build/index.js:130385:18)

linear[bot] commented 3 weeks ago

BIG-194 New Relic for Node.js was unable to bootstrap itself due to an error: 2024-06-06 14:44:30 Error: New Relic requires that you name this application! 2024-06-06 14:44:30 Set app_name in your newrelic.js or newrelic.cjs file or set environment variable 2024-06-06 14:44:30 NEW_RELIC_APP_NAME. Not starting!

abouolia commented 3 weeks ago

It should work even without the newrelic variables. Let me check.

abouolia commented 3 weeks ago

@calm108 The Newrelic error that shows up in the logs does not mean the application does not work, it works without Newrelic env variables, might be there's another problem causes that.

calm108 commented 3 weeks ago

Well - it isn't crashing now BUT I cannot get SMTP to work (using resend) - should I file a new bug?

configured using these variables in .env:

Mail

MAIL_HOST=smtp.resend.com MAIL_USERNAME=resend MAIL_PASSWORD=MYAPIKEY MAIL_PORT=465 MAIL_SECURE=false MAIL_FROM_NAME=Agencia MAIL_FROM_ADDRESS=agencia@lifeonbtc.xyz

This is the error:

2024-06-06 16:07:11 Error: Unexpected socket close 2024-06-06 16:07:11 at Timeout._onTimeout (/app/node_modules/.pnpm/nodemailer@6.9.13/node_modules/nodemailer/lib/smtp-transport/index.js:190:31) 2024-06-06 16:07:11 at listOnTimeout (node:internal/timers:569:17) 2024-06-06 16:07:11 at process.processTimers (node:internal/timers:512:7)

abouolia commented 3 weeks ago

@calm108 Of course is not a bug, because I use Resend too, try to flip MAIL_SECURE=true because 465 port uses SSL/TLS.

calm108 commented 3 weeks ago

Right - got it! FYI set as true did not work set as TRUE did work.

calm108 commented 3 weeks ago

All set - error was not cause of crashing - not sure what was but logs are clear now....

abouolia commented 3 weeks ago

@calm108 I will get rid of the Newrelic error once I get time, because it's so confusing. if you got anything else please let us know.