Cloud foundry SSH not working - node.js

I am not able to make SSH working.
I checked that SSH is enable on the Application and Space level.
But when i ran
cf ssh "MY-APP-NAME" i get the following error:
FAILED
Error: SSH session allocation failed: ssh: unexpected packet in response to
channel open: <nil>
I also tried to connect without CLi and using the command
ssh -p 2222 cf:abcdefab-1234-5678-abcd-1234abcd1234/0#ssh.MY-DOMAIN.com
But when i entered the password the server stopped the connection (i used Putty).
I am trying to access with SSH because i need to launch npm install to install the dependencies of my application.
Thank you for your help

There is no need to ssh into an app to install dependencies.
Please have a look at Swisscoms Getting Started Guide for Node.js:
https://docs.developer.swisscom.com/tutorial-nodejs/index.html
The section 'Declare App Dependencies' (https://docs.developer.swisscom.com/tutorial-nodejs/dependencies.html) shows you how you specify the dependencies in a file called 'package.json'. This will then be automatically installed by the nodejs buildpack (https://github.com/cloudfoundry/nodejs-buildpack).

Related

Is the server running on that host and accepting TCP/IP connections?

I am working on a Django project as a Front-End developer. I am getting " django.db.utils.OperationalError: connection to server at "13.234.81.119", port 5432 failed: Connection timed out (0x0000274C/10060)
Is the server running on that host and accepting TCP/IP connections?"
many times when I try to run the server using the command python manage.py runserver on VS Code
Because of this, I have to restart the server, and sometimes luckily server works.
I did the following things to resolve the problem:
NOTE: I am using windows 11.
1) deleted temporary files using the command %temp%
2) reinstalled psycopg 2.9.2
3) I reset the TCP/IP settings in services on my PC.
but the problem did not solve.
I am attaching the screenshots of the complete error log. Please help me to resolve the issue, I will be grateful to you
Is your Postgres running on the port you specified if not?
Go inside the bin folder in the C drive where Postgres is installed. run the following command in git bash or Command prompt:
pg_ctl.exe restart -D "<path upto data>"
Example
pg_ctl.exe restart -D "C:\Program Files\PostgreSQL\9.6\data"

Error connecting to docker container

I installed a service on a remote Linux computer using docker. I used the following commands
git clone https://github.com/OpenVidu/openvidu-tutorials.git
npm install -g http-server
http-server openvidu-tutorials/openvidu-getaroom/web
docker run -p 4443:4443 --rm -e openvidu.secret=MY_SECRET -e openvidu.publicurl=https://187.84.228.66:4443 openvidu/openvidu-server-kms
But when I try do connect at the first time, I received the follow error menssage:
"ERR_EMPTY_RESPONSE", and sometime "ERR_CONNECTION_CLOSED"
I used the following diagnostic command in Linux computer “docker ps” and received the following response:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
21b0620266cd openvidu/openvidu-server-kms:latest "/usr/bin/supervisor 5 days ago >Up 5 days 8443/tcp, 8888/tcp, 0.0.0.0:4443->4443/tcp, 9091/tcp sick_ritchie
What is wrong? How can I solve this?
I'm not sure sure what causes this, but when I had the same problem (with different http server) I changed listening on particular ip address (which was 127.0.0.1 in my case) to listening on all interfaces - 0.0.0.0.
I mean http server configuration, not Docker configuration.

How to run `OpenFin Process Manager`

Refer to https://github.com/openfin/process-manager
Based on the README.md, I have done the following steps:
npm install
node server
I am able to see the following message from terminal(windows 7)
$ node server
Express server listening on port 5040
How do I launch the application?
I have tried to point to the localhost:5040 through chrome browser and ONLY see three tabs 'Processes', 'Cache', 'Logs' without any information.
How can I fix the issues?
npm i -g openfin-cli
openfin -l -c http://localhost:5040/app_local.json
The server script is running a local express server that hosts an OpenFin enriched web app so all you need to do it launch it on OpenFin, which in the case above we are doing with the CLI.
You can also use a node module to launch i.e. here

Can't run Rocket.Chat server on Ubuntu without Docker

I've been following this tutorial to install Rocket.Chat on Ubuntu:
https://github.com/RocketChat/Rocket.Chat/wiki/Deploy-Rocket.Chat-without-docker
Everything looks good until I try to run the server with node main.js:
Error: failed to connect to [localhost:27017]
at Object.Future.wait (/home/gregoire/Rocket.Chat/programs/server/node_modules/fibers/future.js:398:15)
at new MongoConnection (packages/mongo/mongo_driver.js:213:1)
localhost could also be 127.0.0.1 or my IP address, it doesn't change anything. Sounds like an error coming from MongoDB.
So I tried to run with sudo and the error I'm getting is different:
Error: MONGO_URL must be set in environment
I follow the tutorial, this variable has been set using export:
export ROOT_URL=http://localhost/
export MONGO_URL=mongodb://localhost:27017/rocketchat
export PORT=80
EDIT:
I needed to start mongod to then run the main.js. But I also got an error:
mongodb failed to connect to 127.0.0.1
I made some research and found that I had a missing folder. I used this command to create it and then started mongod:
mkdir -p /data/db
It worked after that, but it's not implied in the tutorial. I'm currently repeating the setup on a server and I'm having the same problem: /data/db is missing.
Disclaimer: I work for Rocket.Chat.
Are you sure mongodb is running? Can you type mongo and see if you can get into a mongoDB shell? If it's running, can you please confirm it's running on port 27017?
You can also go to https://demo.rocket.chat and join #support channel or #dev, where you'll find quite a few developers willing to help you out.

A Good Explanation of Remotely Debugging NodeJS on EC2

I've seen this post, but it's not quite clear to me.
If I want to debug my NodeJS app running on EC2 (ubuntu 12.04) from my laptop - how do I do it?
I'm running the following on EC2
nodemon --debug app.js
And I've got node-inspector installed on EC2.
When I run the ssh command, I get the following:
C:\>ssh -L 5858:127.0.0.1:5858 ubuntu#ubuntu-aws
The authenticity of host 'ubuntu-aws (XXX.XXX.XXX.XXX)' can't be established.
RSA key fingerprint is ...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ubuntu-aws,XXX.XXX.XXX.XXX' (RSA) to the list of known hosts.
Permission denied (publickey).
First, is that right? I run ssh on my laptop? Then I run node-inspector on EC2? Then I'll be able to connect with Chrome Dev tools from laptop?
And how do I fix that ssh error?
you still have to include your pemfile, like in your example: ssh -i pemfile.key -L 5858:127.0.0.1:5858 ubuntu#ubuntuaws

Resources