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.56k stars 901 forks source link

Query Hangs #7440

Open mackenziepsilb opened 5 years ago

mackenziepsilb commented 5 years ago

Issue Type: Bug

Sometime when running queries it just sits there saying executing query and doesn't finish. I have to quit Azure Data Studio, reconnect to the SQL Server and then run the query and it works.

Azure Data Studio version: Azure Data Studio 1.11.0 (460c739a8d90bdbbde39e01abfb8ecdc278ea787, 2019-09-06T17:14:33.682Z) OS version: Darwin x64 18.7.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2700)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|2, 2, 2| |Memory (System)|16.00GB (0.47GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions: none
romanovmv commented 2 years ago

@Ben-CA 1.38.0 didn't work for me as well, please try updating to 1.39.0

Ben-CA commented 2 years ago

@romanovmv Thanks; but since at this point 1.39.0 is an insider / beta build, I'll probably hold off until it's in GA. Figured I would comment to increase the number of people reporting this issue so that it gets to production faster.

haydnlj commented 2 years ago

Insiders version 1.39.0 and 1.40.0 both appear to have corrected the hanging query issue. Will continue to use for a few days and report if any regression, but otherwise would suggest this is a great improvement, thank you!!

drethedevjs commented 2 years ago

I’m using 1.37 and haven’t had any issues. Or, at least, the hang has been drastically reduced.

On Aug 17, 2022, at 9:24 PM, haydnlj @.***> wrote:

 Insiders version 1.39.0 and 1.40.0 both appear to have corrected the hanging query issue. Will continue to use for a few days and report if any regression, but otherwise would suggest this is a great improvement, thank you!!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

erinstellato-ms commented 2 years ago

@Ben-CA @haydnlj @romanovmv @jake-carpenter @athomas-wtv @Smoovsky Thank you for your recent testing and your feedback, we greatly appreciate it.

Ben-CA commented 2 years ago

Updated to 1.39.0 today, and didn't have any problems with it hanging on queries like it used to - seems to be fixed!

romanovmv commented 2 years ago

Hi all, Unfortunately, version 1.40.0 reintroduced the issue for me. 1.39.0 was working fine.

alanrenmsft commented 2 years ago

unfortunately, we had to release a hot fix to revert the change I made due to some serious side effects. we will keep working on this issue.

romanovmv commented 2 years ago

Hi @alanrenmsft , Any chance I can find the pre-rollback 1.39.0 build somewhere? It worked fine for me without any serious side effects. Thanks!

erinstellato-ms commented 2 years ago

@romanovmv you can download from here: https://github.com/microsoft/azuredatastudio/releases

romanovmv commented 2 years ago

@erinstellato-ms I tried but the macOS ZIP link for version 1.39.0 points to the 1.39.1 build.

alanrenmsft commented 2 years ago

@romanovmv https://github.com/microsoft/azuredatastudio/releases, you can find all previous releases here, if you really want to use the 1.39.0.

romanovmv commented 2 years ago

@alanrenmsft unfortunately those links for the version 1.39.0 point to the 1.39.1 build.

alanrenmsft commented 2 years ago

@romanovmv below are the direct links.

Platform
Windows User Installer
Windows System Installer
Windows ZIP
macOS ZIP
Linux TAR.GZ
Linux RPM
Linux DEB
cg-tm commented 2 years ago

Would there be an ETA on when this issue may be fixed again? It was still happening occasionally for the last little bit but is definitely worse now. Just now had to restart like 4 times in a row just to run basic selects in the same editor window.

Don't mind rolling back if it'll be a while but thought I'd check.

Thanks!

alanrenmsft commented 2 years ago

@cg-tm there will be some improvements in Oct release (by end of October)

cg-tm commented 2 years ago

Thanks for the quick reply! I'll likely rollback if it continues to be too frustrating to deal with and wait for the october release.

DigitalDuquette commented 1 year ago

This delay is occuring on macOS, regardless of versions for me for the last few months. Screenshot 2022-11-28 at 12 08 45 PM

No open queries from my machine when checking the server (sp_WhoIsActive). I've tried to find a way to reproduce this issue consistently and can't. Restarting ADS will solve the issue. Latest update in November has not solved.

Ben-CA commented 1 year ago

Anyone know if the latest version on Windows still has this issue? I've been staying on 1.39.1 since it was such a pain in other versions.

erinstellato-ms commented 1 year ago

We are still seeing this issue with ADS 1.40.1 and have been able to recreate the behavior (or a variation of it) internally. We are currently testing different scenarios to pinpoint the underlying issue. This is an area of focus for us for the next couple releases, so please stay tuned. We greatly appreciate your patience; we are committed to getting this resolved.

jtsom commented 1 year ago

On Windows, if I try to connect to our Azure MSSql databases, through our Azure VPN, using the actual DNS and not a direct IP address, the access, when it doesn't outright fail, is extremely slow - minutes to return a simple query.

If I use an IP address, the access is quicker to respond.

DigitalDuquette commented 1 year ago

Are there any additional logs or testing examples we can pull together to help pinpoint resolution? I'm seeing the same intermittent problems on the latest insider builds as well.

DTronD commented 1 year ago

This is getting so frustrating! I've rolled back to 1.39 but the problem remains and overall its gotten to the point where I'm forced to abandon ADS for anything other than text editing, having to instead use SSMS for running queries.....which is a tool I was 95% away from up until this connection problem. I SOOOO preferred ADS for my "daily development" tool but this is killing the love. PLEASE address this issue and keep ADS focused on being a fast-to-load, stable, VSCode-based text editor and leave the bloat and complexity (and resulting bugs) to SSMS. I.e. Let ADS be the "Leatherman" tool for SQL Dev and keep SSMS alive and developing as the "Full proper toolchest" for full SQL administration, development, and performance tutning.

erinstellato-ms commented 1 year ago

@alanrenmsft - following up on the request from @DigitalDuquette...is there any information they can provide to help with diagnosing the issue?

@DTronD - I completely hear your frustration, and I apologize. We have a couple workstreams right now that are focused on improving the stability of ADS, including improving connections. You absolutely nailed what we want ADS to be in your description, and I understand that we are failing you. Can you provide more details about what version/flavor of SQL to which you are connecting? There may also be some logs that would be useful for us, hoping @alanrenmsft or @cheenamalhotra can help there.

alanrenmsft commented 1 year ago

@DTronD @DigitalDuquette , we should be able to roll out an insider release with fixes for this issue. will let you know once it is available. @caohai .

DTronD commented 1 year ago

@erinstellato-ms - Thank you for your quick follow-up. I'm so pleasantly surprised and want you to realize I don't expect you all to take time away from your work to apologize for bugs, but just want you to be aware of how things "look from the trenches" so you can focus your energy where it matters to we end-users. Also, I am glad to hear my usage of and appreciation for ADS is in your target audience. I exclusively use MSFT SQL Server and have used it since MS SQL v7.0...so I have spent probably spent a cumulation of HOURS over the decades waiting for SSMS to launch.

And since I am just a simple SQL dev, I probably have used only 5% of the functionality available entirely within SSMS itself (and only a tiny fraction inside of the supporting tools such as the Profiler or DBCC). So having the MUCH more robust text editing and file/folder management in ADS (thank you, Monaco/VSCode!) with a super quick launch was PERFECT for my needs....and the icing on the cake was the ability to fine-tune/tweak the user interface to my liking. PLEASE keep that focus in mind. I'm worried the launch time seems to be getting slower (but nowhere like SSMS) as more features seem to be shoved into ADS. I'd prefer the architecture be more focused on keeping ADS "slim/core" and extend functionality via plug-ins. Easier said than done, I know.

As for current SQL versions I use: Azure SQL Database (mostly basic tier and S0 or S1 instances) & SQL Server 2017 which is typically on-prem or a developer install on my laptop, but as of late I've been working mostly with an Azure Virtual Machine running SQL Server 2016 (SP3-GDR) (KB5014355) - 13.0.6419.1 (X64) in a client's tenancy that I connect to via Azure VPN client. This tenancy-hosted SQL Server has been where my frustration with ADS hanging-queries & connection issues has been growing the most over the last few months. My connections to an AZure SQL DB seem much less likely to hang, though I do get funky connection errors about the same on both targets.

Note that that VPN connection to my customer's tenancy has been very stable...it rarely disconnects over the course of hours or days. But based on the last few days, it seems like the use of ADS within the tenancy as opposed to from my machine over VPN into the SQL server is much more stable. I have yet to have a hung query there. It might be premature to say that or it might be a red herring. That remote instance of ADS is 1.41, BTW. I.e. the version that I most recently got rid of on my laptop and replaced with 1.39.1 which didn't improve anything.

I'm glad to provide any logs, too. @alanrenmsft

Thank you for such a great product and listening to our frustrations about the current degradation in an otherwise awesome tool.

alanrenmsft commented 1 year ago

@DTronD @DigitalDuquette Folks, we made some improvements, and the change is in the latest insiders build. We need your help to test it out as early as possible so that we have time to fix any unexpected issues before the next stable release. Really appreciate the help and looking forward to feedback.

The setting I mentioned in https://github.com/microsoft/azuredatastudio/issues/7440#issuecomment-1148069779 still needs to be enabled.

@caohai FYI.

DigitalDuquette commented 1 year ago

Updated and enabled, any specific logs I should turn on to help capture issues?

alanrenmsft commented 1 year ago

@DigitalDuquette are you still having the query hang issue with latest insider build? I am going to add a label to the issue and then the bot will automatically add instructions on how to collect logs.

Also, if you have a consistent way of reproducing the problem, please share the query/repro steps with me.

Thanks!

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

DTronD commented 1 year ago

@alanrenmsft ...Per your requests for logs:

Scenario logged:
1) Launch ADS-i 2) connect to VM running SQL server in an Azure tenancy and run query from tab/file open from prior ADS-i session. Results return right away. 3) Open new tab with CTRL-N and connect to same server/DB 4) Open new tab with CRRL-N and connect to same server/DB. 5) Run query and wait for > 15 seconds while countdown clock stays stuck at 00:00. 6) Results returned.

