Azure DevOps Pipeline Release using SSH Task Connection Error - azure-devops

I'm trying to use Azure Pipeline Release to setup a project deployment on a VM server running on linux using SSH connection but keeps getting this error message:
Failed to connect to remote machine. Verify the SSH service connection details. Error: Error: Timed out while waiting for handshake.
This is also running on a self-hosted agent.
Used the private key generated from the server to set-up the SSH Service Connection. Was able to successfully access the VM with my local machine using ssh connection as well.

Related

Docker Gitlab Runner Running Flyway Unable to Obtain Connection with AWS Postgres RDS

The Problem: I am unable to connect to a Postgres RDS from a Gitlab runner via Flyway.
The Error:
ERROR: Unable to obtain connection from database (jdbc:postgresql://datacatalog-rds-stage.redacted.us-west-2.rds.amazonaws.com:5432/datacatalog
) for user 'dos': FATAL: database "datacatalog
" does not exist
What I have tried:
Verified I can connect locally. I am able to connect using the same credentials and jdbc url from a docker container on my desktop
Confirmed that the private IP address the Gitlab runner could be on, is in a source range, in the RDS security group inbound rules
Any help you can provide would be greatly appreciated.
Thanks!

Azure VM and Postgresql ChainlinkNode: unable to lock ORM

To summarize, I am trying to run a Chainlink node via Docker on an Azure VM. I also created an Azure Postgresql DB and verified the VM is able to connect via psql cli.
Steps I took to get the node running (following this link):
Create Azure VM
Install docker
mkdir ~/.chainlink-rinkeby
Created .env file
Set ETH_URL via an External Provider
Create Postgres SQL Database following this link
Set Remote Database_Url config using sslmode=disable
Start the node with:
cd ~/.chainlink-rinkeby && docker run -p 6688:6688 -v ~/.chainlink-rinkeby:/chainlink -it --env-file=.env smartcontract/chainlink local n
My .env file:
"ROOT=/chainlink LOG_LEVEL=debug ETH_CHAIN_ID=4 MIN_OUTGOING_CONFIRMATIONS=2 LINK_CONTRACT_ADDRESS=0x01BE23585060835E02B77ef475b0Cc51aA1e0709 CHAINLINK_TLS_PORT=0 SECURE_COOKIES=false GAS_UPDATER_ENABLED=true ALLOW_ORIGINS=*"
"ETH_URL=wss://cl-rinkeby.fiews.io/v1/MY_API_KEY"
"DATABASE_URL=postgresql://MY_USER_NAME:MY_PASSWORD#MY_DATABASE_nAME.postgres.database.azure.com:5432/postgres?sslmode=disable"
Error:
[ERROR] unable to lock ORM: dial tcp 127.0.0.1:5432: connect: connection refused logger/default.go:139 stacktrace=github.com/smartcontractkit/chainlink/core/logger.Error
I've also tried giving a version of 0.10.8 in the chainlink startup command but the error I get for that is:
[ERROR] failed to initialize database, got error failed to connect to `host=/tmp user=root database=`: dial error
You are trying to connect your Chainlink node to a remote PostgreSQL database. This database is managed by AZUR's cloud service and hosted and administered there internally. The issue with the connection is that the Chainlink node wants to establish a connection to 127.0.0.1 and is therefore convinced that the Postgres is located locally in your Chainlink docker container.
A docker container is an own environment and represent an own host, so 127.0.0.1 will loopback into the container itself. I recommend you to have a look here on the official network documentation of docker: https://docs.docker.com/config/containers/container-networking/
With the version 0.10.8 you established a connection. The issue here is now related to the USER and the DATABASE. Please ensure that you create a database and an own USER for it and not use the admin credentials (root) like the superuser.
You can enter the postgres via the azur cli and type in the following lines:
CREATE DATABASE <yourdbname>;
CREATE USER <youruser> WITH ENCRYPTED PASSWORD '<yourpass>';
In addition you can have a look at this post related to the connection to your postgres database:
https://stackoverflow.com/a/67992586/15859805

