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

Database connection toolbar missing for sql scripts #16436

Closed
timgaunt opened this issue Jul 26, 2021 · 39 comments · Fixed by #16442
Closed

Database connection toolbar missing for sql scripts #16436

timgaunt opened this issue Jul 26, 2021 · 39 comments · Fixed by #16442

Comments

@timgaunt
Copy link

  • Azure Data Studio Version: Version: 1.31.0 Commit: a430fd2
  • OS Version: MacOS Big Sur 11.5

Steps to Reproduce:

  1. Open a SQL script
  2. Try to connect to a database using the toolbar

Actual

2021-07-26_06-05-31 (17)

Expected

2021-07-26_06-06-50

Does this issue occur when all extensions are disabled?: Yes

@Charles-Gagnon
Copy link
Contributor

How are you opening the file? (command line, file -> open, other?)

If you aren't opening it via file -> open, does the issue still repro when closing it and re-opening with file -> open?

@timgaunt
Copy link
Author

How are you opening the file? (command line, file -> open, other?)

⌘+O keyboard shortcut

If you aren't opening it via file -> open, does the issue still repro when closing it and re-opening with file -> open?

It does yes.

Interestingly, files which were open before the update are still showing the menu.

@github-actions
Copy link

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.

There are two types of logs to collect:

Console Logs

  • Open Developer Tools (Help -> Toggle Developer Tools)
  • Click the Console tab
  • Click in the log area and select all text (CTRL+A)
  • Save this text into a file named console.log and attach it to this issue.

Application Logs

  • Open command palette (Click View -> Command Palette)
  • Run the command: Developer: Open Logs Folder
  • This will open the log folder locally. Please zip up this folder and attach it to the issue.

@Charles-Gagnon
Copy link
Contributor

Hm, well I was able to repro this behavior a couple times myself but now it seems to be working as expected....

Could you try :

  1. Opening the .sql file
  2. Closing ADS
  3. Re-opening ADS

Does the editor still show without the toolbar?

@Charles-Gagnon
Copy link
Contributor

For anyone else hitting this issue, could you please provide the following information :

  1. Does this happen even after ADS has been opened for a while?
  2. If you close the file and then close and re-open ADS does it still show without the toolbar?

@jesman3
Copy link

jesman3 commented Jul 26, 2021

To answer your 2 questions. Yes it happens even after ADS has been opened for while. I have had it opened for several hours and it is still happening.

Yes if i close the file and then close ADS and re-open it still shows without the toolbar.

I added the screen shots showing a new query window which has the toolbar until I save the file and as you can see in the second screen shot the toolbar is gone.
New Query window before save
New Query window after save

@Charles-Gagnon
Copy link
Contributor

