grpc Trying to connect an http1.x server - node.js

I have Node.js grpc server and Node.js grpc client. My grpc server is insecure server, and I already tested my grpc server using my client in local.
But I deployed to kube using nginx ingress controller and network load balancer then I got error.
{
"error": "14 UNAVAILABLE: Trying to connect an http1.x server"
}
The odd thing is when I using grpcurl, then I could get success result.
I am using this script.
$ grpcurl -insecure -proto my.proto grpc.example.com my.grpc.package/service
Is it problem because of my server? Or my client is incorrect?

Usually that msg is result of using the wrong port.
In my case the service was :
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
foo-name ClusterIP 10.0.8.132 <none> 5556/TCP,5557/TCP 123d
I was forwarding my port to 5556 and I got the same error msg.
I changed my port to forward from 5557 and it worked fine.

Related

Failed to complete tunnel connection error with ngrok

Failed to complete tunnel connection
The connection to http://cc1e064782fc.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:80.
Make sure that a web service is running on localhost:80 and that it is a valid address.
The error encountered was: dial tcp [::1]:80: connectex: No connection could be made because the target machine actively refused it.
Hi, I was setting up ngrok and got this error, I disabled the firewall too.
Take a look at this video where I show you the error.
https://youtu.be/uP4B79w4s7c
Its kind of a message that ngrok successfully created tunnel to your pc at port 80 but there is no service running at that port in your OS, Mostly people run a web server at 80 but you can run any service at that port.
So lets assume you are running a web server in your OS on port 80 then you can access that web server from anywhere on the internet using that ngrok tunnel.

Unable to deploy Django App to google cloud app engine with MySQL database instance

The response I get is
(base) bukenya#bukenya-HP-EliteBook-8460p:~/Downloads/DjangoApplications/ecommerce$ ./cloud_sql_proxy -instances="jumanji-280508:us-central1:ecommerce-instance1"=tcp:3306
2020/06/24 18:35:50 failed to setup file descriptor limits: failed to set rlimit {&{8500 4096}} for max file descriptors: invalid argument
2020/06/24 18:35:53 listen tcp 127.0.0.1:3306: bind: address already in use
You've already got a MySQL instance running on that machine looks like.
Try running the proxy like this:
./cloud_sql_proxy -instances="jumanji-280508:us-central1:ecommerce-instance1"=tcp:3308
And then have your application connecting on port 3308 instead of 3306 (outgoing it still connects with the same port, that tcp=3308 is just telling the proxy which port to listen on).

Which HOST+PORT to use for NodeJS app on OpenShift?

I can't get my NodeJS-app working on OpenShift. Everywhere it is written to use the env. variables
OPENSHIFT_NODEJS_PORT
OPENSHIFT_NODEJS_IP
but they are not present in my pod. If I just listen on some other IP and PORT (e.g. on port 3000 of 127.0.0.1), the app successfully deploys but does not receive any requests (and also cannot be reached from the exposed address). Output of the printenv command in the terminal of my pod running the NodeJS app is in the attached pictures (sorry, did not figure out how to copy text from the web terminal).
Output of printenv, 1
Output of printenv, 2
All variables having something to do with NODEJS_* indicate the IP 172.30.72.54, and PORT 8080. However, if I use these, I get a "listen EADDRNOTAVAIL" error.
Btw, also the OpenShift CLI indicates the same IP and PORT:
$ oc get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
mongodb ClusterIP 172.30.20.188 <none> 27017/TCP 2d
nodejs ClusterIP 172.30.72.54 <none> 8080/TCP 2d
So by now, I don't have any clue and can't find any information about what IP and PORT to use for my NodeJS app. Thanks for any help!

Socket.io, connect to socket inside docker container

My app is using websocket with Socket.io library. On the fronted, I open a connection to a backend socket like this :
io.connect(window.location.origin)
Everything is working fine when my backend is running on my computer. But when I run it inside a docker container, I get this error on my client:
WebSocket connection to 'ws://localhost/socket.io/?EIO=3&transport=websocket' failed: Invalid frame header
Figured out that I must make the socket listen on '0.0.0.0'

502 Gateway Error on AWS - API

I am creating a test web app and have deployed it to AWS Ubuntu server using nginx..
I am getting a 502 Bad Gateway error when it tries to reach my API..
I am new to this and have started node.js and all seems to working fine except when I want to perform an API call to mongodb to read or write information. it is working fine locally so I am at a loss....
GET http://ec2-54-72-145-112.eu-west-1.compute.amazonaws.com/api/rest/golf 502 (Bad Gateway)
this is nginx server config
location /xxxxxxxxxxxxxxx{
alias /home/ubuntu/xxxxxxxxxxxxxx/site/public;
}
location /api/ {
proxy_pass http://127.0.x.1:8180/api/;
}
..
I know I may not be giving enough info but hopefully someone has an idea..
Thanks!
The nginx error message HTTP 502 indicates the nginx is working fine but cannot reach your specified proxy. So I'd suggest you to check whether the port and binding IP are correct.
You can check which ports are bound by which application using this command on your Ubuntu machine:
netstat -tulpen
You should see a line with the column "Local Address" and in your case the value 127.0.x.1:8180. If it's not there try to figure out which port is bound by your node application and reconfigure the nginx to use that port.

Resources