Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema Compare Apply fails with an error #22957

Open
tecodan opened this issue May 4, 2023 · 7 comments
Open

Schema Compare Apply fails with an error #22957

tecodan opened this issue May 4, 2023 · 7 comments
Labels
Area - Schema Compare Bug Pri: 2 Size: M For a medium complexity issue - only when fixed with a PR Triage: Done
Milestone

Comments

@tecodan
Copy link

tecodan commented May 4, 2023

Issue Type: Bug

After selecting 'Apply', the following error is produced:
"Apply schema compare changes failed....Error: index and length must refer to a location within the string. (Parameter 'length')"

I'm using DB as source, and SQL Project as target. Error seems to occur on 'Change' actions, and specifically on SqlProcedure types.

After some testing, it seems this issue occurs when the Target (in my SQL Project) is ~66kb or larger, and the Source (Proc in the DB) could be any size.

Anything less than ~66kb is OK, anything greater than ~66kb results in an error.

Applying changes in an older version of the Schema Compare tool (< Nov 2022 version) had no problems with large Stored procs.

Extension version: 1.18.0
Azure Data Studio version: azuredatastudio 1.42.0 (22f384e, 2023-03-17T18:15:48.982Z)
OS version: Windows_NT x64 10.0.17763
Restricted Mode: No
Preview Features: Enabled

System Info
Item Value
CPUs Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (4 x 2793)
GPU Status 2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
Load (avg) undefined
Memory (System) 16.00GB (1.66GB free)
Process Argv
Screen Reader no
VM 0%
@tecodan
Copy link
Author

tecodan commented May 4, 2023

You can use the following large target proc as an example, but anything ~68kb or larger can be used to replicate the issue.
target_proc_big.txt

@kisantia kisantia added this to the July 2023 Release milestone May 10, 2023
@kisantia kisantia added Pri: 2 Size: M For a medium complexity issue - only when fixed with a PR and removed Triage: Needed labels May 10, 2023
@kisantia kisantia self-assigned this May 10, 2023
@kisantia kisantia removed their assignment Aug 17, 2023
@tecodan
Copy link
Author

tecodan commented Sep 18, 2023

Hi, I have tried the Insiders release (1.47.0-insider) using the SQL Database Projects (v1.3.1) and Schema Compare (v1.21.0) extensions and the problem still exists.

Any ETA on the fix?
This is an issue for us as we have a few large procs and it means we need to continue using a much older release and this is becoming a problem for us.

Some additional logging info (exthost.log) when this occurs (after selecting the Apply button):

23-09-18 15:55:37.9422880 pid:13356 tid:12 sqltools Verbose: 0 : Sending message of id[], of type[Event] and method[tasks/newtaskcreated]
23-09-18 15:55:37.9468910 pid:13356 tid:12 sqltools Verbose: 0 : Sending message of id[], of type[Event] and method[tasks/statuschanged]
23-09-18 15:55:37.9496461 pid:13356 tid:12 sqltools Verbose: 0 : Sending message of id[], of type[Event] and method[tasks/statuschanged]
23-09-18 15:55:37.9504138 pid:13356 tid:12 sqltools Verbose: 0 : Sending message of id[], of type[Event] and method[tasks/statuschanged]
23-09-18 15:55:38.0352090 pid:13356 tid:16 sqltools Error: 0 : Schema compare publish project changes operation  failed with exception Index and length must refer to a location within the string. (Parameter 'length')
23-09-18 15:55:38.0378010 pid:13356 tid:12 sqltools Verbose: 0 : Sending message of id[], of type[Event] and method[tasks/statuschanged]
23-09-18 15:55:38.0386179 pid:13356 tid:12 sqltools Verbose: 0 : Sending message of id[], of type[Event] and method[tasks/statuschanged]
23-09-18 15:55:38.0406389 pid:13356 tid:12 sqltools Verbose: 0 : Sending message of id[1456], of type[Response] and method[schemaCompare/publishProject]
23-09-18 15:55:38.0413372 pid:13356 tid:12 sqltools Verbose: 0 : Finished processing message with id[1456], of type[Request] and method[schemaCompare/publishProject]

@SakshiS-harma
Copy link
Contributor

@tecodan I acknowledge the critical nature of this issue and its impact on your daily operations. We are working to prioritize and schedule this fix.
Thank you!

@aprilrains
Copy link

Any update on this - I end up applying most of my changes manually to get around this issue.

@ChrisPalmerNZ
Copy link

ChrisPalmerNZ commented Mar 6, 2024

I am also having this problem, with schema compare v1.21.0, is there a way to install a previous version of schema compare that works? I am using this on Windows with ADS 1.48.0. I have tried downgrading ADS to 1.47.1, but the problem remains.

My colleague is running ADS 1.47.0 and schema compare 1.21.0 on Linux, and he does not get the problem. Could it be related to underlying C libraries, with differences between Windows and Linux? Are any users reporting this using Linux?

@tecodan
Copy link
Author

tecodan commented Mar 6, 2024

I have all but given up on this tool and have moved over to use the Schema Compare tool in the ever-bloated VS2022

@sev-palmer
Copy link

I have the same issue. Odd that it hasn't been resolved yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - Schema Compare Bug Pri: 2 Size: M For a medium complexity issue - only when fixed with a PR Triage: Done
Projects
None yet
Development

No branches or pull requests

8 participants