impress
impress copied to clipboard
Uncaught exception during unlink log file
Describe the bug I had Metarhia from Example template running during the night. And server crushed with Uncaught exception.
To Reproduce Run server, run client in browser and wait a long time. I don't know how to reproduce it quickly. I need to inspect metalog.
Expected behavior There must be no uncaught exception on async operations like unlink file.
Screenshots Error:
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
[Error: ENOENT: no such file or directory, unlink '/home/jebuscross/Example/log/2021-11-04-W0.log'] {
errno: -2,
code: 'ENOENT',
syscall: 'unlink',
path: '/home/jebuscross/Example/log/2021-11-04-W0.log'
}
Log file exists, and it is empty, as it should be. Last log file is 2021-11-04-W6.log
Desktop (please complete the following information):
- OS: [Arch Linux 64-bit]
- Node.js version [16.13.0]
- Impress version [2.0.0]
Additional context
I am almost 100 percent sure, that this bug connected to metalog
only. But it affects impress application server - it can be issued here.
I have an idea how to reproduce, at GMT 0 metalog closes old files and creates new. I will try @georgolden
@tshemsedinov I started now server again hope that tomorrow morning I will see anything in logs, that I added inside metalog
Localized: https://github.com/metarhia/metalog/blob/80386d29916bc79957640ea170da6c91d435bfb7/metalog.js#L297
My server also crashes when a new day starts. I reproduced by changing the built-in Date class and setting at 23:59. It might be worth adding something like this to the "metatests" library for time sensitive cases.
As of impress 3.0.1 everything works