I'm trying to connect to a Hyper-V 2008 R2 server using gem ruby-libvirt. I keep getting the following error : Call to virConnectOpenAuth failed: internal error: Transport error during enumeration: Could not connect (7) (Libvirt::ConnectionError).
However, connection to a Hyper-V 2012 server, using the same code, works.
Have I made a mistake ?
Here is the code I'm using (following libvirt documentation http://libvirt.org/ruby/examples/open_auth.rb)
conn = Libvirt::open_auth('hyperv://my_server/?transport=http',
[Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE],
"") do |cred|
if cred["type"] == Libvirt::CRED_AUTHNAME
res = "username"
elsif cred["type"] == Libvirt::CRED_PASSPHRASE
res = "passwd"
else
raise "Unsupported credential #{cred['type']}"
end
res
end
In top of that, libvirt doc says it supports Hyper-V 2008 R2 (http://libvirt.org/drvhyperv.html) but here (https: //www.redhat.com/archives/libvir-list/2014-April/msg00802.html) is said it might not be anymore due to Hyper-V 2012. Would this be the issue ?
I'm using ruby-libvirt 0.5.2 and libvirt 1.2.2.
Thanks for your help !
Related
I have been trying to connect SQL database (in Azure) to shinyapp deployed in shinyapps.io, but I could connect to the database from local R console. Please let me know what I am doing wrong?
This is the connection string in Azure SQL DB.
And this is what I am trying from local R console and the connection was successful.
con <- dbConnect(
odbc(),
Driver = "SQL Server Native Client 11.0",
Server = "xxxx.database.windows.net",
Database = "hist_data",
UID = "narendra",
PWD = "xxx",
Port = 1433
)
I had also connected the Database to the local SSMS.
When I deploy the app, getting error:
nanodbc/nanodbc.cpp:1021: 00000: [unixODBC][Driver Manager]Can't open lib 'SQL Server Native Client 11.0' : file not found
I tried to set Driver = "FreeTDS" along with TDS_Version, but it didn't work. However, when I removed the TDS_Version, the app started working on shinyapps.io.
I resolved it by removing "tcp:" from the server name prefix. You also need to adjust the driver name to "SQLServer".
So my Shinyapp works great locally connecting to my Azure Server housing my SQL database using this connection:
con <- DBI::dbConnect(odbc::odbc(),
driver="SQL Server",
database="<db>",
UID="<user#db>",
PWD="<password>",
server="tcp:<user>.database.windows.net",
port=1433)
When publishing, I get this error:
nanodbc/nanodbc.cpp:950: 01000: [unixODBC][Driver Manager]
Can't open lib 'SQL Server' : file not found
http://docs.rstudio.com/shinyapps.io/applications.html suggests to use SQLServer instead of SQL Server but the connection breaks down (both from locally and when publishing).
I've also tried the RODBC but this has not worked either.
I'm a bit stumped on what driver to use to make the connection work. Any help would be greatly appreciated!
Using the SQL Server Management Studio (SSMS) Express, I can find the database and connect without problems.
But when I use pyodbc to connect to the same server using:
import pyodbc
Server = r"xxxER\xxxSQLSERV"
db = "xxxDB"
user = "xxx"
password = "xxxx"
conn = pyodbc.connect('DRIVER={SQL Server};SERVER='+server + ';DATABASE=' + db +';UID=' + user + ';PWD=' + password)
By Using Pyhton in my local i am able to connect but when i am trying in linux server getting below error
pyodbc.OperationalError: ('HYT00', u'[HYT00] [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')
i tried with ODBC Driver 17 for SQL Server too but facing the same issue.Can any one please suggest me on this.
Microsoft's SQL Server ODBC drivers for Linux are unable to resolve instance names. You can use the free sqlserverport module to get the corresponding port number and use that to connect.
Try removing the instance from server and set it as
Server = "xxxER"
or if you have a port number append it as
Server = "xxxER,portNo"
I have this problem and solved my problem in here.
Just add version.
conn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server + ';DATABASE=' + db +';UID=' + user + ';PWD=' + password)
If not work change version 17 to 13 if not to 11 .
List versions of ODBC.
Check your mssql network config, my problem was there.
Enable port 1433 for all IPs.
Now is working with IP and host name.
I am using SSH Tunnel with remote server port forward to localhost,1433. This pyodbc connection intermittently fails if using the approach:
cnxn = pyodbc.connect('driver={ODBC Driver 17 for SQL Server};Server=localhost, 1433;'...
Replacing localhost with 127.0.0.1 seems to be working all the time
cnxn = pyodbc.connect('driver={ODBC Driver 17 for SQL Server};Server=127.0.0.1, 1433;'
Incidentally also did same using Ruby and FreeTDS, and Localhost,1433 worked all the time.. Must be something inside the pyodbc package or their approach that sometimes drop some info to make the DBMS on server fail to respond/timeout
This worked for me:
mssql://DRIVER={ODBC Driver 17 for SQL Server};SERVER={server_address,PORT};DATABASE=<my_database>;UID=<my_username>;PWD=<my_password>
Description: I installed SQL Server 2012 on my local machine(Windows 7). At first I installed with Windows authentication. After searching on web, I change to SQL Server authentication and set as: In SQL Server Management Studio->object explorer->security->logins->sa->right click property, select SQL Server authen and set password as "!Abcd1234!" for example.
Then I tried that I can connect by SQL Server authentication with sa/password using Management Studio. But using Perl script I failed.
My simple Perl script as below:
use strict;
use warnings;
use dbi;
my $user = "sa";
my $password = "!Abcd1234!";
my $connect = DBI->connect("dbi:ODBC:Driver={SQL Server};Server=127.0.0.1;UID=$user;PWD=$password")or die "Error: $DBI::errstr\n";
I got error
Error: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. (SQL-08001) [state was 08001 now 01000]
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). (SQL-01000)
May I get any help or trace method?
Yes, Mitch Wheat, I do enable "sa" account in the status tab. Sorry missing to mention that. I doubt whether my Perl script is correct? I think access locally should have no firewall issues right?
I have connected many a times from perl (running on linux) to the MSSQL server. and while doing so, I would create a DSN manualy on the my Linux box and then write below syntax to connect:
my $dbh = DBI->connect ('dbi:ODBC:odbc-test', 'sqluser_name', 'sqluser_password');
Where, odbc-test is the name of the DSN
And it always worked.
unfortunately I never done any perl DBI connection from windows.
So,
On your windows box, could you create a DSN manually first and then follow above mentioned syntax to connect to the MSSQL server .
You should using ODBC administrator to test the connection first.
I've managed to connect my SQL Server 2005 in Windows 64 bit server with ORACLE database. (Thanks to Mr. Jeyong Park :http://knol.google.com/k/jeyong-park/accessing-oracle-data-source-from-64bit/3vywlm4f31xae/12)
The problem is :
In SSIS when I used Oracle as a OLE DB Data Source and previewed the data, it works, however, when I run the Package, the OLE DB Data Source task failed with the message :
[OLE DB Source [10882]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.
The AcquireConnection method call to the connection manager "PROD_cm" failed with error code 0xC0202009.
There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Since I can preview the data, I think there's no problem with the connection.
Please help...
When I encountered this problem a year ago with SQL Server 2008 on Windows Server 2003 64-bit the issue was caused by incorrect drivers. What is the version of the Oracle database to which you are connecting? If you are connecting to a 8g or 9i Oracle server, then you need to use the 9i Oracle drivers. If you are connecting to a 10g or better server, then you can use the 11i drivers.
Have you tried running the SSIS package while logged into the server as the SQL Server Agent service account or have you only tested this on your workstation? If it works on your workstation and doesn't work while logged into the server as the service account, then this screams driver issue to me.
Another possible problem is that you tnsnames.ora file may not be correctly setup. The file contents should be something like the below code for the 9.2 drivers. Please note you need to replace , , and with appropriate values.
# tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.
<SERVER_NAME> =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <IP_ADDRESS>)(PORT = <PORT_NUMBER>))
)
(CONNECT_DATA =
(SID = <SERVER_NAME>
(SERVER = DEDICATED)
)
)
One more possible solution. If you can get the linked server connection working and cannot get the data flow to work for some reason, then you could execute a linked server query to pull down the data. I remember doing this for about 6 months when we couldn't get the MYSQL drivers to work with the CTP of SQL Server 2008. Eventually we found the right solution, but this helped us through the short-run period to get up and running.
One of The following should work:
Check the tnsnames.ora file - It should have the connection details to the Oracle DB hat you are trying to connect through your package.
Check if the Oracle DB you are trying to connect to is working. I wasted around two days finding a root cause of the error and later came to know that the Oracle DB was shut down.
Check that the passowrds are intact in the configuration manager/Connection string.
If you have been working for long on the package try closing and opening it again. The