Airflow. Lost password in connection with DB in UI - airflow

There was a problem setting up the connection with db in UI. For example, I set up a connection with UI, set a password. I'm doing a connection test. Successfully.
But after I close the UI and try to connect through the DAG, the connection is not established, and when checking the connection settings in the UI, the password disappeared.

In The UI you can not see the password for security reasons.
If you want to know the full connection parameter then you can run :
airflow connections export connection.yaml
this would give you a yaml file with all connection and its parameters (including password)
if you are using docker-compose then you need to enter one of the airflow running container and run this command

Related

How to config connection properties within SSMS

I've searched to force the Encrypt connection from client SSMS to AWS RDS SQL Server since yesterday, but I nerver found what I'd like to achieve : launch ssms with Encrypt connection box checked.
The command line ssms.exe dose not contain this option and the CONFIG File Ssms.exe.config seems not having an connection element neither.
Anyone has some idea?
Thank you for helping

iAnywhere.Data.SQLAnywhere.SAException Connection error: Connection was dropped (may not be a SQL Anywhere server)

While trying to connect to SQLAnywhere (Sybase) database (C# code) from Azure ServiceFabric:
await using var connection = new SAConnection(connectionString);
await connection.OpenAsync();
receive iAnywhere.Data.SQLAnywhere.SAException
Connection error: Connection was dropped (may not be a SQL Anywhere server)
Error code is Error 832. This is generic connection error: An error occurred while attempting to establish a connection with the database server, but before attempting to connect to a database. Failure to initialize a communication link during the connection attempt is an example of this error. Creating a debug log file using the LogFile connection parameter may provide more information.
Locally it works, but does not work from Service Fabric.
Fix ideas tried:
Missing driver? Looks like no, Sybase (now SAP) SQLAnywhere requires special driver or client - but locally also works without this driver, just with iAnywhere.Data.SQLAnywhere.NETCore nupackage installed
Network connection/ firewall problems? Looks like no, database server can be pinged from Service Fabric node
It was another traffic protection tool. Although it was possible to telnet the port, still traffic from app was blocked by another tool.
Had a similar issue - turned out that whilst standard incoming traffic from the Sybase Server had been whitelisted in our Firewall, encrypted traffic from this had not been.
This meant I could ping and connect with Telnet, but got the same error when trying to log-in with my credentials
Connection error: Connection was dropped (may not be a SQL Anywhere server)
Our comms team solved the issue by whitelisted encrypted traffic from the server address as well. They also mentioned it possibly could have been solved we shared a valid security certificate for the encrypted data with their team, but were happy with the first course of action.

corda CENM networkmap server start failing to connect database after a few week run

we operate CENM(1.2 and use helm template to run on k8s cluster) to construct our own private network and keep on running CENM network map server for a few week, then launching new node start failing.
with further investigation, its appeared that request timeout for http://nmap:10000/network-map causes problem.
in nmap server’s log, we found following output when access to above url with curl.
[NMServer] - Error while handling socket client message com.r3.enm.servicesapi.networkmap.handlers.LatestUnsignedNetworkParametersRetrievalMessage#760c53ea: HikariPool-1 - Connection is not available, request timed out after 30000ms.
netstat shows there is at least 3 establish connection to the database from the container which network map server runs, also I can connect database directly with using CLI.
so I don’t think it is neither database saturated nor network configuration problem.
anyone have an idea why this happens? I think restart probably solve the problem, but want to know the root cause...
regards,
Please test the following options.
Since it is the HikariCP (connection pool) component that is throwing the error it would be worth seeing if increasing the pool size in the network map configuration may help - see below)
Corda uses Hikari Pool for creating the connection pool. To configure the connection pool any custom properties can be set in the dataSourceProperties section.
dataSourceProperties = {
dataSourceClassName = "org.postgresql.ds.PGSimpleDataSource"
...
maximumPoolSize = 10
connectionTimeout = 50000
}
Has a healthcheck been conducted to verify there are sufficient resources on that postgres database i.e basic diagnostic checks ?
Another option to get more information logged from the network map service is to run with TRACE logging also:
From https://docs.corda.net/docs/cenm/1.2/troubleshooting-common-issues.html
Enabling debug/trace logging
Each service can be configured to run with a deeper log level via command line flags passed at startup:
java -DdefaultLogLevel=TRACE -DconsoleLogLevel=TRACE -jar <enm-service-jar>.jar --config-fi