Can't connect Robo3T to Google Cloud Platform compute engine via SSH

I can SSH into my instance from the terminal like this:
ssh -i <path_to_private_key> <username>#<external_ip_address>
But I can not connect Robo3T via an SSH tunnel, using the same credentials - I get the error:
Resource temporarily unavailable. Authentication by key (/home/alex/.ssh/id_rsa) failed (Error -16). (Error #11)
Has anyone managed this, and if so, how can I?

How to configure and connect to a remote MongoDB server on a hosting provider server?

I've been trying to establish a connection to my MongoDB on my Cloud VPS hosting server.
I'm hosting my website on a Cloud VPS running Ubuntu 16.04 (my hosting provider is InMotion hosting if anyone knows them).
I've installed MongoDB on the server.
I've edited the /etc/mongo.conf file to bindIp: 0.0.0.0
Created an admin user db.createUser({user: "XXXXX",pwd: "XXXXX",roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase", "readWriteAnyDatabase"],mechanisms:[ "SCRAM-SHA-1" ]})
Restarted the service and checked the status that it is Active
Now, I'm trying to connect using RoboMongo, putting the server IP, user, and password and it doesn't connect.
To be able to connect via SSH I had to generate a public SSH key and then load the private key to PuTTY, so I even tried to connect RoboMongo with SSH. I've attached screenshots of the settings I've tried in RoboMongo.
When trying to connect with SSH I get this error:
Failed to create SSH tunnel to XXX.XXX.XX.XXX:22.
Error:
Authentication by key (PATH/id_rsa.ppk) failed (Error -16)
When trying without SSH I get this:
Cannot connect to the MongoDB at XXX.XXX.XX.XXX:27017.
Error:
Network is unreachable.

Connecting to GCP Cloud SQL using cloud sql proxy

I am following this guide to connect to my GCP Cloud Postgresql - I have a private IP only. When I run
./cloud_sql_proxy -instances=<Instance connection name>=tcp:5432
I get the following (actual references replaced by <Instance connection name>)
2019/04/01 11:46:45 failed to setup file descriptor limits: failed to set rlimit {&{8500 4096}} for max file descriptors: invalid argument
2019/04/01 11:46:45 Listening on 127.0.0.1:5432 for <Instance connection name>
2019/04/01 11:46:45 Ready for new connections
2019/04/01 11:47:28 New connection for <Instance connection name>
2019/04/01 11:49:38 couldn't connect to <Instance connection name>: dial tcp 172.27.160.3:3307: connect: connection timed out
If I run
psql "host=127.0.0.1 sslmode=disable dbname=<db> user=<user> password=<password>"
then I get the following
psql: FATAL: password authentication failed for user "prodigy"
If run the same psql command from a VM instance on the same network as my cloud SQL then connection is just fine.
Your Cloud SQL instance needs to be in the same client's network in order to connect using its private IP.
It will not be possible to connect Cloud SQL (as is) through its private IP outside of the Google Cloud Platform network. In such a case, you could try Cloud Interconnect [2] in order to extend your on-premise network to Google's network so that you can try your connections and see if that works for you.
On the other hand, when using the Cloud SQL Proxy, you need to state being using private IP [3]. If not specified, the proxy will look for the public IP by default.
Let me know how it goes.
[1] https://cloud.google.com/sql/docs/mysql/private-ip
[2] https://cloud.google.com/interconnect/docs/
[3] https://cloud.google.com/sql/docs/postgres/sql-proxy#private-ip
The connection to a Cloud SQL instance using cloud_proxy can happen only if Cloud SQL and cloud_proxy belong the same VPC network [1].
Otherwise cloud_proxy cannot reach Cloud SQL
[1] https://github.com/GoogleCloudPlatform/cloudsql-proxy/issues/164