On 4-10-2012 20:57, Vlad Khorsun wrote: >> Why does Firebird return such a low level OS-dependent(?) error message >> instead of returning a Firebird-specific message that explains what went >> wrong (eg creating temporary files), instead of why it failed (the >> low-level error message)? > > - because it was written this way many years ago (before it became Firebird) > - because without original lowest-level error it is impossible to find a > reason for failure > - because in most cases it is obvious what Firebird did at failure moment > > I agree that sometime more context from intermediate levels could help > to better > understand what happens. For example, when transliterate error happens it is > good > to know assignment destination (field or variable) name. I'm not sure it is > easy to > implement. But in the case of "CreateFile failed" when index is built... - i > see nothing > to add here, it is clear enough as for me...
I don't: as an 'end-user' of Firebird I have no clue what it means, in this case it is not that bad because you also have the message "cannot commit index IDX_RMGM_IMPORT_DNA", although an additional explanation like "failed to create temporary file" or something would be helpful. It is worse in other situations: eg trying to connect to a database, or creating a new database. This is the message you get when trying to connect to a non-existent database on Windows (with flamerobin): *** IBPP::SQLException *** Context: Database::Connect Message: isc_attach_database failed SQL Message : -902 Unsuccessful execution caused by a system error that precludes successful execution of subsequent statements Engine Code : 335544344 Engine Message : I/O error during "CreateFile (open)" operation for file "D:\XYZ.FDB" Error while trying to open file Het systeem kan het opgegeven bestand niet vinden. (The system cannot find the specified file.) The first time I was confronted with this error message, I thought "What, why is it trying to create a file, the database already exists?" On Linux I get Engine Code : 335544344 Engine Message : I/O error during "open" operation for file "/opt/xyz.fdb" Error while trying to open file No such file or directory "Huh, a a similar, but different error message?" Now on a DVD-ROM drive that does not contain a disk: Engine Code : 335544344 Engine Message : I/O error during "CreateFile (open)" operation for file "F:\XYZ\XYZ.FDB" Error while trying to open file Het apparaat is niet klaar. (Device is not ready) Now what happens if I try to connect to the same non-existent database with DatabaseAccess = Restrict D:\data\DB: Engine Code : 335544831 Engine Message : Access to database "D:\XYZ.FDB" is denied by server administrator What would happen when I try to connect to a drive that does not exist (eg: drive K:\) (Note: same with or without DatabaseAccess restriction) SQL Message : -904 Unsuccessful execution caused by an unavailable resource. Engine Code : 335544375 Engine Message : unavailable database Now with a file that the user has no access to (eg read access is denied in the ACL): Engine Code : 335544344 Engine Message : I/O error during "CreateFile (open)" operation for file "D:\DATA\DB\TESTDATABASE.FDB" Error while trying to open file Toegang geweigerd. (Access denied) Firebird is leaking information about the layout of a computer (eg existence or non-existence of drives), and about the security configuration of both Firebird (DatabaseAccess) and the rights configuration on file or folder level. I would expect and prefer that in all these cases that the error message would be the same (eg: "Unable to attach to database '<db>': Database does not exist or is not accessible", where <db> is the original alias or path used in the connection string, and not the actual path Firebird tries). The actual error details would then be logged in firebird.log. Interestingly, of the above attempts to access a non-existent or restricted file, nothing(!) is logged in firebird.log. Mark -- Mark Rotteveel ------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel