keeps / dbptk-developer

DBPTK Developer - library and command-line tool for execution of database preservation actions
http://www.database-preservation.com
GNU Lesser General Public License v3.0
43 stars 19 forks source link

Courrupted siard file remains after java exception #168

Closed BorisDomajnko closed 8 years ago

BorisDomajnko commented 8 years ago

Description: I was creating a siard-2 file when I got the error (see #167). A siard file remains in the target directory. It is incomplete and of course cannot be opened. I suggest the work file is removed in case of premature program end.

Steps required to reproduce the bug:

  1. see #167

Attach the dbptk-app.log.txt file below. DEBUG 2016-03-31 13:36:06,495 (MsAccessUCanAccessImportModule) query: SELECT * FROM [PUBLIC].[Zaposlitve] ERROR 2016-03-31 13:36:06,553 (Main) Unexpected exception DEBUG 2016-03-31 13:36:06,554 (Main) Unexpected exception java.lang.NullPointerException at com.databasepreservation.modules.msAccess.in.MsAccessUCanAccessImportModule.rawToCellSimpleTypeNumericApproximate(MsAccessUCanAccessImportModule.java:108) at com.databasepreservation.modules.jdbc.in.JDBCImportModule.convertRawToCell(JDBCImportModule.java:1680) at com.databasepreservation.modules.jdbc.in.JDBCImportModule.convertRawToRow(JDBCImportModule.java:1649) at com.databasepreservation.modules.jdbc.in.JDBCImportModule.getDatabase(JDBCImportModule.java:1926) at com.databasepreservation.Main.run(Main.java:121) at com.databasepreservation.Main.internal_main(Main.java:78) at com.databasepreservation.Main.main(Main.java:60) DEBUG 2016-03-31 13:36:06,555 (Main) ######################################################### DEBUG 2016-03-31 13:36:06,555 (Main) # FINISH-ID-c206f494-ac40-4327-8da4-8b2d3d5a82f8 DEBUG 2016-03-31 13:36:06,555 (Main) # FINISH v2.0.0-beta4.0 DEBUG 2016-03-31 13:36:06,555 (Main) # EXIT CODE: 1 DEBUG 2016-03-31 13:36:06,555 (Main) #########################################################

chalkos commented 8 years ago

This SIARD file can sometimes be used to identify problems, that is why it is not deleted. Do you have a reason for wanting this feature?

BorisDomajnko commented 8 years ago

If you can open and observe the file I do not object. But if the file seems corrupted and cannot be unzipped at all I think it is better to do the cleanup. In my case the file was not usable.

chalkos commented 8 years ago

The file may still be usable, even if some tools are not able to do it. If it has a size of 0 bytes is obviously not complete and can be removed, but other than that there doesn't seem to be a straightforward way to determine if the output file is usable of not (if the way is not straightforward, there is no point in doing it, since the user can easily/instantly decide wether to discard or save the file for debug).

luis100 commented 8 years ago

Hi Boris. While in beta we will keep the resulting files by default for debugging. After final release we should always clean-up files produced when a fatal error occurs, except if special debug flags are defined. So I suggest creating a new issue with this and putting it for final version milestone and closing this issue for now.

chalkos commented 8 years ago

I'll create the issue.