I did some some "Connection Error" popups during some of the "Connect to same server/DB" sub-steps but that may not be the same thing as the "hanging query" issue, plus I can't be sure I'd accurately describe which connection method I used (e.g. a connection from the Recent connections pane versus picking the same endpoint from the Saved connections pane). This connection error has happened so much over the last few months that once I discovered that I could get around it with using an alternate method, I kinda just blow throw the options without thinking. Sorry.

Also, I realize that the 15 second delay may not be a fully stuck/hung like I and others have reported in the past....but this is all I gotz for your so far. ADS_Items_for_Issue4770.zip

DigitalDuquette commented 1 year ago

I'm having the issue again where it hangs. Attached logs per documentation. logs.zip console.log

alanrenmsft commented 1 year ago

@DigitalDuquette just to confirm, you have the setting enabled and restarted ADS, right?

DigitalDuquette commented 1 year ago

Yes, setting enabled and restarted. I see there is another insider build, just updated to that as well.

Screenshot 2022-12-16 at 12 52 00 PM
DigitalDuquette commented 1 year ago

Had it happen again with the latest version I posted above.

Screenshot 2022-12-16 at 12 59 20 PM
DigitalDuquette commented 1 year ago

Updated with the latest insiders version today. I see this error message each time the timeout occurs. Screenshot 2022-12-19 at 10 27 04 AM 20221219T093655.zip

