MantisBT - Doomseeker
View Issue Details
0003453Doomseeker[All Projects] Suggestionpublic2018-08-20 22:242022-12-28 17:23
WubTheCaptain 
Pol M 
normaltweakalways
closedfixed 
1.1 
1.21.2 
0003453: When Doomseeker fails to startup due to file system errors, return errno/message from the filesystem
0003396 is supposed to fix a possible lack of any indication what went wrong during startup (e.g. when a config directory cannot be read), but it doesn't give a precise reason why something failed, such as "other unexpected cases" as indicated in code. In such "other unexpected cases", the error message will still be hopelessly useless.

Using errno.h and returning that message in the dialog would be a mostly foolproof way to solve the problem for good.
No tags attached.
related to 0003396closed Zalewa Doomseeker startup error may display an empty list of directories which couldn't be created (chmod 0000 with empty directory) 
child of 0003279acknowledged  List of Debian issues (misc/non-policy) 
Issue History
2018-08-20 22:24WubTheCaptainNew Issue
2018-08-20 22:24WubTheCaptainRelationship addedrelated to 0003396
2018-08-20 22:25WubTheCaptainSeverityminor => tweak
2018-08-27 03:06WubTheCaptainRelationship addedchild of 0003279
2018-08-28 03:56WubTheCaptainDescription Updatedbug_revision_view_page.php?rev_id=11723#r11723
2018-09-03 01:05Pol MAssigned To => Pol M
2018-09-03 01:05Pol MStatusnew => assigned
2018-09-03 23:13Pol MNote Added: 0019488
2018-09-03 23:14Pol MStatusassigned => needs review
2018-09-05 21:58ZalewaNote Added: 0019493
2018-09-05 21:58ZalewaStatusneeds review => needs testing
2018-09-18 12:32WubTheCaptainNote Added: 0019542
2018-09-18 12:32WubTheCaptainStatusneeds testing => resolved
2018-09-18 12:32WubTheCaptainFixed in Version => 1.2
2018-09-18 12:32WubTheCaptainResolutionopen => fixed
2018-09-18 12:33WubTheCaptainNote Edited: 0019542bug_revision_view_page.php?bugnote_id=19542#r11805
2018-10-27 22:55WubTheCaptainStatusresolved => closed
2022-12-28 17:23ZalewaNote Added: 0022564

Notes
(0019488)
Pol M   
2018-09-03 23:13   
new pull request regarding this issue:'https://bitbucket.org/Doomseeker/doomseeker/pull-requests/16/adresses-0003453/diff [^]'
(0019493)
Zalewa   
2018-09-05 21:58   
I merged Pol M's pull request and also pushed follow-up commits:

1. Already produce DirErrno structures at the moment when directories fail to be created instead of doing this by performing subsequent checks after "something unspecified" fails.
2. When data directories fail to be created due to lack of permissions, try to figure out which parent directory is the one that lacks these permissions. This will also check NTFS permissions.

To summarize, the current behavior is this: Doomseeker attempts to create several storage directories that it "needs" to run. These directories include places to store demos, master server cache, configuration and "generic data". Doomseeker upon launch will try to create as many of these directories as possible. Each failure to create a directory is collected on a list with an according errno value and strerror message. In some cases, like when user doesn't have NTFS permissions, it is possible that a failure will occur but errno value will stay at zero. Doomseeker will try to do some extra permission checks to produce a custom error with custom message, explaining which directory is the one that lacks permissions. If this fallback operation still fails to deduce the error reason, Doomseeker will resign to a generic "cannot create directory" error message. Doomseeker will pop up a message box to display all errors that it accumulated, discarding multiple errors for the same directory, and then it will quit. If no errors occur, Doomseeker continues its run.

Two side notes regarding this behavior:

1. When you think about it, lack of access to storage space is not really "critical" and it's questionable that Doomseeker quits if storage space cannot be created. However, it was assumed that most users will want their files saved, so having a hard, crashing failure in the end is more beneficial to the user than just popping up a box that the user may ignore or even avoiding a message box altogether and only quietly logging the errors to the log and then continuing "normal" operation while user unknowingly loses data.

2. Another thing about directory permissions is that Doomseeker will only complain if it cannot create the storage space. If, for example, you take away permissions to the already existing "demos" directory, this case won't be checked. Odd behavior will, however, ensue - demos won't record, and the demo manager will show empty playlist.
(0019542)
WubTheCaptain   
2018-09-18 12:32   
(edited on: 2018-09-18 12:33)
I will assume this is fixed, at least as I tried on GNU/Linux (ext4 filesystem), Doomseeker 1.2~beta-180915-0824. I didn't bother testing NTFS permissions, but if it's not resolved then a new ticket can be opened – or this ticket reopened.

Thanks to both of you.

Quote from Zalewa
Me myself have to thank a rather peculiar teacher at my Uni, who cared enough and had an attitude and he pointed out my code and directly stated that it’s a piece of crap but also explained how it can be improved. He wasn’t the most likable person, but he had the knowledge.


You have a nice teacher. 😊

Quote from Zalewa
Another thing about directory permissions is that Doomseeker will only complain if it cannot create the storage space. If, for example, you take away permissions to the already existing "demos" directory, this case won't be checked. Odd behavior will, however, ensue - demos won't record, and the demo manager will show empty playlist.


Please file a ticket for this if needed; even if the resolution would be something else than "resolved".

(0022564)
Zalewa   
2022-12-28 17:23   
I shifted a piece of implementation for this to the more generic FileUtils so that the program can use it more generally without dragging in the clumsy DataPaths:'https://bitbucket.org/Doomseeker/doomseeker/commits/7a75fc5a821c82a5ce36120968dfd238933d91d9 [^]'