How to use cube.js to connect to specific redis - redis

If I want to connect cube.js to my own built redis, what should I do.
I use CUBEJS_REDIS_URL which is claimed by official document. So, for example, if my own redis port is 31.71.195.218.
Should I use write CUBEJS_REDIS_URL=redis://31.71.195.218:6379/0 in my backend .env file? I use many combination like, redis://31.71.195.218:6379, redis://31.71.195.218, ecc.
However, they all show the following error message:
process in uncaughtException: { Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1117:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 6379 }
in my terminal. It seems that this environment variable CUBEJS_REDIS_URL isn't used.

I think cube.js doesn't use your configuration in DEV mode, Try setting CUBEJS_DEV_MODE=false in your env file

I think you need to pass the env variables into the Docker container. Please see this example in the documentation: https://cube.dev/docs/deployment/platforms/docker

Related

Connection to SSH from a pipeline in Azure DevOps is still not working

I saw few other posts (in particular this one) about it but there are from last year. I still have this issue right now. I opened the Preview features from the User settings but I can't turn off this feature.
My pipelines use SSH connection to run some commands on a virtual machine (basically, pull a Docker image).
All my pipelines are failing. How can I fix it or update the SSH connections?
Update
I set up the Service connection
and I use it in my pipelines with this YAML code:
- task: SSH#0
displayName: 'SSH: stop shinyproxy'
inputs:
sshEndpoint: $(server)
commands: |
echo $(pwd) | sudo -S docker stop shinyproxy
failOnStdErr: false
continueOnError: true
All pipelines, new and old, get the same error
##[error]Failed to connect to remote machine. Verify the SSH service connection details. Error: Error: All configured authentication methods failed
at doNextAuth (/home/vsts/work/_tasks/SSH_91443475-df55-4874-944b-39253b558790/0.213.0/node_modules/ssh2/lib/client.js:803:21)
at tryNextAuth (/home/vsts/work/_tasks/SSH_91443475-df55-4874-944b-39253b558790/0.213.0/node_modules/ssh2/lib/client.js:993:7)
at USERAUTH_FAILURE (/home/vsts/work/_tasks/SSH_91443475-df55-4874-944b-39253b558790/0.213.0/node_modules/ssh2/lib/client.js:373:11)
at 51 (/home/vsts/work/_tasks/SSH_91443475-df55-4874-944b-39253b558790/0.213.0/node_modules/ssh2/lib/protocol/handlers.misc.js:337:16)
at Protocol.onPayload (/home/vsts/work/_tasks/SSH_91443475-df55-4874-944b-39253b558790/0.213.0/node_modules/ssh2/lib/protocol/Protocol.js:2025:10)
at AESGCMDecipherNative.decrypt (/home/vsts/work/_tasks/SSH_91443475-df55-4874-944b-39253b558790/0.213.0/node_modules/ssh2/lib/protocol/crypto.js:987:26)
at Protocol.parsePacket [as _parse] (/home/vsts/work/_tasks/SSH_91443475-df55-4874-944b-39253b558790/0.213.0/node_modules/ssh2/lib/protocol/Protocol.js:1994:25)
at Protocol.parse (/home/vsts/work/_tasks/SSH_91443475-df55-4874-944b-39253b558790/0.213.0/node_modules/ssh2/lib/protocol/Protocol.js:293:16)
at Socket. (/home/vsts/work/_tasks/SSH_91443475-df55-4874-944b-39253b558790/0.213.0/node_modules/ssh2/lib/client.js:713:21)
at Socket.emit (node:events:527:28) {
level: 'client-authentication'
I have never had this issue before.
Based on the other post, highlighted by Antonia, the solution has to be applied on the Ubuntu machine.
To fix it, open Terminal and edit /etc/ssh/sshd_config and, at the end of it, add this line
/etc/ssh/sshd_config
After that, restart. It is working for me.

SSH, RabbitMQ, Protocol 'inet_tcp': register/listen error: econnrefused

When I try to run on my server machine command
./rabbitmq-server
I the get following:
WARNING: Removing trailing slash from RABBITMQ_LOG_BASE
Removing trailing slash from RABBITMQ_MNESIA_BASE
Protocol 'inet_tcp': register/listen error: econnrefused
Backstory:
This is my first time I'm trying to install RabbitMQ-Server just using ssh.
Step-by-step what I did so far would be:
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.0/rabbitmq-server-3.6.15.zip
unzip rabbitmq-server-3.6.15.zip
nano Makefile # change prefix to rabbitMQ in home directory PREFIX ?= /home/user/rabbitmq
gmake
gmake install
cd ~/rabbitmq/lib/erlang/lib/rabbitmq_server-3.6.15/sbin/
export RABBITMQ_MNESIA_BASE=/home/user/rabbitmq/lib/erlang/lib/rabbitmq_server-3.6.15/sbin/
export RABBITMQ_LOG_BASE=/home/user/rabbitmq/
./rabbitmq-server
And here comes the error. I was told that maybe "unlocking" ports would do the trick, but
I don't know how to do that
I don't know if that's the case
The error Protocol 'inet_tcp': register/listen error: econnrefused means that the Erlang node tried to connect to epmd (the Erlang port mapper daemon) to register its name, but failed to connect.
That shouldn't happen: epmd should be started when the Erlang node starts up. You could try running epmd manually in the shell, and see if it reports any errors.
If it says failed to bind socket: Operation not permitted, check if something else is using port 4369 (which is the port that epmd tries to listen on).

Hyperledger peer creation error

I'm trying to create a genesis block with the command:
peer channel create -c myc
following the install_instantiate.md file.
However I keep getting an error-message that there is no ordering service endpoint created. Somebody who can help me with this please?
I guess you are working with Fabric 1.0.0-alpha. There
the API has been changed so that you have to pass an orderer now.
peer channel create -o orderer0:7050 -c mychannel
Please have a look at the following document:
https://fabric-rtd.readthedocs.io/en/latest/getting_started.html#create-channel
Have you tried to specifiy the orderer address ?
If you are using docker :
CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc
If it doesn't work, try the Getting Setup, or see the Troubleshooting section

Redis as service fails with error code 87

I have installed Redis-64 using the chocolately package. When I try and install redis as a service on windows with command:
redis-server.exe --service-install
I get the following error:
# HandleServiceCommands: system error caught. error code=1073, message = CreateService failed: unknown error
I have also tried just executing the exe on its own, but get another different error:
# Creating Server TCP listening socket *:6379: bind: No such file or directory
Has anyone else got this error before?
Go to redis path and then
1) C:\Program Files\Redis>redis.windows.conf it will open file
2) Change port to 16379(higher) then run
3) C:\Program Files\Redis>redis-server.exe redis.windows.conf
I had the same error when running the exe. (No such file or directory)
It worked when using a higher port in redis.windows.conf:
port 16379
and then run
c:\Program Files\Redis>redis-server.exe redis.windows.conf
What is meant by run
cd to c:\Program Files\Redis
then:
run redis-server.exe redis.windows.conf on command prompt
Changing the port to higher has solved the error for me.
Change the port in two files
redis.windows-service.conf and redis.windows.conf
And then run
c:\Program Files\Redis>redis-server.exe redis.windows.conf
c:\Program Files\Redis>redis-server.exe redis.windows-service.conf
After run you can see below description
For me the default port was already in use. I checked this by:
Pressing Windows + R
Typing resmon.exe
Going to Network > Listening Ports
There I saw that I already had a redis process running on port 6379, so I:
Opened Task Manager
Found redis-server.exe
Right click > End task
You can also end the process by running redis-server --service-stop.
Then redis-server --service-start worked as expected, no need to change config files.

