CraftCMS with Redis: Failed to open redis DB connection (tcp://:, database=): 0 - Failed to parse address ":" - server

I have yii2 and yii2-redis installed on a CraftCMS project, but when I fire up the project, I get an error message that reads:
Database Exception – yii\db\Exception
Failed to open redis DB connection (tcp://:, database=): 0 - Failed to parse address ":"
Error Info: Failed to parse address ":"
I'm not quite sure what to do with this error. In my .env file, I put in:
REDIS_HOST=localhost
REDIS_PORT=3306
REDIS_PASSWORD=
REDIS_KEY_PREFIX=craft
But that only yielded a different error:
Database Exception – yii\db\Exception
Failed to open redis DB connection (tcp://:3306, database=): 0 - php_network_getaddresses:
getaddrinfo failed: nodename nor servname provided, or not known
Error Info: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
Help?
Additional context: I didn't set up the build for this project, so I more or less inherited this Redis setup.
Update:
I went and dug into the config file for the Redis setup and found a misnaming between the .env variables and what was present in the .env file. Now I'm getting a completely different error:
"Received illegal data from redis: Redis command was: SELECT 0"

Please check that your configuration matches the environment variables you use.

Turns out I'd deleted the Redis database (don't remember how or when), so creating a new one (with the correct .env variables set) fixed the problem immediately.
Whew.

Related

Unable to connect to OrientDB - "Error in database URL: the engine was not specified"

Trying to connect to a new OrientDB (v3.2.15) database in Docker:
connect env remote:localhost root root;
create database apples plocal;
But am getting:
Error: com.orientechnologies.orient.core.exception.OConfigurationException: Error in database URL: the engine was not specified. Syntax is: <engine>:<db-type>:<db-name>[?<db-param>=<db-value>[&]]*. URL was: apples
Looking at the source code I can see : is required, or it'll through an exception - but the documentation says the opposite and my commands look correct.
Any ideas what I'm doing wrong, please?

Hyperledger iroha - schema error while connecting to postgres database

I am trying to deploy Hyperledger Iroha on MacOS (BigSUr) locally, and while running the following command
./build/bin/irohad --config example/config.postgres.sample --genesis_block example/genesis.block --keypair_name example/node0
I get the error
Storage initialization failed: Cannot execute query. Fatal error. ERROR: relation "schema_version" does not exist LINE 1: ... test, iroha_major, iroha_minor, iroha_patch from schema_ver... ^ while executing "select 1 test, iroha_major, iroha_minor, iroha_patch from schema_version;".
I have installed Postgresql DB locally and created the iroha_data database.
Is there a schema that i must load additionally or does it get auto created ?
I was able to overcome this issue by adding -drop_state while starting iroha daemon.

Connection error for cassandra and influxdb when using docker-compose

I am using docker-compose for influxdb and Cassandra for my application but when I am trying to run application locally on my mac system I am getting below error - I am new for both so not sure where to make the changes for IPs for both docker images.
for Cassandra -
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused"), '::1': error(99, "Tried connecting to [('::1', 9042, 0, 0)]. Last error: Cannot assign requested address")})
For Influxdb - when trying to create a user programmatically
curl: (6) Could not resolve host: influxdb

Cannot connect to my PostgreSQL server remotely from chainlink node terminal

I have tried everyting to connect my Chainlink node up to my postgresql database with no luck. I have scoured the interwebs for answers to no avail...
Here is the error message I am receiving:
[ERROR] failed to initialize database, got error failed to connect to `host=/tmp user=root database=`: dial error (dial unix /tmp/.s.PGSQL.5432: connect: no such file or directory)
Here is my .env file:
ROOT=/chainlink
LOG_LEVEL=debug
ETH_CHAIN_ID=42
MIN_OUTGOING_CONFIRMATIONS=2
LINK_CONTRACT_ADDRESS=0xa36085F69e2889c224210F603D836748e7dC0088
CHAINLINK_TLS_PORT=0
SECURE_COOKIES=false
GAS_UPDATER_ENABLED=true
ALLOW_ORIGINS=*
ETH_URL=wss://kovan.infura.io/ws/v3/id...
DATABASE_URL=https://chainlink-db-url://postgres:Password#chainlink-kovan:5432
I have tried every configuration of the connection string. Also I am able to connect to the db via pgAdmin no problem and the dbs are publicaly accessible.
The postgresql database is on AWS.
Please change the syntax of your DATABASE_URL to:
DATABASE_URL=postgresql://"username":"password"#"public-ip-pg-server":5432/"database-name"
just change:
"username" : you need to configure a new user, because the default/admin user postgres will not work for it.
"password" : password of the user
"public-ip-pg-server" : the public ip address of your postgresql-server
"database-name" : the name of your database
PS: delete all " in your syntax (;
Here is the link to the official documentation: https://docs.chain.link/docs/connecting-to-a-remote-database/

I cant connect to MongoDB Atlas

I tried to connect with
*mongo "mongodb+srv://cluster0.mi3o1.mongodb.net/test" --username cristian* in the shell.
But instead, it looks like it's trying to connect with:
*mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb*
I am getting the error
*Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: No connection could be made because the target machine actively refused it. :
connect#src/mongo/shell/mongo.js:374:17
#(connect):2:6
exception: connect failed
exiting with code 1
bash: mongodb+srv://cluster0.mi3o1.mongodb.net/test: No such file or directory*
I have created the cluster, database access with admin role user cristian, whitelisted both my IP and all IPs 0.0.0.0/0, created a new database, loaded sample databases, opened ports 27015,27016,27017 and tested on portquiz.net.
I added a PRTSCN.
Please help!
terminal prtscn
Thank you very much D. SM for your help, it looks like it was a problem with my .bash_profile. When i did the copy and paste for the 2 paths i dont know why the terminal writed the last " on another row and got some spaces between. I rewrited the 2 rows with no space like this:
alias mongod="/c/Program\ files/MongoDB/Server/4.4/bin/mongod.exe"
alias mongo="/c/Program\ Files/MongoDB/Server/4.4/bin/mongo.exe"
and it worked.