Adding tls-version parameter in mysql connection python - mysql-connector-python

while adding tls-versions parameter in mysql-connector-python(8.0.18), throwing exception as Unsupported argument 'tls_versions' at the time creating a connection.
db_config = {
"user": "user",
"password": "pwd",
"database": "test",
"host": "localhost",
"port": "3306",
"tls-versions": ["TLSv1.1"]
}

The tls_versions option is only available in 8.0.19. Please upgrade your Connector/Python installation.
Via pip (recommended way):
pip install --upgrade mysql-connector-python
Or with with the platform packages: https://dev.mysql.com/downloads/connector/python/

Related

Loopback 4 unable to connect to Postgres 13

I am trying to connect with Postgres 13 from loopback 4 but its showing error
Cannot migrate database schema Error: Timeout in connecting after 5000 ms
at Timeout._onTimeout (/Users/mohammad/Work/prithu/prithuPlatform/node_modules/loopback-datasource-juggler/lib/datasource.js:2654:10)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
I tried connecting with pgadmin and its connecting fine and I also tried connecting it with express and its also connecting. It was connecting with earlier system but after changing system and installing Postgres 13 it's not working.
Here is the snapshot of app-db.datasource.config.json
{
"name": "app_db",
"connector": "postgresql",
"debug": true,
"host": "localhost",
"port": 5432,
"user": "adminuser",
"password": "password123",
"database": "testdb",
"ssl": false
}
Finally I figured out what was the problem. It was because I was using node 14. There was no problem with the database. I then install the node 12 and it's working now.
I faced the same issue.
I was putting the wrong password for postgres user in datasource.config, check that.
{
"name": "app_db",
"connector": "postgresql",
"debug": true,
"host": "localhost",
"port": 5432,
"user": "adminuser",
"password": "password123", (maybe this password is wrong)
"database": "testdb",
"ssl": false
}

Strapi EADDRNOTAVAIL error while deploying on Dokku

I am trying to deploy Strapi on a Dokku instance on a Digital Ocean droplet. I originally ran into some issues connecting to the mongo database, but after some trial and error and a lot of review of these docs and this issue, I was able to get it to stop complaining about the mongo connection. Here was my final config/environments/production/database.json
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "mongoose",
"settings": {
"client": "mongo",
"uri": "${process.env.MONGO_URL}",
"database": "${process.env.DATABASE_NAME}",
"username": "${process.env.DATABASE_USERNAME}",
"password": "${process.env.DATABASE_PASSWORD}",
"port": "${process.env.DATABASE_PORT || 27017}"
},
"options": {
"authenticationDatabase": "${process.env.DATABASE_AUTHENTICATION_DATABASE || ''}",
"useUnifiedTopology": "${process.env.USE_UNIFIED_TOPOLOGY || false}",
"ssl": "${process.env.DATABASE_SSL || false}"
}
}
}
}
Here is my config/environments/production/server.json
{
"host": "${process.env.HOST || '0.0.0.0'}",
"port": "${process.env.PORT || 1337}",
"production": true,
"proxy": {
"enabled": false
},
"cron": {
"enabled": false
},
"admin": {
"autoOpen": false
}
}
I believe the original issue was that I was accidentally using the PORT variable for the database instead of the DATABASE_PORT variable.
However, now that I have that worked out I am getting this error:
error Error: listen EADDRNOTAVAIL: address not available <my-host-ip>:5000
I thought maybe there was some wrong port being cached somewhere, but regardless of what I do, I can't seem to get it to work. Do I need to enable ssl? and then add a letsencrypt cert to my domain? am i using the wrong ports? set a proxy in the server.json?
PS. I am using Dokku Mongo. Didn't think that would be an issue considering the dynos don't go to sleep like they would on heroku. Is that an incorrect assumption?
Also, there are other apps running on the droplet. Maybe a proxy problem?

Hyperledger Explorer Error 12 UNIMPLEMENTED: service protos.Endorser