nihirisuto commented 1 year ago

Ah wow I thought this was just me having a crappy unstable VPN connection or something. Spun up SSMS in parallels and realized it was Azure Data Studio. Always works fine initially then after a few query runs I have to restart it.

I want to help troubleshoot here, but want to be wary of sensitive data coming through the logs I might share. Before I go down this road can anyone confirm if any sensitive data makes it into the zip of logs

DTronD commented 1 year ago

@chris-larsen - Yeah, welcome to the club of "It must be my fault so I'll spend hours troubleshooting in the wrong places." I feel y(our) pain. :-)

AS for log contents.....I looked at each file included in my uploaded "logs" and I ended up obfuscating references to parts of file paths and query/file names that would reveal identifying data (e.g. company name) but can't promise I caught everything as I just did a quick scan through the items. It's possible I missed something more dangerous (e.g. login/pwds ) but was operating with some trust that Alan (MSFT) wouldn't ask for us to post dangerous items to a public site. But YMMV. Or...

"Trust but verify." President Ronald Reagan.

:-)

P.S. Please don't take my joking the wrong way. The more people who help with MSFT's troubleshooting, the sooner the underlying bug gets hunted and killed. I appreciate EVERYBODY who is trying to return ADS to stability. I miss it so much.

erinstellato-ms commented 1 year ago

@DigitalDuquette Thanks for the additional info!

@chris-larsen Not just you, but if you would like to provide any logs to help us diagnose the issue, that would be great. As @DTronD recommended, feel free to review the logs to verify there is no sensitive data in them. While we do not go out of our way to collect sensitive information, it's possible that what one company deems sensitive (e.g. computer name, IP address) is different from another company's definition.

Again, we really appreciate any help you can provide. And please know that @alanrenmsft is out of the office this week and next, so apologies for any delays (but vacation and time with families is important - and I hope that you all have a wonderful end of year and holiday). Thank you.

nihirisuto commented 1 year ago

@erinstellato-ms thanks for the detailed reply, if I can find some time today/tomo while Alan is out I'll try and capture some logs here.

In the interim, something I'm speculating about is... I've had tons of company VPN-related issues due to how DNS resolution is handled on MacOS with the upgrade to Ventura. It essentially boils down to whether or not the company-related top level domains exist in public domain tables (cloudflare/googles 1.1.1.1/8.8.8.8 tables) and if they do, it'll ignore the VPN profile configuration to point to the company nameserver and instead defaults to a public nameserver. This is in regards to the way Apple is attempting to improve their DNSSEC since DNS Resolution can easily be taken advantage of. I have workaround scripts for now that essentially write DNS Resolutions for host names -> internal enterprise IP addresses to my host file.

