Chainlink Quick Start problems connecting to the database? - chainlink

I have gone through the AWS Chainlink quickstart successfully. I disabled the ssl certificate and decided to use TCP enabled. The Chainlink node did not launch on intial deployment. I used the .sh files to create .api, .password, .env
I run the run script but get this error
opening db: failed to open db: failed to connect to host=/tmp user= database=: dial error (dial unix /tmp/.s.PGSQL.5432: connect: no such file or directory)
I have also gone through the step on the Chainlink docs to enable https connections, and have configured the tls ports in the .env file.
I thought for sure it was the tls blocking me from the database. But still I get this error
Here is my DATABASE_URL=postgresql://user:password#writerendpointofcluster:5432/databasename
I used the writer endpoint of the cluster.
I don't know what to try next. Any help would be much appreciated.

The problem was the password for the database. There are certain characters that throw an error.
The instructions on the AWS Chainlink quickstart on the database password characters that are prohibited is not an exhaustive list.
In regards to AWS Chainlink quickstart, you can use the "!" as the symbol requirement for the database password.
We are putting together a list of characters that throw an error, so far we have #, ^, %, $ symbols that prevents you from connecting to the database.
*please comment which symbol gave you an error and I can add it to the list

In addition to !, * and _ can be used as the symbol requirement for the database password.
The following characters also lead to an error: <, >, #, =. This is due to some special characters requiring percent encoding, as discussed on this AWS Chainlink QuickStart GitHub issue.

Related

Laravel cannot not connect to Stripe

