tiny: Logger fails to create log file when channel name includes forward slash
I think the issue might be related to Gitter rooms being formatted with a slash in their name, which must conflict with the way tiny sets filenames for logs. You can see above in my configuration file that the channel I wanted to join on irc.gitter.im was “#jarun/nnn”. If this is really the cause, then perhaps an acceptable workaround would be to replace / with another character when creating new log files, such as -?
In other words when the channel name contains / logger fails to create the log
file and reports this in “mentions” tab:
Logger error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Two TODOs:
- The error message should show the file path
- We should handle channel names with
/s in them (as far as I can see RFC 2812 allows this)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (11 by maintainers)
Commits related to this issue
- Improve error reporting in logger Previously when we couldn't create a file we'd report Logger error: Os { code: 2, kind: NotFound, message: "No such file or directory" } Now Logger error:... — committed to osa1/tiny by osa1 4 years ago
- Improve error reporing when the logger fails to create log dir Previously we would report this in "mentions" tab: Can't create logger: No such file or directory (os error 2) With this patch: ... — committed to osa1/tiny by osa1 4 years ago
- logger: Create parent directories of log dir (#214) — committed to osa1/tiny by osa1 4 years ago
OK, done.
@Kabouik thanks… so the problem is logger can’t create the log directory. I slightly improved the error message in b7dfd9c so you’ll now see the path it failed to create. I think the most common reason for this is you have
/foo/bar/bazas your log directory but/foo/bardoesn’t exist. We currently don’t create parent directory, we assume that it exists. Perhaps we should change this to create all directories. Any opinions on that? cc @trevarj@Kabouik thanks again for reporting this. Please let me know if you encounter any other problems.