0

After some database issues the night before, multiple servers (separate from the database servers) are getting the following error when just running the 'Get-ODBCDSN' function from a powershell console:

Get-OdbcDsn : Timeout when waiting for another concurrent operation to complete. At line:1 char:1 + Get-OdbcDsn + ~~~~~~~~~~~ + CategoryInfo : ResourceBusy: (MSFT_OdbcDsnTask:Root/Microsoft/...SFT_OdbcDsnTask) [Get-OdbcDsn], CimExc eption + FullyQualifiedErrorId : MI RESULT 27,Get-OdbcDsn

I have found nothing online about this error. I've tried tweaking the one switch that has any correlation '-ThrottleLimit' but using various values doesn't help.

I believe, that a reboot will resolve this error. However, this function is customer-impacting and needs to 'just work'. I use the module to get all current User DSNs then delete them. Then I rebuild with the New-ODBCDSN function. All of these functions are called in the login script. Some 20 to 50 users may login to a server at once during peak times. Both Get and New-ODBCDSN commands exhibit the same error.

In order to work around the issue in the meantime, I have stopped using the function and switched to setting up DSNs through the registry HKCU:\Software\ODBC.INI\ODBC\etc,etc.. This is not my preferred option.

I'm looking to understand the problem, identify resolutions, or find another workaround.

PlainJay
  • 5
  • 4
  • Out of curiosity, why are you doing this in the first place? It seems an odd thing to delete and recreate the DSN's on every user log on. – joeqwerty Jun 14 '17 at 23:31
  • Customer DSN names are created based on some custom factors, version of the software, customer id, etc to specifically identify their database. When a customer changes versions they get a new db and DSN name. Also they may have created their own DSNs (which we don't want). In order to keep their DSNs set correctly, we wipe all User DSNs out and recreate them to their currently assigned settings. – PlainJay Jun 15 '17 at 17:18

1 Answers1

1

I know i am a year late by a year, however hopefully this will help somebody else out. I was just getting the same error "Get-OdbcDsn : Timeout when waiting for another concurrent operation to complete. At line:1" mine was because MSFT_OdbcDsnTask was in use by trying to add a dsn through PowerShell and got locked up, and killing the command did nothing. You probably noticed that you can still use "get-obdcdriver", at least i did.

I was able to fix this by going to start > resource Monitor > CPU > Associated handles and typing ODBC in the search. I then was able to see wmiprvse.exe in the search result. After killing one of the wmiprvse.exe then my list was blank and i was able to run the command. Note i would make sure you kill all if they do not clear, you are basic pulling the rug out from that exe. Also anything that it is trying to be completed will be lost.

Mvail
  • 26
  • 1
  • That solution worked for me. It seems that the underlying server the ODBC connection pointed to got locked up. Then this Get-ODBCDSN fails even after the DB recovers, and will not work again until a reboot or by performing this wmiprvse.exe kill. Thanks again~ – PlainJay Dec 04 '18 at 18:48