I have trouble connecting to Stripe with my Laravel / React application. Locally it works and the same code on a Digital Ocean droplet doesn't. I get this message:
Could not connect to Stripe (https://api.stripe.com/v1/invoices/upcoming?customer=cus_XXXXXXXXXX). Please check your internet connection and try again. If this problem persists, you should check Stripe's service status at https://twitter.com/stripestatus, or let us know at support#stripe.com. (Network error [errno 7]: )
That is the error message from Laravel. The important part is (Network error [errno 7]: ). It has to do with CURL that encounters this error: CURLE_COULDNT_CONNECT (error code 7).
Also I would expect something like this (Network error [errno 7]: Failed connect to api.stripe.com:443; Operation now in progress). Not a blank space after the colon.
I have tried this:
The server uses SSL (https://xxxxx.xxx)
Reboot the server
Redeploy the application
Clear caches for config, route, view etc.
php artisan optimize:clear
Re-run composer
Checked my Stripe API keys
Tried manually to connect fromt the shell with curl and it works.
Tried https://github.com/stripe/stripe-reachability#stripe-reachability
For reference, you can see the error on https://curl.haxx.se/libcurl/c/libcurl-errors.html and means :
CURLE_COULDNT_CONNECT (7) - Failed to connect() to host or proxy.
This is not an issue in the code, you may need to check your server hosting provider.
BTW, you may need to look at This answer. It's the same.
It is solved with him by changing the server and when communicating with the host provider, he found that the port is blocked because of high traffic.

How to Resolve ORA-28040: No matching authentication protocol with Docker

Good afternoon, I am trying to run an oracle database with docker, but when I try to connect from the sql developer I get the following error:
ORA-28040: No matching authentication protocol
The question is that I am using the parameters that are specified to be necessary to connect to the database, such as the host ip (10.164.7.203) and port 1521:
Try to apply the solution described here:
https://logic.edchen.org/how-to-resolve-ora-28040-no-matching-authentication-protocol/
but I haven't managed to solve the problem either
The container is lifting normally and I have even done operations with sqlplus and everything is fine
the container DON'T use $ORACLE_HOME/network/admin/sqlnet.ora
you must modify in
/app/oracle/product/12.2.0/dbhome_1/admin/ORCLCDB
SQLNET.ALLOWED_LOGON_VERSION=8

Jdbc connection error from Google Apps Script

I have created a Google Cloud Project MySQL database to use in conjunction with the Jdbc service provided by Google Apps Script. Everything went as planned with the connection. I am basically connecting as it does in the docs.
var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);
I shared the file with another account and all of a sudden I am seeing a red error saying:
'Failed to establish a database connection. Check connection string, username and password.'
Nothing changed in the code, but there is an error. When I go back to my original account and run the same bit of code, there is no error. What is happening here? Any ideas?
Jdbc.getConnection works from both: my account and another account:
var conn = Jdbc.getConnection('jdbc:mysql://' + IP + ':3306/' + database_name, user, password)
I'm really confused because the recommended method did not work.
There are two ways of establishing a connection with a Google Cloud
SQL database using Apps Script's JDBC service:
(Recommended) Connecting using Jdbc.getCloudSqlConnection(url)
Connecting using Jdbc.getConnection(url)
Notes:
IP is a Public IP address from the OVERVIEW tab in your database console:
I've allowed any host when created a user:
I am not sure whether this question has been resolved or not, but let me add this answer.
I also faced the same problem but I found the resolution. What I did is:
First, go to the console.
https://console.cloud.google.com
Then, open IAM.
and add the account as a member and add this permission: "Cloud SQL Client".
I think this is a permission issue in your second account. Necessary information are missing in your question. But, the secound account, if run as a another user, won't necessarily have your sqlservice authorization. The permission,
https://www.googleapis.com/auth/sqlservice
Manage the data in your Google SQL Service instances
is required to use Jdbc.getCloudSqlConnection(url), while Jdbc#getConnectionUrl() just requires external link connection permission
https://www.googleapis.com/auth/script.external_request
I believe that you can only connect to sql instances owned by you with getCloudSqlConnection() which doesn't even require external connection permission. This method probably calls your sql instance internally.
References:
Jdbc#getCloudConnection
Jdbc#getConnection
Conclusion
To connect to any external service, you need external_request permission. But, You don't need that permission to connect to your own documents say, Spreadsheets owned by you/have edit access permission - through SpreadsheetApp.openByUrl(). I believe it's the same thing with Jdbc.getCloudSqlConnection(). It calls your Google sql internally - So, even if you grant external request permission, It won't work. What will work for this method is
Installable triggers (which runs as you).
Add the second account also as owner in GCP-IAM (may not work though) See this answer
I'd double-check once again all IP ranges which should be whitelisted. According to your description it worked fine in first account, probably in second account Apps Script uses another IP for connection, which was not whitelisted or whitelisted with some typo. Could you share screenshot how did you exactly whitelist the ranges from this article?
I have a GAS Add-On that uses a Google cloud dB. I initially set this up by:
Whitelisting Google Cloud IP ranges in my SQL instance
Getting the script.external_request scope approved for OAuth Consent screen
This all works great from GAS for the add-on, but I suspect that if this whitelist is not comprehensive and volatile (which I expect it is), I will see intermittent connectivity issues.
I recently added a Firebase web app that needs access to the same dB. I had issues, because Firebase does not conform to those Google IP ranges and does not expose its IP for whitelisting. So I had to create a socket layer connection as if Firebase was an external service.
Which got me thinking, should I put a socket layer in my GAS Add-On? But nothing in the GAS JBDC Class documentation indicates a socket parameter.
Which leads me to a question that was not really answered in this thread:
Does anyone know why Jdbc.getCloudSqlConnection(url) is the "Recommended" approach? The documentation seems to imply that because the IP whitelisting is not required, Jdbc.getCloudSqlConnection(url) is using a socket (or some other secure method) to connect to the dB?
It also seems silly that if that is the case, that I would need two have two sensitive scopes to manage a dB connection. I would rather not go through another OAuth const audit and require my users to accept another scope unless there is a benefit to doing so.

How to prevent running program on Win or Unix via command line

After a long research here on Stackoverflow and on net I didn't found nothing talking about it. As the title say, how can I do that?
For example: I am owner of a hosted website that allow me to manage the database via PhpMyAdmin. When I try to connect to my database via prompt, the connection never go fine. It could be because of OS settings (right?).
How can I do that (in both OSs).
Thanks in advance.
If I understand your question correctly:
You have a website with a MySql database hosted on your providers servers.
When you try to use your local PC installation of MySql from a command prompt, it will not let you connect.
I use dreamhost.com and have a similar setup. If I want to use database tools from my local PC to connect to the database, I have to enter my IP address in the db configuration page under "allowed hosts".
Restricting remote database connections to specific IP addresses protects your database from random hacking attempts.
As for your question about restricting command line execution of a program, that is usually just caused by missing configuration information in the environment variables - leaving the path to the executable out of the PATH variable is a common one. You would still be able to run the program if you enter the full path to it.
It really depends on the error message you get when trying to run the program from the command line.

Oracle TNS: net service name is incorrecly specified

I'm trying to access an Oracle database on an old server we inherited for a client.
I'm confident I have the Oracle database and listener started and working, but when trying to access sqlplus or the exp commands, I'm getting the following error:
ORA-12162: TNS:net service name is incorrectly specified
I have edited the tnsnames.ora file to change the host to 127.0.0.1 rather than an external URL and I am able to successfully tnsping my connection, but am not getting much further.
Try setting the Oracle SID
set ORACLE_SID=database name
export ORACLE_SID=bvteng worked for me, where bvteng was the service name.
Are you trying a local connection (e.g. "sqlplus u/p") or a network connection (e.g. "sqlplus u/p#pnews10s.world")? Are they both giving you the same error?
The TNSPING by definition is using a network connection. I see some references that indicate you can get the 12612 error when using a local connection. So that is a possible explanation why you are seeing the error from SQLPlus but not TNSPING. If so, try doing a network connection instead.
The local connection not working is probably due to ORACLE_SID not being set correctly as John suggested, but his syntax may not be the right method for whatever shell you are using. Make sure you are using the correct method for the given shell, such as "export ORACLE_SID=name" or "setenv ORACLE_SID name".
I have edited the tnsnames.ora file to change the host to 127.0.0.1 rather
than an external url and am able to successfully tnsping my connection, but am not getting much further.
The last time that happened to me (tnsping works but sqlplus does not, same error message you got), the issue was that someone had copied the tnsnames.ora file from a Windows machine, and left the wrong line feed codes in.
If that is the case, you need to do some dos2unix.
These files are very sensitive to "correct" white-space and tabbing.
Someone should complain to Oracle about that.
Dave Costa has presented you with 2 important question. Are you trying to connect via net8 or locally via extproc? Is the listener on the local machine(127.0.0.1 -- loop back device) setup for extproc connection?
To use the net8 or tcp connection protocol, you need to specify user/pw#tns_alias. To connect locally via extproc you should specify the oracle_sid parameter and then connect via name/pw.
I also notice the tnsalias has the .world domain appended to it, but the sqlnet.ora file does not contain a reference to NAMES.DEFAULT_DOMAIN as being "world".
Also what is the env parameter for TNS_ADMIN? Make sure your tools are looking at the correct tnsnames.ora file. Too many time people modify one tnsnames.ora and the programs/software is looking at another.
Check the tnsnames.ora file, in my case, took me days to find out there were either tab characters in the connection string or other invisible special characters that were causing it to fail.
In my case, the problem was that the DSN and the ServiceName was configured as the same in the odbc.ini file.This should not be a problem, but only after changing the DSN name, I was able to connect to the database through isql.

Resources