webpack-dev-server can't find localhost

I'm trying to get started with React using webpack, but keep running into an error when I try to set up webpack-dev-server. I ran
npm install webpack-dev-server
followed by
webpack-dev-server
and the command line returns the following:
events.js:154
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND localhost
at errnoException (dns.js:26:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
Any clues on what is happening here?
I don't really know how webpack works to try and search for the root of the problem, but I've also been developing a website using PHP at port 80 with MAMP, I don't know if this is maybe part of the issue?
Solved, turned out my hosts file (found under /etc/hosts on a mac) had one line missing and so webpack couldn't find localhost. I restored it to its default following these instructions and it now works!
Make sure your /etc/hosts file includes localhost.
Open /etc/hosts
$ sudo vi /etc/hosts
Copy and paste this, if it's missing:
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
Did not work for me even after restoring the hosts file and trying with a different port. The way I made it to work was to give a custom host (127.0.0.1) and port (3001 or any other available) when starting the server:
webpack-dev-server --host 127.0.0.1 --port 3001
The most common reason for that error is that you have something else already using that port. Try starting it on another port.
webpack-dev-server --port 3001
Also check if /etc/hosts have 127.0.0.1 pointing to localhost as well.
Also encountered the same error and nothing fixed it.
It appears, in my case, that I accidentally "corrupted" the /etc/hosts file by been able to write to it without the sudo permission.
The clue was when I cat /etc/hosts the output was one messy line. I deleted and re-created the file as sudo, with the #lizzie-cd link and all went back to normal
In latest mac and linux os , the webpack dev server wokinnly only on adding the
host: "127.0.0.1"
inside the devServer in the webpack.config
Hosts file was fine. Going into web/dev.js and updating the file to the following fixed this issue for me. Still not sure why.
const webpack = require('webpack');
const merge = require('webpack-merge');
const path = require('path');
const { buildConfig, APP_PATH, WEB_PATH } = require('./common');
module.exports = (env, argv) => (
merge(buildConfig(env, argv), {
entry: path.join(WEB_PATH, 'index.hmr.js'),
devtool: 'inline-source-map',
plugins: [
new webpack.HotModuleReplacementPlugin(),
],
devServer: {
contentBase: APP_PATH,
openPage: '',
inline: true,
stats: 'minimal',
open: true,
port: 3001,
hot: true,
host: "127.0.0.1"
},
})
);
Very strange. I had explicitly add the dev server port to my hosts file. E.g.
127.0.0.1 localhost:8001
Then npm run dev works again.
If that still does not work for you you could try removing node_modules completely and re-installing fresh.
rm -rf node_modules/
npm install # Or `yarn`