Now I see no reason why this in particular has anything to do with Azure Data Studio, but my hunch is that there's something up with Ventura itself that is intermittently dorking with something Azure Data Studio looks at for connections. If for whatever reason Azure Data Studio looks at /etc/resolv.conf that's going to be a major issue on Ventura as this file is now only used as a fallback by MacOS when a TLD doesn't exist in public nametables (Apple actually has a big fat comment about it in the file itself). The VPN DNS Resolution issues I had above are discussed around on reddit/some google groups for people running into the same issue, but I haven't seen anything directly addressed or fixed from Apple. I think this issue started in MacOS 12.6 montery and on, and is very visibile in MacOS ventura. I can at least confirm the latest release of Azure Data Studio worked fine for me prior to my upgrade to Ventura when I was on 12.1 Montery. I can't comment on whether or not other folks having this issue are also on the latest MacOS.

I went ahead and downgraded/tested older versions of Azure Data Studio (1.37-1.38) that I know worked back when I was on MacOS 12.1 Montery just to see if the issue persisted and it did, and that leads me to believe this could be an OS related issue (which I'd love to help track down, I feel handicapped without Azure Data Studio and my beloved snippets). Possibly not the issue at all, but maybe a good place to dive in.

Ben-CA commented 1 year ago

@chris-larsen - I'm not saying that's not the issue for you; but I'm on Windows 10, and in my case the server has a 192.168.. IP, so shouldn't have anything to do with public domain tables. (I am also accessing the SQL server through a VPN - but it's been working decently on Azure Data Studio 1.39.1, and also works fine with MS SQL Management Studio. Occasionally I still get lag, but I haven't had to close and restart ADS like I did often with 1.38.0 - to the point I mostly used MSSQLMS instead.)

nihirisuto commented 1 year ago

@Ben-CA ah that's good to know then. I'll leave the post up just for anyone who comes wandering but sounds like it's not relegated to an OS issue then.

DTronD commented 1 year ago

I say "ditto" to @Ben-CA. Pretty much where I am though targeting 10.0.... IP for what little that matters (probably zero). Oh, I'm still using the 1.41.0-Insiders release of VSC. I.e. not really seeing any hanging queries that force restarts but still commonly get "lagginess."

nihirisuto commented 1 year ago

Was playing around with this and rather than impatiently closing out and restarting I tried doing a disconnect/reconnect to my db connection and letting it hang. Got this:

Execution failed due to an unexpected error: 
    Cannot connect to the database due to invalid OwnerUri (Parameter 'OwnerUri')

When I restart ADS I can connect up just fine.

DigitalDuquette commented 1 year ago

When connections start failing I also see this error: Screenshot 2023-01-06 at 12 48 18 PM

DevTools failed to load source map: Could not load content for https://sqlopsbuilds.blob.core.windows.net/sourcemaps/88ab7947a4957b89072da33270afd1b4e7022506/node_modules/@vscode/vscode-languagedetection/dist/lib/index.js.map: Fetch through target failed: Target not supported; Fallback: Unknown error
DevTools failed to load source map: Could not load content for https://sqlopsbuilds.blob.core.windows.net/sourcemaps/88ab7947a4957b89072da33270afd1b4e7022506/core/vs/workbench/workbench.desktop.main.js.map: Load canceled due to load timeout
cg-tm commented 1 year ago

Seems like this problem has gotten worse with the latest non-inside update (1.40.2). I see other comments about a VPN does this have an impact? We operate through a VPN using Azure VPN connect (windows 11). This was with the setting mentioned here enabled: https://github.com/microsoft/azuredatastudio/issues/7440#issuecomment-1148069779

I've tried disabling it now to see if it makes a difference, or should I only be using the insiders build if I'm getting this issue (maybe it was wrong to assume the next stable release included all the insiders changes previously discussed here)

nihirisuto commented 1 year ago

Let it hang again until I got this

image

This is the "full cycle" of when something starts to hang if I try to create a new connection tab. Going to try and recreate this in the morning and attach the log zip.

anjode commented 1 year ago

Have any work arounds been identified for this issue?

erinstellato-ms commented 1 year ago

@anjode Are you still experiencing the problem in the latest release (1.41.2)? If so, could you possibly try to the latest 1.42 Insider build? Per @alanrenmsft's notes in https://github.com/microsoft/azuredatastudio/issues/22044, this issue should be resolved.

anjode commented 1 year ago

@erinstellato-ms Yes, I just upgraded to 1.41.2 and it's no different than the previous version.