-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
logger instantiates itself with default settings, causing crash on server environments that do not allow file write permissions #6179
Comments
@kevflynn I just realized that your issue is your root folder is readonly. Steps to reproduce
If your logs folder was read only you would have seen an error like
|
when this is going to be released? same problem here
|
I've tried to disable it on server initialisation as said in docs but no luck
that is still logging stuff when parse starts. also in doubt, is there a way to store these logs upon cloud vendors like google cloud storage? I'm trying to run Parse Server on App Engine but in a non-flex env would appreciate a lot some guidance thanks |
…#6186) * Fix parse-community#6179 Initializing default logger Fixes: parse-community#6179 Removes unnessary logs * fix typo * if error just write to console
Issue Description
When you import the parse-server sdk, the logger file instantiates the file logger with default settings, causing the nodejs application to crash if the file system doesn't allow write permissions. This is irrespective of instantiating parse-server with custom config. The problem appears to be in the logger.js file on the line:
let logger = defaultLogger();
Steps to reproduce
Expected Results
The server should run and the logger should only instantiate once I instantiate the parse-server with optional config settings
Actual Outcome
The logger is instantiated even before I instantiate the parse-server and have a chance to pass my own config settings causing a crash if write permissions are not allowed
Environment Setup
Logs/Trace
{ insertId: "5dbc64ea00010957b7762996" labels: { clone_id: "00c61b117c37e953a744445117cca35dda5c28e7dddc8cd7e6c4936a7ef8cda1c3d442bca9" } logName: "projects/communityroot/logs/stderr" receiveTimestamp: "2019-11-01T17:01:30.156658889Z" resource: { labels: { module_id: "api" project_id: "communityroot" version_id: "20191101t120829" zone: "us17" } type: "gae_app" } textPayload: "Error: EROFS: read-only file system, mkdir '/srv/logs/' at Object.mkdirSync (fs.js:757:3) at /srv/node_modules/file-stream-rotator/FileStreamRotator.js:515:20 at Array.reduce (<anonymous>) at mkDirForFile (/srv/node_modules/file-stream-rotator/FileStreamRotator.js:503:27) at Object.FileStreamRotator.getStream (/srv/node_modules/file-stream-rotator/FileStreamRotator.js:421:5) at new DailyRotateFile (/srv/node_modules/winston-daily-rotate-file/daily-rotate-file.js:83:57) at configureTransports (/srv/node_modules/parse-server/lib/Adapters/Logger/WinstonLogger.js:41:27) at configureLogger (/srv/node_modules/parse-server/lib/Adapters/Logger/WinstonLogger.js:109:3) at new WinstonLoggerAdapter (/srv/node_modules/parse-server/lib/Adapters/Logger/WinstonLoggerAdapter.js:19:42) at defaultLogger (/srv/node_modules/parse-server/lib/logger.js:24:19) at Object.<anonymous> (/srv/node_modules/parse-server/lib/logger.js:28:14) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3)" timestamp: "2019-11-01T17:01:30.067927Z" }
The text was updated successfully, but these errors were encountered: