Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-7702

Backup of misconfigured SQL Server DB fails due to unknown type "datetime" (93)

      Backup fails with the error below when using SQL Server 2008 or newer database configured as SQL Server 2005 database. The error is:

      Backing up sql...
      1 rows written, 0 of 76 tables completed.
      422 rows written, 1 of 76 tables completed.
      425 rows written, 3 of 76 tables completed.
      426 rows written, 3 of 76 tables completed.
      432 rows written, 4 of 76 tables completed.
      Error reading database: Cannot encode value for unsupported column type: "datetime" (93) of column .created_date
      Backup failed

      As explained in Migrating to SQL Server SQL Server type needs to be specified when setting up database. SQL Server 2005 support was dropped in FishEye/Crucible 3.3 and it will be removed in future versions completely (CRUC-7712).

      No workaround

      As the SQL Server 2005 and SQL Server 2008+ schema versions differ, there is no easy fix for the problem yet. Changing SQL Server type in Crucible database settings won't help.

      Fix

      We fixed the issue and will release in the next point release. This will restore the backup capability.

      Updating schema

      4.0.4 release will workaround the problem of DB using old schema. If you want to update your schema to use correct SQL Server 2012 types, follow these steps:

      1. Update to 4.0.4 (to be released very soon)
      2. Update DB setting from "Type=SQLServer 2005" to "Type=SQLServer 2012"; do not update the URL, so no migration will be triggered (click 'Save', not 'Save & Migrate').
      3. Perform backup
      4. Restore backup

      The restored backup will set up the correct schema for SQL Server 2012.

          Form Name

            [CRUC-7702] Backup of misconfigured SQL Server DB fails due to unknown type "datetime" (93)

            I have finally found time to perform a backup & restore. Can you please tell me the way to verify my schema is now indeed using SQL Server 2012 schema? Does the following logs from the restore tool makes any sense?

            Restoring to: jdbc:jtds:sqlserver://***:1433;databaseName=****;
            Dropping existing tables...
            Creating table definitions...
            INFO - Creating DB schema version 95 using C:****\fecru\sql\SQLSERVER2008\schema\tables_95.sql
            1 rows written, 0 tables completed.
            422 rows written, 1 tables completed.
            425 rows written, 3 tables completed.
            426 rows written, 3 tables completed.
            ...
            ...
            ...
            Adding database constraints...
            INFO - Creating DB constraints version 95 using C:****\fecru\sql\SQLSERVER2008\schema\constraints_95.sql
            Updating database to latest version...
            Backup restored successfully.
            INFO - Shutting down cross-repo lucene index
            INFO - Shutdown in progress...
            INFO - Shutting down DB.
            INFO - *** application context closed ***

            Huseyin Tufekcilerli added a comment - I have finally found time to perform a backup & restore. Can you please tell me the way to verify my schema is now indeed using SQL Server 2012 schema? Does the following logs from the restore tool makes any sense? Restoring to: jdbc:jtds:sqlserver://*** :1433;databaseName= ****; Dropping existing tables... Creating table definitions... INFO - Creating DB schema version 95 using C:****\fecru\sql\SQLSERVER2008\schema\tables_95.sql 1 rows written, 0 tables completed. 422 rows written, 1 tables completed. 425 rows written, 3 tables completed. 426 rows written, 3 tables completed. ... ... ... Adding database constraints... INFO - Creating DB constraints version 95 using C:****\fecru\sql\SQLSERVER2008\schema\constraints_95.sql Updating database to latest version... Backup restored successfully. INFO - Shutting down cross-repo lucene index INFO - Shutdown in progress... INFO - Shutting down DB. INFO - *** application context closed ***

            huseyint1782801114,

            Thank you for confirming this worked. Sorry if this has been unclear, but you should keep type=SqlServer2005 until you restore a backup. I.e. either continue using 2005 setting, or do a backup, set 2012 and restore.
            The reason behind this is that currently your DB uses 2005 schema. If you later on upgrade to Crucible 4.1, new tables will be added using 2012 schema. In effect you will end up with an inconsistent, mixed schema.
            If, on the other hand, you keep the 2005 setting, you will keep on using old schema and new tables introduced in 4.1 will be created using 2005 schema, so your DB will stay consistent.
            The best solution, if you have some time, is to do a backup and restore. That will upgrade your existing tables to 2012 and you'll be able to forget about this at all .

            Kamil Cichy (Inactive) added a comment - huseyint1782801114 , Thank you for confirming this worked. Sorry if this has been unclear, but you should keep type=SqlServer2005 until you restore a backup. I.e. either continue using 2005 setting, or do a backup, set 2012 and restore. The reason behind this is that currently your DB uses 2005 schema. If you later on upgrade to Crucible 4.1, new tables will be added using 2012 schema. In effect you will end up with an inconsistent, mixed schema. If, on the other hand, you keep the 2005 setting, you will keep on using old schema and new tables introduced in 4.1 will be created using 2005 schema, so your DB will stay consistent. The best solution, if you have some time, is to do a backup and restore. That will upgrade your existing tables to 2012 and you'll be able to forget about this at all .

            Hello Kamil,

            Thanks for this, I have just upgraded to 4.0.4 and I can confirm that my backups are now working fine! Here are the steps I have took:

            1. Make sure database type=SqlServer2005 while I was at 4.0.3
            2. Uninstall 4.0.3
            3. Install 4.0.4
            4. Set database type=SqlServer2012
            5. Backup

            Huseyin Tufekcilerli added a comment - Hello Kamil, Thanks for this, I have just upgraded to 4.0.4 and I can confirm that my backups are now working fine! Here are the steps I have took: 1. Make sure database type=SqlServer2005 while I was at 4.0.3 2. Uninstall 4.0.3 3. Install 4.0.4 4. Set database type=SqlServer2012 5. Backup

            Kamil Cichy (Inactive) added a comment - - edited

            Hi huseyint1782801114,
            Yesterday we released 4.0.4. You can see the release notes at https://confluence.atlassian.com/pages/viewpage.action?pageId=808761308
            Please remember to set type=SqlServer2005 before you upgrade.
            Would you be so kind to confirm the backup is working once again?

            Kamil Cichy (Inactive) added a comment - - edited Hi huseyint1782801114 , Yesterday we released 4.0.4. You can see the release notes at https://confluence.atlassian.com/pages/viewpage.action?pageId=808761308 Please remember to set type=SqlServer2005 before you upgrade. Would you be so kind to confirm the backup is working once again?

            Piotr Swiecicki added a comment - - edited

            Hi huseyint1782801114,
            I believe you should rather continue with Type=SQLServer 2005 for now, as you're already running with SQL Server 2005 schema. If you switch it now you may struggle with future upgrades.

            Once this (CRUC-7702) issue fixed is released in 4.0.4, the safest way to go on would be to create a full backup of the instance (with Type=SQLServer2005) and to restore this backup file into clean database, where the Type will be set to SQL Server 2012.

            Hope that makes sense,

            Piotr Swiecicki added a comment - - edited Hi huseyint1782801114 , I believe you should rather continue with Type=SQLServer 2005 for now, as you're already running with SQL Server 2005 schema. If you switch it now you may struggle with future upgrades. Once this ( CRUC-7702 ) issue fixed is released in 4.0.4, the safest way to go on would be to create a full backup of the instance (with Type=SQLServer2005) and to restore this backup file into clean database, where the Type will be set to SQL Server 2012. Hope that makes sense,

            Thanks for the fix Kamil. About the "Updating schema" instructions, I have current switched to "Type=SQLServer 2012" from "Type=SQLServer 2005". Can I keep that or should I revert it to 2005 on while I am still on 4.0.3 and make it 2012 after 4.0.4 update?

            Huseyin Tufekcilerli added a comment - Thanks for the fix Kamil. About the "Updating schema" instructions, I have current switched to "Type=SQLServer 2012" from "Type=SQLServer 2005". Can I keep that or should I revert it to 2005 on while I am still on 4.0.3 and make it 2012 after 4.0.4 update?

            huseyint1782801114,
            We fixed the problem of not being able to backup DB that still runs on 2005 schema. Once we release 4.0.4, you'll be able to upgrade and perform a backup.

            Kamil Cichy (Inactive) added a comment - huseyint1782801114 , We fixed the problem of not being able to backup DB that still runs on 2005 schema. Once we release 4.0.4, you'll be able to upgrade and perform a backup.

            huseyint1782801114,
            I managed to reproduce your problem. It happens when you configure SQL Server as 2005, but you connect to 2008/2012. Changing config to 2012 now is not going to help, because your DB already has data in incorrect format. We're looking into possible ways out, we'll update you shortly.

            Kamil Cichy (Inactive) added a comment - huseyint1782801114 , I managed to reproduce your problem. It happens when you configure SQL Server as 2005, but you connect to 2008/2012. Changing config to 2012 now is not going to help, because your DB already has data in incorrect format. We're looking into possible ways out, we'll update you shortly.

            It is unclear to me what you mean by "we were using". Do you mean you were using a different DB version, or you had a different setting in the admin panel? I.e. did you connect to SQLServer 2012 telling Crucible it was SQLServer 2005?

            I mean, we were using Crucible with SQL Server 2005 before, then upgraded our SQL Server to 2012 some time a few years ago, but we didn't notice that the "Type" shows here SQL Server 2005. Currently, it seems, we are connecting to 2012 database whereas Crucible thinks it as 2005. Can I simply edit this type on admin and make it 2012 or do I need any migration steps?

            Also, could you please provide a listing of all files (there might be none) you have in FISHEYE_INST/lib directory? Mind you, FISHEYE_INST is where you keep FishEye/Crucible's user data (as opposed to FISHEYE_HOME, where we keep the application binaries).

            There is a single file over that directory:

            winp.x64.dll

            Huseyin Tufekcilerli added a comment - It is unclear to me what you mean by "we were using". Do you mean you were using a different DB version, or you had a different setting in the admin panel? I.e. did you connect to SQLServer 2012 telling Crucible it was SQLServer 2005? I mean, we were using Crucible with SQL Server 2005 before, then upgraded our SQL Server to 2012 some time a few years ago, but we didn't notice that the "Type" shows here SQL Server 2005. Currently, it seems, we are connecting to 2012 database whereas Crucible thinks it as 2005. Can I simply edit this type on admin and make it 2012 or do I need any migration steps? Also, could you please provide a listing of all files (there might be none) you have in FISHEYE_INST/lib directory? Mind you, FISHEYE_INST is where you keep FishEye/Crucible's user data (as opposed to FISHEYE_HOME, where we keep the application binaries). There is a single file over that directory: winp.x64.dll

            huseyint1782801114,

            Can I simply change SQL Server 2005 to SQL Server 2012? We were using 2005 previously but switched to 2012 for a while.

            It is unclear to me what you mean by "we were using". Do you mean you were using a different DB version, or you had a different setting in the admin panel? I.e. did you connect to SQLServer 2012 telling Crucible it was SQLServer 2005?

            Also, could you please provide a listing of all files (there might be none) you have in FISHEYE_INST/lib directory? Mind you, FISHEYE_INST is where you keep FishEye/Crucible's user data (as opposed to FISHEYE_HOME, where we keep the application binaries).

            Kamil Cichy (Inactive) added a comment - huseyint1782801114 , Can I simply change SQL Server 2005 to SQL Server 2012? We were using 2005 previously but switched to 2012 for a while. It is unclear to me what you mean by "we were using". Do you mean you were using a different DB version, or you had a different setting in the admin panel? I.e. did you connect to SQLServer 2012 telling Crucible it was SQLServer 2005? Also, could you please provide a listing of all files (there might be none) you have in FISHEYE_INST/lib directory? Mind you, FISHEYE_INST is where you keep FishEye/Crucible's user data (as opposed to FISHEYE_HOME , where we keep the application binaries).

              kcichy Kamil Cichy (Inactive)
              9c62c966039e Huseyin Tufekcilerli
              Affected customers:
              1 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: