microsoft / DacFx

SQL Server database schema validation, deployment, and upgrade runtime. Enables declarative database development and database portability across SQL Server versions and environments.
https://aka.ms/sqlpackage-ref
MIT License
296 stars 16 forks source link

Schema Compare failed: Unexpected exception ...: Unable to cast object of type 'System.Boolean' to type 'System.Int32'. #348

Open SakshiS-harma opened 9 months ago

SakshiS-harma commented 9 months ago

This bug was first reported on ADS platform. But after an initial triage and testing, it seems to be an issue emanating from the DacFx side of the code. ** copy of the original bug https://github.com/microsoft/azuredatastudio/issues/24551

I am trying to compare schemas. Loading the servers as Source and destination Yields:

Schema Compare failed: Unexpected exception caught during population of target model: Unable to cast object of type 'System.Boolean' to type 'System.Int32'. Unexpected exception caught during population of source model: Unable to cast object of type 'System.Boolean' to type 'System.Int32'.

Note:

SakshiS-harma commented 9 months ago
SakshiS-harma commented 9 months ago

@pgeorge-redmond Created this issue for DacFx folks to look at. Thanks!

llali commented 9 months ago

@pgeorge-redmond we would need the scripts of the databases to be able to repro the issue. can you please share the dacpacs for the databases?

pgeorge-redmond commented 9 months ago

DB DacPac.zip

Files provided

pgeorge-redmond commented 9 months ago

Posted in github.

P-

From: Leila Lali @.> Sent: Thursday, October 5, 2023 9:27 AM To: microsoft/DacFx @.> Cc: Peter George @.>; Mention @.> Subject: Re: [microsoft/DacFx] Schema Compare failed: Unexpected exception ...: Unable to cast object of type 'System.Boolean' to type 'System.Int32'. (Issue #348)

External Email Warning! Use caution before clicking links or opening attachments.

@pgeorge-redmondhttps://github.com/pgeorge-redmond we would need the scripts of the databases to be able to repro the issue. can you please share the dacpacs for the databases?

- Reply to this email directly, view it on GitHubhttps://github.com/microsoft/DacFx/issues/348#issuecomment-1749264870, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BC5UZ2LG7VCT3XIQW27Q4E3X53NWBAVCNFSM6AAAAAA5TENKWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBZGI3DIOBXGA. You are receiving this because you were mentioned.Message ID: @.**@.>>

SakshiS-harma commented 9 months ago

@pgeorge-redmond Did you get any stack trace while hitting this error? Also, we need more info to debug this particular issue, since it is not easily reproducible. If you could attach your logs to the issue (ensure no private data is in them), it would help us fix the issue much faster.

  1. First open the Settings page, find the Mssql: Tracing Level setting and change that to All then restart Azure Data Studio.
  2. Open command palette (Click View -> Command Palette) and run the command Developer: Set Log Level... and set the level to Trace.
  3. Run the repro scenarios.
  4. Collect the following logs: Console Logs

Application Logs

  1. Now you can revert the Log/Tracing levels changes made in step 1 and step 2.