I am trying to run the Hypeledger Explorer for my blockchain network. I have followed the instructions almost word for word using the Hyperldger Explorer
But anytime I do the final call: ./start.sh --- I get a litany of errors
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: 12 UNIMPLEMENTED: unknown service protos.Endorser
at new createStatusError (/home/ubuntu/bludev/blockchain-explorer/node_modules/grpc/src/client.js:64:15)
at /home/ubuntu/bludev/blockchain-explorer/node_modules/grpc/src/client.js:583:15
error: [Client.js]: Failed Installed Chaincodes Query. Error: Error: 12 UNIMPLEMENTED: unknown service protos.Endorser
at new createStatusError (/home/ubuntu/bludev/blockchain-explorer/node_modules/grpc/src/client.js:64:15)
at /home/ubuntu/bludev/blockchain-explorer/node_modules/grpc/src/client.js:583:15
...
And so on. For more info I am using
nodejs 6.9 and PostgreSQL 9.5. This is the way my config.json file looks:
{
"network-config": {
"org1": {
"name": "peerOrg1",
"mspid": "Org1MSP",
"peer1": {
"requests": "grpc://127.0.0.1:7051",
"events": "grpc://127.0.0.1:7053",
"server-hostname": "peer0.org1.example.com",
"tls_cacerts": "/home/ubuntu/bludev/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
},
"admin": {
"key": "/home/ubuntu/bludev/hlcomposer/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp/keystore",
"cert": "/home/ubuntu/bludev/hlcomposer/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp/signcerts"
}
}
},
"host": "localhost",
"port": "3000",
"channel": "mychannel",
"keyValueStore": "/tmp/fabric-client-kvs",
"eventWaitTime": "30000",
"pg": {
"host": "12.109.99.233",
"port": "3000",
"database": "fabricexplorer",
"username": "postgres",
"passwd": "password1"
}}
The problem is your hyperledger network does not have any endorser in network.
try first-network sample from official fabric-samples folder, rebuild the explorer and then try again.

Mopa Bootstrap bundle failing to install

I get this error while trying to install the Mopa bootstrap bundle through command line:
"C:\ProgramData\ComposerSetup\bin\composer.bat" require
mopa/bootstrap-bundle ^3.0
Error:
installation failed reverting ./composer.json to its original content
mopa
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress]
[--no-suggest] [--no-update] [--no-scripts] [--update-no-dev]
[--update-with-dependencies] [--ignore-platform-reqs]
[--prefer-stable] [--prefer-lowest] [--sort-packages]
[-o|--optimize-autoloader] [-a|--classmap-authoritative]
[--apcu-autoloader] [--] []...
Im lost since I`m not getting any explanation of what failed.
So listen here, I have a solution for you. As I see that you are working with composer I'll teach you how to do it.
First you must change your "composer.json" file in your project, adding in "require" section:
"require": {
...
"mopa/bootstrap-bundle": "*",
"twbs/bootstrap": "*",
"knplabs/knp-menu-bundle": "*"
}
(NOTE: "knplabs/knp-menu-bundle": "*" is recommended to put as well when you use twbs).
And then add this repository in the json:
"repositories": [
{
"type": "package",
"package": {
"version": "2.2.1",
"name": "twitter/bootstrap",
"source": {
"url": "https://github.com/twitter/bootstrap.git",
"type": "git",
"reference": "master"
},
"dist": {
"url": "https://github.com/twitter/bootstrap/zipball/master",
"type": "zip"
}
}
}
]
Save and finally, you should execute your composer update(dev) command.
Hope it works!

com.mongodb.MongoException: not talking to master and retries used up

My search is not working now. I guess because my index was not configured for replica set:
curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"db": "mongo",
"host": "local",
"port": "40000",
"collection": "users"
},
"index": {
"name": "api",
"type": "users"
}
}'`
Is there anyway to declare a replica set properly so that elasticsearch can find the master, the way PHP driver does:
$m = new Mongo(
"mongodb://localhost:40000,localhost:41000",
array("replicaSet" => true)
);
so that elasticsearch can automatically fail over to another member.
I solved this simply by updating to the latest version of the client driver.
The previous (minor) version had trouble connecting to the latest mongo server.