How to initialize and connect to LDAP Server without using ldap_open()

How to initialize and connect to OpenLDAP Server without using ldap_open() function.
I would like to test the feature LDAP test connection for this I need to open a connection with timeout and close it to check if the connection is available or not.
Just create a socket and call connect(), using non-blocking mode and your choice of select()/poll()/epoll() to control the timeout. Close it immediately on success, don't send anything.

SQL Server 2005 has problems connecting to a website running on the same server

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Hello I am new on developing on SQL Server 2005. I've worked for several years with SQL Server 2000, but after doing the usual stuff I do to connect to the server I get this exception on the web server.
There are several links on google that point me to possible solutions, but none of them have solved my problem. I've made changes on a "Surface Area whatever..." dialog (What the hell is that??? Why does SQL Server has changed so much??? It seems so complicated now).
I have ensured that SQL Server 2005 is configured properly to allow incoming connections on the instance of database server. I also have selected Automatic as the Startup type to start SQL Server Browser service automatically every time system starts. And no, there is no firewall running.
I've tried changing the connection string to connect using a port, to connect using the IP, to connect using the instance name...
Nothing seems to work, I'm still getting the same error. Any hint?
Answering the questions that people have made:
Yes, I can connect using management studio from a different computer.
Yes, I'm sure it's configured to accept local and remote TCP/IP and named pipes.
Yes, I restarted the server.
I am using Mixed mode security, which I already enabled. I already enabled the sa user.
I am able to connect to the database using a .udl file, and I've checked that my connection string is OK. I can connect to the database using DBArtisan and SQL Server client tools. I can do that both on the server and on a different machine. Even with all that...
The website is still unable to connect.
New update...
I've been struggling all day with this problem, and still haven't found out the cause. It seems that the error message I posted is a generic error that .net gives when it's not able to connect. I placed trash on the connection string (typing servers that don't exist) and I still get the same error.
These are some of the connection strings I've used on the server:
connectionString="Integrated Security=SSPI; Data Source=SERVER; Initial Catalog=db; Network Library=DBMSSOCN;"
connectionString="Data Source=SERVER; Initial Catalog=db; User ID=sa; Password=xxxxx;"
connectionString="Data Source=SERVER\MSSQLSERVER; Initial Catalog=db; User ID=sa; Password=xxxxx;"
I tried to register the sql server instance using some strange command, I found that here:
http://kb.discountasp.net/article.aspx?id=1041
To do that I used the aspnet_regsql.exe tool. It's still not working...
I also know that the server has the latest version of MDAC installed on it. The only thing that I'm suspicious on is that the server has two Database engines: SERVER and server\sqlexpress
Does that has something to do with the problem?
The only thing that I'm suspicious on is that the server has two Database engines: SERVER and server\sqlexpress
I think this is the source of the problem. Which one do you intend to connect to? You need to specify the "instance" you are connecting to.
Assuming you intend to connect to the SERVER instance, you connection string should then look like this (assuming the default instance name):
Data Source=YOURSERVER\MSSQLSERVER; Initial Catalog=db; User ID=sa; Password=xxxxx;
Or for sql express the connection string looks like this:
Data Source=YOURSERVER\sqlexpress; Initial Catalog=db; User ID=sa; Password=xxxxx;
Can you connect to the SQL Server via Management Studio from a different machine? This might help you narrow down whether it is the SQL Server configuration or you connection string configuration.
Recheck the surface area configuration, and make sure TCP/IP connections are allowed.
This could be many things. The first thing I would check is to make sure you can connect to the server using SQL Server Management Studio. Second, check your connection string to make sure it is correct. Surface area configuration should not apply for local connections.
Try re-installing the latest MDAC on the server. I once had a similar problem and this solved it.
[http://www.microsoft.com/downloads/details.aspx?familyid=6c050fe3-c795-4b7d-b037-185d0506396c&displaylang=en][1]
Based on the error looks like the code is attempting to connect using named pipes, rather than TCPIP. You may actually need to specifically indicate in your connection string that the sql provider should connect using tcpip, so your connection string would look like the below.
Using Integrated Authentication (windows):
Integrated Security=SSPI; Data Source=SERVERNAME; Initial Catalog=DATABASENAME; Network Library=DBMSSOCN;
Using SQL Authentication:
UID=USERNAME; PWD=PASSWORD; Data Source=SERVERNAME; Initial Catalog=DATABASENAME; Network Library=DBMSSOCN;
I've seen something akin to this happen before, where for some reason "named pipes" is used by default as the transport/connection layer, especially since both the web application and sql server are running on the same machine. I generally always use tcpip as the transport, or network library.
Another troubleshooting technique is to use a UDL (or data link file) to troubleshoot the connection. This allows you to switch between connection providers (ODBC, OLEDB, etc) and to set other connection options.
On the desk top of the machine right click and choose new -> text document.
Rename the *.txt file to TestConnect.udl (name doesn't matter just needs to be .udl extension). You should see the icon change from a text file icon to an icon that shows a computer on top of a data grid, or something like that (in other words windows should have an icon for it.).
Now double click the file and you will see a "Data Link Properties" applet appear.
Click the Provider tab, and you will see a list of different connection providers. I'd start by just choosing "Microsoft OLE DB Provider for SQL Server". We can use this to confirm that OLE DB can connect or not.
Click next, and enter the servername or ip address. Select Windows NT Integrated security. (You can always come back and change it to use a sql login.) At this point you can click "Test Connection". If the connection succeeds, then select a database name from the drop down list.
Lastly, if the connection fails, select the "All" tab, and then look for "Network Library" and edit its value, setting it to "DBMSSOCN".
Go back to the connection tab and click "test connection" again.
Repeat steps 4 and 5 this time with the "SQL Native Client" selected.
Hope this helps.
At the prompt does:
osql -E -S
... get you a > prompt ?
Did you try specifying the instance name in the connection string? Apparently sql server express, in particular, is finicky about having the instance name.
I've also started to poke around with the SQL Server Configuration Manager. So did you click into "SQL Server 2005 Network Configuration" and then look at "Protocols for InstanceName"? And you enabled TCP/IP and Named Pipes?
Did you also look at the "SQL Native Client Configuration" --> "Client Protocols", and you see that TCP/IP and Named Pipes is enabled there as well?
Using the SQL Server 2005 Surface Area Configuration tool, click the "Surface Area Configuration for Services and Connections", then under "Database Engine" --> "Remote Connections" what is selected? Since it appears that you are attempting to connect using Named Pipes you will need to make sure that "Local and remote connections" and "using both tcp/ip and named pipes" is selected.
As you probably know, once any changes are made, you have to stop and restart the sql server instance via Management Studio (you don't need to reboot the entire machine, although rebooting the entire machine will get you there).
And my last piece of advice. Step away from this for a while, and get your mind off of it for a few minutes. When you dive back in, you may find something you missed or overlooked before.
I fixed the issue that I had with the connection. The problem was on my application. The cause of the issue was that a connection string to the development (instead of the production) database, was hardcoded by one of the dialogs that generates the datasets. This dialog placed the connection string both on the web.config, and on a hidden sourcecode file called "Settings.settings.cs". The problem was solved by fixing the connection string to the correct location.
The error message was totally misleading, but I was able to find that by following all the methods presented on the stack trace.
So if you ever find this error message, there are tons of possible causes. Your first bet is to follow the usual steps for this error, which are checking that the server allows remote and local connections, and restarting the browser service.
If that doesn't work, check the stack trace, look for code that is in your application, put a break point there and explore all the properties on the connection string. At least that's how I solved it.

Resources