question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Logging error on some filesystems

See original GitHub issue

Detailed Description

The logging system will crash the Thorium server if it attempts to create a file that the filesystem does not support. The issue stems from the Date method in the bootstrap logs script, where the date can sometimes create a string with forward slashes. On some Mac filesystems this will be unable to create a file, and the server app will crash on every startup.

The following lines in server/src/bootstrap/logs (starting at line 16) are what need to be modified to work with all types of filesystems, and perhaps add contingencies so that the app doesn’t crash if log files can’t be made.

const access = fs.createWriteStream( ${logDir}/access.${new Date() .toLocaleString() .split(" “) .join(”-“) .split(“😊 .join(”-”)}.log, { flags: "a" } ); const error = fs.createWriteStream( ${logDir}/error.${new Date() .toLocaleString() .split(" “) .join(”-“) .split(“😊 .join(”-”)}.log, { flags: "a" } );

This is the error that is shown in the console when the problem happens.

events.js:167 throw er; // Unhandled ‘error’ event ^

Error: ENOENT: no such file or directory, open ‘/Users/johnrobe/Documents/thorium/logs/access.8/19/2018,-12-18-29-AM.log’ Emitted ‘error’ event at: at fs.open (fs.js:2253:12) at FSReqWrap.oncomplete (fs.js:171:20) logout

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jrobecommented, Aug 20, 2018

No problem - will do. Thanks for the invite to the org! I’m going to try to take on one of the help-wanted issues next, but I’m still trying to learn the codebase a bit before jumping in to make a card. Either way, excited to help!

0reactions
alexanderson1993commented, Aug 20, 2018

That’s the way it’s supposed to be done! Many thanks!

If you find anything else, feel free to submit an issue. I’ve invited you to join the org, so you can go ahead and assign issues to yourself or to me, if you think I’d be better suited to solving it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What logs would be written if file system is full in UNIX?
On AIX, you will get entries in the standard error log if a filesystem operation fails due to a filesystem being full.
Read more >
Exception caught when writing error log to fileSystem.IO ...
When executing in Lambda environment, looks like there are some library errors (such as inability to log to CloudWatch logs may be due...
Read more >
Which is the best way to log errors, a file system or database?
Error Logging in Folder. Pros. Better performance; More fast; Can be accessed from remote. More Efficient; Errors can be logged even when connection...
Read more >
How to troubleshoot a filesystem full condition and how to ...
There are seven possible causes of a filesystem full:​​ 6 - Rare: /var/log files cleared after massive H/W errors logged; after restarting syslog,...
Read more >
Operating system error logs - IBM
GPFS records file system or disk failures using the error logging facility provided by the operating system: syslog facility on Linux, errpt facility...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found