@jesman3 Could you try :

  1. Closing the file
  2. Closing ADS
  3. Deleting the %APPDATA%\azuredatastudio\Cache folder (this won't affect any saved connections or user settings)
  4. Restarting ADS and re-opening the file

@timgaunt
Copy link
Author

@Charles-Gagnon same for me, it's the same even if I've restarted the Mac.

Where are the cache files stored on a Mac and I'll give that a go

@jesman3
Copy link

jesman3 commented Jul 26, 2021

@Charles-Gagnon
I followed steps 1 through 4 and the issue did not go away.

@Charles-Gagnon
Copy link
Contributor

@timgaunt You can get to this by running the Developer: Open Logs Folder command and then going up 2 directories

@jesman3 What type of installation do you have? (User, System, zip). And how are you opening the file? File -> Open (Ctrl+O) or something else?

@timgaunt
Copy link
Author

@Charles-Gagnon it seems happier now but I'll let you know if it continues to be an issue tomorrow

@jesman3
Copy link

jesman3 commented Jul 26, 2021

@Charles-Gagnon I believe it is a User installation but I am not sure. I can duplicate this by opening any .sql file as it will not have the connection toolbar and I cannot seem to figure out how to get the .sql file to connect to a database.
I open it with File -> Open or even with File -> Open Recent. Either way duplicates the issue. Another way to duplicate the issue is to select File -> New Query which will open a new query WITH the toolbar visible then if you save that query via File -> Save the toolbar immediately disappears.

@jesman3
Copy link

jesman3 commented Jul 26, 2021

@Charles-Gagnon One other note is that I download a pre-release version of Azure Data Studio about a month ago to test for a bug fix regarding an array slice error and I noticed this same SQL toolbar behavior in the pre-release version but I didn't think too much of it as I was just testing the array slice error. I still have that pre-release version installed but I don't use it. Also, my co-workers who still have version 1.30 are not experiencing this issue.

@Charles-Gagnon
Copy link
Contributor

Thanks for the confirmation @timgaunt - my understanding of the issue is that as long as your cache isn't cleared this issue shouldn't happen for you anymore. But definitely let me know if that's not the case.

@jesman3 The Help -> About window will have that information

image

Can you get me your logs per these instructions? It's unclear why your instance is behaving differently than mine during my testing and that might have something useful in it

Log Collection Instructions

There are two types of logs to collect:

Console Logs

Open Developer Tools (Help -> Toggle Developer Tools)
Click the Console tab
Click in the log area and select all text (CTRL+A)
Save this text into a file named console.log and attach it to this issue.
Application Logs

Open command palette (Click View -> Command Palette)
Run the command: Developer: Open Logs Folder
This will open the log folder locally. Please zip up this folder and attach it to the issue.

@Charles-Gagnon
Copy link
Contributor

@jesman3 If you get a chance could you try out this private build to see if it resolves your issue?

https://sqltools.blob.core.windows.net/public/azuredatastudio-win32-x64.zip

Just unzip that and run the azuredatastudio-insiders.exe found inside the extracted folder.

@dot-fs
Copy link

dot-fs commented Jul 27, 2021

I have the exact same symptoms as @jesman3, I use the user setup version.
None of the suggestions helped for me, either.

The insider build you have provided does indeed fix the issue for me (the offending .sql files have to be reopened though)

@jesman3
Copy link

jesman3 commented Jul 27, 2021

@Charles-Gagnon I did not have the same luck as @dot-fs the insiders version did not resolve the issue. I have attached a gif showing the easiest flow to duplicate the issue. The only thing I notice is that the language on the status bar at the bottom changes from MSSQL when the toolbar is visible to SQL when the toolbar is not visible.
ADS-SQLIssue

@dot-fs
Copy link

dot-fs commented Jul 27, 2021

Interestingly, just using the insider build seems to have fixed the installed version for me.
Files saved while the issue was present have to be reopened (and maybe re-saved, i did that) but I can't reproduce the issue anymore (in any of the two builds).

@jesman3
Copy link

jesman3 commented Jul 27, 2021

FYI, I finally just did a full uninstall and re-install and everything is working fine in version 1.31. Sorry you have one less test subject now. Thanks for your help!!!

@Charles-Gagnon
Copy link
Contributor

Thanks for letting me know @jesman3! There definitely seems to be some sort of caching issue, if anyone else tries uninstalling/reinstalling and is still seeing this issue then please let me know.

We'll have a hotfix out for fixing some of the other issues that people are seeing with this, but the suggestions above in this thread should mostly resolve any problems people are running in to currently with my current understanding of the specific issues being hit here.

@TunnyF24
Copy link

TunnyF24 commented Jul 27, 2021

@jesman3 If you get a chance could you try out this private build to see if it resolves your issue?

https://sqltools.blob.core.windows.net/public/azuredatastudio-win32-x64.zip

Just unzip that and run the azuredatastudio-insiders.exe found inside the extracted folder.

This has also fixed my issue.

The other problem that I experienced at the same time (and still with this fix) is any of my old saved templates stopped being recognised as queries and were opening as text pages. (they didn't have .sql as their file type but worked fine)

When you create 'new file' from within explorer it's creating a 'Plain Text' page, where as before this would open anew query.

image

after creating this, if you then change the language type to SQL from plain text, it then locks the page and you can't type anything.

image

If you then rename the page to include the .sql file extension at the end, close it and re open it, it displays as it should
image

@Charles-Gagnon
Copy link
Contributor

@TunnyF24 That's expected behavior - we recognize things as queries based on their file extension and so if they don't have a .sql extension then they'll just open as plain text. So when creating a new file make sure to add the .sql extension to the end (or add it later and close/reopen as you found out)

Changing the language mode doesn't change the editor - so a text editor set to the SQL language will not be displayed as a query editor. It's something we'd like to fix at some point - but I believe this has always been the behavior for files originally opened as text files.

@emilhizer
Copy link

Having this same issue on Mac. Tried uninstall / reinstall. SQL files open as plain text files (no connection toolbar available). I see the private build available for Windows, but any love for us Mac users? Quick fix is open .SQL file (has no connection toolbar), open new tab (has toolbar by default), copy/paste script from .SQL tab to new tab. Only started having this problem a couple of days ago - an issue with the new build/release on 7/21???

From About ADS:
Version: 1.31.0
Commit: a430fd2
Date: 2021-07-20T19:49:59.277Z
VS Code: 1.56.0
Electron: 12.0.7
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Darwin x64 20.5.0

@Charles-Gagnon
Copy link
Contributor

Charles-Gagnon commented Jul 28, 2021

@emilhizer The latest insiders build has the fix for this. Let us know if that still doesn't solve your issue. (Note that you will still likely need to close and re-open any documents that were persisted after the update)

We'll be releasing a hotfix for this in the next day or two for the stable version.

@emilhizer
Copy link

Thanks @Charles-Gagnon - works perfectly. And thanks for the direct link to the insiders build.

@Charles-Gagnon
Copy link
Contributor

The stable hotfix for this issue has gone out - please update to 1.31.1 and if you're still seeing issues let me know!

@Charles-Gagnon Charles-Gagnon unpinned this issue Jul 29, 2021
@MangoZMR
Copy link

MangoZMR commented Aug 3, 2021

i have upgraded to 1.31.1 but still have the same issue:
image
image

@Charles-Gagnon
Copy link
Contributor

Did you close and re-open the tabs?

If that still isn't working try this :

  1. Close all the tabs currently open
  2. Run the Developer: Open Logs Folder command
  3. Go up two directories to the azuredatastudio directory
  4. Close ADS
  5. Delete the Cache folder
  6. Restart ADS and open up the editors again

@MangoZMR
Copy link

MangoZMR commented Aug 3, 2021

I tried it but it doesn't work.

@Charles-Gagnon
Copy link
Contributor

Tried what? Both options? Some people also said that they had to uninstall and reinstall to get it to pick up the fix properly - so would be worth trying that if you're able.

Otherwise could you list the exact steps you're taking to open this file?

@MangoZMR
Copy link

MangoZMR commented Aug 3, 2021

I tried the steps that you show above to delete the Cache folder, and it does not work. Below is showing how I open the file:

AzureGIF

@Charles-Gagnon
Copy link
Contributor

Could you

  1. Download https://sqltools.blob.core.windows.net/public/azuredatastudio-win32-x64.zip
  2. Unzip the archive
  3. Run azuredatastudio.exe from the extracted folder
  4. Repro the issue (closing the file and then re-opening if it's already open)
  5. Collect the two types of logs detailed below

Log Collection Instructions

There are two types of logs to collect:

Console Logs

Open Developer Tools (Help -> Toggle Developer Tools)
Click the Console tab
Click in the log area and select all text (CTRL+A)
Save this text into a file named console.log
Application Logs

Open command palette (Click View -> Command Palette)
Run the command: Developer: Open Logs Folder
This will open the log folder locally. Please zip up this folder

Upload both sets of logs to this issue.

@MangoZMR
Copy link

MangoZMR commented Aug 5, 2021

Could you

  1. Download https://sqltools.blob.core.windows.net/public/azuredatastudio-win32-x64.zip
  2. Unzip the archive
  3. Run azuredatastudio.exe from the extracted folder
  4. Repro the issue (closing the file and then re-opening if it's already open)
  5. Collect the two types of logs detailed below

Log Collection Instructions

There are two types of logs to collect:

Console Logs

Open Developer Tools (Help -> Toggle Developer Tools)
Click the Console tab
Click in the log area and select all text (CTRL+A)
Save this text into a file named console.log
Application Logs

Open command palette (Click View -> Command Palette)
Run the command: Developer: Open Logs Folder
This will open the log folder locally. Please zip up this folder

Upload both sets of logs to this issue.

@Charles-Gagnon Thank you, please see the files below:
<removed>

@Charles-Gagnon
Copy link
Contributor

Thanks! Unfortunately that still wasn't enough to figure out what was going on here - I uploaded a new version with even more logging. So if you could download that and follow the same steps I'd appreciate that!

Link is the same : https://sqltools.blob.core.windows.net/public/azuredatastudio-win32-x64.zip

(also I removed the logs from your message since I no longer need them)

@MangoZMR
Copy link

MangoZMR commented Nov 5, 2021

@Charles-Gagnon Hi I have upgraded my ADS to version 1.33.1, but the issue is still there. Would you please help?
image

@Charles-Gagnon
Copy link
Contributor

@MangoZMR Does this continue to happen even if you close the query and open a new one?

@MangoZMR
Copy link

MangoZMR commented Nov 5, 2021

@Charles-Gagnon There is no toolbar even I close the query and open a new one. Thank you.

@Charles-Gagnon
Copy link
Contributor

Alright, here's another private build with additional logging if you don't mind trying it out

  1. Download https://sqltools.blob.core.windows.net/public/editor-issue/azuredatastudio-win32-x64.zip
  2. Unzip the archive
  3. Run azuredatastudio.exe from the extracted folder
  4. Repro the issue (closing the editor and then re-opening if it's already open)
  5. Collect the two types of logs detailed below

Log Collection Instructions

There are two types of logs to collect:

Console Logs

Open Developer Tools (Help -> Toggle Developer Tools)
Click the Console tab
Click in the log area and select all text (CTRL+A)
Save this text into a file named console.log

Application Logs

Open command palette (Click View -> Command Palette)
Run the command: Developer: Open Logs Folder
This will open the log folder locally. Please zip up this folder

E-mail me the logs (chgagnon@microsoft.com) or upload them to this issue

@cipinistor
Copy link

I'll leave this here, maybe it will help somebody.
The only way to fix this for me was to delete the folder ~/Library/Application Support/azuredatastudio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment