microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.59k stars 908 forks source link

Failed to generate select script for the selected object. #22872

Closed tanmoycuat closed 1 year ago

tanmoycuat commented 1 year ago

Issue Type: Bug

Right click on Azure data Studio. Right click on Table script to slelect top 1000 rows and it throws error " "Failed to generate select script for the selected object.""

Azure Data Studio version: azuredatastudio 1.43.0 (b790d700898b1095d83e62f0de14678a58222520, 2023-04-10T23:14:27.236Z) OS version: Windows_NT x64 10.0.19045 Restricted Mode: No Preview Features: Enabled

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 x 2803)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|31.73GB (14.70GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (6) Extension|Author (truncated)|Version ---|---|--- agent|Mic|0.49.0 import|Mic|1.5.4 kusto|Mic|0.5.8 profiler|Mic|0.12.2 schema-compare|Mic|1.18.0 azdata-sanddance|msr|4.0.3
github-actions[bot] commented 1 year ago

We need more info to debug your particular issue. 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. First open the Settings page, find the Mssql: Tracing Level setting and change that to All then restart ADS and repro your issue. Next there are two types of logs to collect:

Console Logs

cheenamalhotra commented 1 year ago

Hi @tanmoycuat

Can you capture 'Verbose' logs (MSSQL) when this error occurs and upload them here for investigation?

SaschaProdware commented 1 year ago

I have this Issue from time to time too. After a restart it is away. But comes again after a while.

INFO Successfully added connection connection:providerName:MSSQL|applicationName:azdata|authenticationType:AzureMFA|database:|server:synw-xxx-xxxdwh-dev-ondemand.sql.azuresynapse.net|user:Müller, Firstname(Secret GmbH) - firstname.mueller@secret.com|group:C-GUI-8 2log.ts:313 ERR Scripting failed. error: An error occurred while scripting the objects. Failed to connect to server synw-xxx-xxxdwh-dev-ondemand.sql.azuresynapse.net. DevTools failed to load source map: Could not load content for https://sqlopsbuilds.blob.core.windows.net/sourcemaps/b790dshortendbyme22520/node_modules/@vscode/vscode-languagedetection/dist/lib/index.js.map: Fetch through target failed: Target not supported; Fallback: Unknown error

I can't add the whole log folder as I am uncertain if there is sensitive Data included. But maybe this helps already or someone could advise me where to look deeper...

teodor-io commented 1 year ago

If it helps others: in my case I fixed it by adding my external IP address to whitelist.

cheenamalhotra commented 1 year ago

ERR Scripting failed. error: An error occurred while scripting the objects. Failed to connect to server synw-xxx-xxxdwh-dev-ondemand.sql.azuresynapse.net.

@SaschaProdware This seems like an issue you're facing where server connection could not be made. With support of connection pooling (enabled by default), this should not occur now. I will close this issue, and if it occurs again, let us know.