How to connect CloudSQL Postgres to Hasura Cloud? - hasura

I started a new Hasura-Cloud project and a new CloudSQL project.
I have added the Hasura-Cloud ip-address to the allowed connection addresses on cloudSQL
I have tried the following address but I'm always getting "database not found": postgres://<db--user>:<db-password>#<db-ip-address>:5432/cloudsql/<connection-name>/<db-name>

After contacting the Hasura team we found the solution to the correct URL
The correct URL is: postgres://postgres:<db-password>#<db-id-address>:5432/postgres
Make sure you add the Hasura Cloud IP to the allowed IP addresses on cloudSQL, otherwise the Hasua server get's blocked

Related

How to grant privilege to CircleCI pipeline to query database during Cypress test?

I have a set of Cypress tests that query my client's MariaDB database.
In order to query the database during the tests, my client had to whitelist my IP address.
The problem is that they want these tests to run in a CircleCI pipeline.
When I run them in CircleCI, I get the below error:
ER_HOST_NOT_PRIVILEGED: Host 'ec2.xxx.compute-1.amazonaws.com' is not allowed to connect to this MariaDB server
I assume this is because the machine's IP address isn't whitelisted.
To resolve this, do I have to somehow get the IP address of the virtual machine & whitelist that?
Or do I need to make some change on the database side?

WSO2 api manager analytics : CertificateException: No subject alternative names matching IP address found executing

In wso2 api manager analytics I faced following exception, could you please guide me?
Exception occurred :java.security.cert.CertificateException: No subject alternative names matching IP address 172.24.64.114 found executing GET https://172.24.64.114:9443/api/am/admin/v1/custom-urls/carbon.super
This looks like it is failing due to hostname verification. Although you have relevant cert in the client truststore, you have used the IP address to communicate with APIM.
You have few options here.
Disable hostname verification (Not recommended for production)- https://github.com/wso2/docker-apim/blob/v3.2.0.2/docker-compose/apim-is-as-km-with-analytics/conf/apim-analytics-dashboard/conf/dashboard/deployment.yaml#L25
Use the hostname instead of the IP. You can map your hostname with IP by adding a DNS entry or by adding an /etc/hosts entry. DNS entry is preferred for Prod

EC2 cannot connect to mySQL RDS

I've tried this a couple of times without any luck. I've got a new EC2 instance (Amazon Linux 2 AMI (HVM), SSD Volume Type - ami-0a0ad6b70e61be944). This instance is in the default VPC and region = US EAST 2 (Ohio). The EC2 is in a web-server security group that has inbound ports 80 & 22 open. The RDS is a MySQL instance "Dev/Test" and is in a security group that has has inbound port 3306 open for "my ip" and my web-server security group is added to this DB security group. I can SSH into my web-server without issues. I can launch my test page on my web-server without issues. Yes, I'm using the correct connection string details including credentials.
However, the WordPress client on my EC2 fails to connect to my RDS with the following error:
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at uday.cgakf6jnokhj.us-east-2.rds.amazonaws.com. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
Any help would be appreciated
I've tried suggestions like directly adding the public and/or private IP of the EC2 into the Security Group of the RDS - no luck :-(
The tutorial in udemy had wrong instructions. This particular paper in AWS helped me overcome underlying issues - everything now works beautifully!! https://aws.amazon.com/getting-started/hands-on/deploy-wordpress-with-amazon-rds/5/
Thanks!

Drupal error when accessing sites: Can't get hostname for your address

I'm getting the following error when trying to access sites on my server through the browser. I can ssh to the server and I tried running a flush hosts command but that didn't do anything. The host in question is in the mysql user table and has a username/password and all relevant privs. This issue appeared since an office move and the server was switched back on. I can only think it of being a network issue of some sort.
PDOException: SQLSTATE[HY000] [1042] Can't get hostname for your address in db_table_exists()
How do I resolve this?
I think you need to check if the mysql hostname defined in $databases['default']['default']['host'] of the Drupal sites/default/settings.php file is reached by the machine where drupal is running.
Try to connect to ssh and do a ping or a telnet with the hostname.
Instead of the hostname try using the ip address. Otherwise, if the hostname is not resolved, try adding it to /etc/hosts if you're on linux.

Invalid URI for Localhost

We have a website/webservice running on one of our servers. We hit that webservice once a day with a scheduled .bat scipt.
Just recently the scheduled task started to fail. The log shows "Invalid URI: The hostname could not be parsed."
When we're logged into the server we can reach the website through http://localhost/website, but get an Invalid URI error when we hit the webservice http://localhost/website/ws.asmx.
Any ideas?
Edit:
We'be tried using the servername, the ipaddress, and port numbers (and combinations therein). Any other ideas?
For the private IP Address your using Wikipedia Reference http://en.wikipedia.org/wiki/IP_address for what are the limits and proper uses.
If you have access to the source code for the web service look for fixed IP Address being used along with having correct Server Bindings for using the service.
Try using the IP Address of the machine instead of localhost.
Basically, I'm taking a wild stab that someone ran a lockdown or a service patch was installed that somehow is filtering request resposes to localhost (127.0.0.1).
Try using the machine name instead of localhost

Resources