-
Notifications
You must be signed in to change notification settings - Fork 912
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
Unable to view tables in the dropdown #21245
Comments
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. Console Logs
|
@Naval01 , can you please follow those steps and add logs? |
I am on MacOS (Monterey 12.3.1) and encountering the same issue after the latest update. Repro scenario:
I can view the table names on the management screen (welcome screen) but there is no dropdown on the server name as the server name still has red dot instead of green dot. Thanks! |
@aasimkhan30 - Is there any update on this ticket? ADS has been an important part of my daily routine and I am still experiencing the issue mentioned above. Thank you for your time. |
@aparkhills,I am sorry to hear that. Your error seems to be different than this issue. Make sure you are enabling trust server certificates. Please let me know if that fixes your issue. |
@aasimkhan30 @aparkhills Your issue is likely this one some other people have also hit : #20192, please follow up with @cheenamalhotra on that issue to try and help figure out what's going on with that error |
@cheenamalhotra We may want to look at the logic for displaying the trust server certificate here - it seems like it shouldn't have been shown in that case (since my understanding from looking at the other issue thread is that this problem is some other internal issue and not likely to be fixed by setting trust server certificate to true). |
@aasimkhan30 @Charles-Gagnon @cheenamalhotra - @aasimkhan30's comment above fixed my issue permanently. No more connection or TCP error message. Thank y'all! |
@Charles-Gagnon @cheenamalhotra it seems that enable trust certificate in the error dialog did not function properly. Is that a known issue? |
I am seeing the same problem as @Naval01. I have did what the github bot suggested to do and have attached the two files here, after removing the name of my server, user and database. |
Can someone try to disable Encrypt (set it to false) and try again? Steps to follow:
|
@gregveres, from the logs that you have shared, we can see that the queries are executed on master. Can you please let us know the result of the query "SELECT @@Version" |
I had tried all combinations of the encryption flags before posting. They all produce the same result. |
Microsoft SQL Azure (RTM) - 12.0.2000.8 Oct 18 2022 13:24:45 Copyright (C) 2022 Microsoft Corporation Now, since you are saying that the db that is being selected is master rather than the db that I specified, I think you found the problem. Before I upgraded, I was not selecting any specific db. When I connected to the server, I had to select the db, then I could open the tables. After the upgrade, I saw what was shown in the original post of this issue. I then deleted that server and recreated it by connecting to my azure account. When I redid the connect, I explicitly selected the DB that I want to work with. I still got the results of the original post. In fact, when I right click on the server and I say manage, I see the list of tables that are in the db I want to work with, not the list of tables in the master db. So I would say that your bug is that in some situation, your connection code is ignoring the configurated database to connect to. |
I think I have a work around. This release is really messed up, making it unusable. I guess I should figure out how to download and install the previous version. |
Sorry to hear that @gregveres - we're currently working on identifying the issue and will update with any further information. In the meantime for those wanting to go back to the previous version for the time being you can get it from here : https://github.com/microsoft/azuredatastudio/releases/tag/1.39.1 (make sure you disable auto-update if you had that enabled so you aren't updated back to 1.40.0) |
When I went to uninstall ADS, there were two versions installed. 1.37.1 and then 1.40.0 (User). I don't know if that could cause this or not. |
@gregveres thanks for providing the additional context on this bug. We don't have a local repro yet and are working on that. There was a commit included in this release that changed the behavior in this scenario. I'd like to confirm if reverting this commit helps resolve this issue. Could you please verify this test build in this scenario, if possible? If the error persists, could you please post updated logs from this build? Win x64 Zip - https://azuredatastudiobuilds.blob.core.windows.net/test/1.41.0/azuredatastudio-insider-1.41.0-oe-revert.zip |
@kburtram i'm not @gregveres but i had the same problem and with your version it is working again. |
@kburtram I am @gregveres :) and I have tried the insider build you provided and it worked for me too. It looks like you have found the bad commit. |
Thanks for confirming the test build! We'll work on getting this resolved in the official builds. |
@gregveres @leon3011 While we work on getting the hotfix out, would you mind running this query against the DB you're having the problems with? SELECT * FROM sys.database_service_objectives
SELECT * FROM sys.databases |
The first query results in:
The second query results in:
|
Hey @gregveres - the logs you originally attached seem to be for a connection to master. Could you make sure you're running this with a connection directly to the user DB? In addition - if you could run this query using the same connecting to your user DB that'd be helpful. (replacing SELECT SERVERPROPERTY('EngineEdition')
create table #dso (database_id int primary key, azureEdition sysname null, engineEdition int)
if serverproperty('EngineEdition') = 11
BEGIN
insert into #dso select database_id, NULL, 11 from sys.databases
END
ELSE
BEGIN TRY
exec sp_executesql N'
insert into #dso select database_id, edition,
case when edition = ''DataWarehouse'' then 6 else 5 end
from sys.database_service_objectives'
END TRY
BEGIN CATCH
insert into #dso select database_id, N'', case when [name] = 'master' then 5 else 0 end from sys.databases
END CATCH
SELECT * FROM #dso
SELECT
case when dtb.name = 'master' then ISNULL(dso.engineEdition, 5) else ISNULL(dso.engineEdition, 0) end AS [RealEngineEdition]
FROM
sys.databases AS dtb
LEFT OUTER JOIN #dso dso ON dso.database_id = dtb.database_id
WHERE
(dso.engineEdition != 0)and(dtb.name='<DB_NAME>')
drop table #dso |
@Charles-Gagnon Ok, what version do you want me to be running and which database do you want my configuration to be pointing to? I am a little concerned running your query against my database since this is a production database. |
Running all of them would be great - here's the full list of all the separate queries in one batch : -- Query 1
SELECT * FROM sys.database_service_objectives
-- Query 2
SELECT * FROM sys.databases
-- Query 3
SELECT SERVERPROPERTY('EngineEdition')
-- Query 4
create table #dso (database_id int primary key, azureEdition sysname null, engineEdition int)
if serverproperty('EngineEdition') = 11
BEGIN
insert into #dso select database_id, NULL, 11 from sys.databases
END
ELSE
BEGIN TRY
exec sp_executesql N'
insert into #dso select database_id, edition,
case when edition = ''DataWarehouse'' then 6 else 5 end
from sys.database_service_objectives'
END TRY
BEGIN CATCH
insert into #dso select database_id, N'', case when [name] = 'master' then 5 else 0 end from sys.databases
END CATCH
SELECT * FROM #dso
SELECT
case when dtb.name = 'master' then ISNULL(dso.engineEdition, 5) else ISNULL(dso.engineEdition, 0) end AS [RealEngineEdition]
FROM
sys.databases AS dtb
LEFT OUTER JOIN #dso dso ON dso.database_id = dtb.database_id
WHERE
(dso.engineEdition != 0)and(dtb.name='<DB_NAME>')
drop table #dso All of these should be run directly against your user db (<db_name>). These queries are very lightweight, and something that's executed anytime a user connects to a database with ADS/SSMS regardless. So this shouldn't be a problem to run even against a prod DB. But run whatever you can and I'll make do with what we're able to get. |
Here's what my investigation has found out. I was never able to directly repro the issue, but by manually changing the query that seemed to be causing this I was seeing the behavior described above.
Follow-up questions/tasks :
|
Hi, I am someone else who has noticed the same symptoms after the data studio update and who is following this issue. I have one database connection that doesn't show the tables and another that does. In both instances I am connecting to my own database (not master) in the connection details. Running the SQL queries from above gives me these results for the one that doesn't show the tables in the treeview (sandbox): Running the SQL queries on the connection that works gives me these results (preview): I am getting no results on the last query when using my sandbox database connection. Look like the join is failing because the database_id from sys.databases (7) is different from the database_id from sys.database_service_objectives (5). Not sure why the database_ids are different (it is possible that database has been restored from a backup / snapshot in the past). This may be a different problem that the others are having, but I thought I would post my results anyway in case it helps you diagnose the issue. |
thx @martinw3 ! that discrepancy doesn't seem correct to me. Can you open a support ticket on the Azure portal to get the right folks on the SQL DB engine side of the house to look at it? I will ask around to see if any of my peers can help too. |
Sure, I'll raise a ticket with Azure and ask the question. Also I did find this on stack exchange that sounds similar: https://dba.stackexchange.com/a/138811 We have tested failover and also changed the pricing tier various times on those Azure SQL instances, so perhaps it is related to that. |
thx it never occurred to me that such metadata could be fluid. |
@martinw3 can you confirm this query gets the right edition for user databases when run in master as well as in the user database? select dtb.name, dso.edition from sys.databases dtb left join sys.database_service_objectives dso on dso.database_id = isnull(db_id(dtb.name), dtb.database_id) |
thx, we special case master. |
The insiders build was just updated with the fix for this issue - if anyone hitting this could install that and verify that'd be great. https://github.com/Microsoft/azuredatastudio#try-out-the-latest-insiders-build-from-main Otherwise we currently plan on releasing this to stable tomorrow morning (PDT). |
Hi, I can confirm the insider's build has fixed the issue for me, I am now seeing all the tables again in the tree view. :) |
I can confirm that the insiders build shows me the list of tables again. |
Thank you for confirming - the stable update (1.40.1) just went out as well so I'll be closing this. Thanks for the assistance in tracking this down everyone! |
New fix for microsoft/azuredatastudio#21245 sys.databases is NOT a reliable source for database_id, so we have to use db_id(name) to get the current database_id to join with sys.database_service_objectives.
Issue Type: Bug
After the new update, I cannot find the tables in the Table Dropdown.
I can see them when I use SSMS.
I can only see system tables, even though I made a connection to a particular database.
Azure Data Studio version: azuredatastudio 1.40.0 (3fbaa3d, 2022-11-11T22:47:05.361Z)
OS version: Windows_NT x64 10.0.19044
Restricted Mode: No
Preview Features: Enabled
The text was updated successfully, but these errors were encountered: