Custom Services and NATS Connection Issues - cloud-foundry

I am creating a custom service in on a single node instance of CloudFoundry which I build from vcap_dev_setup. I have followed these instructions to get an idea of what todo when creating new services.
When I try to start the new service gateway by running 'vcap_dev start service_gaeway' I get the following error:
Exiting due to NATS error: Could not connect to server on nats://nats:nats#172.16.4.146:4222/
The configuration for the :mbus property on the service_gateway is fine and is identical to that of all of the other services which start without issue.
Does anyone know of any reason why a single service could not connect to nats correctly assuming the configuration is correct?
Thanks
Chris

I am not sure why this would be the case, assuming other services are able to connect to NATS
If you are willing to share your changes to VCAP as a patch I will happily take a look, what service are your looking to integrate?
I would also advise posting your query to the VCAP dev google group at https://groups.google.com/a/cloudfoundry.org/forum/?fromgroups#!forum/vcap-dev

Make sure you have NATS running on the IP address: 172.16.4.146 Port: 4222
The IP Address should most likely be your localhost. DHCP most likely has assigned another IP addresst other than 172.16.4.146. Make sure your computer has 172.16.4.146 as IP address. You can check that by doing ifconfig.

The tricky problem may be caused by a version conflict with misleading exception, you could have a try with the latest code;

Related

After SSH tunneling into localhost:6688 I get "site can`t be reached - ERR_CONNECTION_RESET"?

I finally decided to run a chainlink node on kovan, so I followed this link https://www.youtube.com/watch?v=t9Uknfw27IU&list=LL&index=8&t=555s on how to set up the node and after a few hours of work I made it happen. So after SSH tunneling into localhost:6688 I got the GUI for the chainlink operator and wrote in the password and got in.
So the next day I decided to program some jobs on the node and did the same thing as last day and got the
site can`t be reached - ERR_CONNECTION_RESET when SSH tunneling in localhost:6688 and I can see that the CL node is running in the linux box with no errors and note I dont own a router.
What I tried so far:
-switching browsers
-temporarily disabled the windows firewall
-manually opening up the port 6688
-deleting the VM instance on Google cloud platform and creating a new one
-double checking the .env file if database and other info from GCP and infuras
WSS were correct
-check the proxy settings
-cleared browser history and cookies
-deleted Winsock catalog entries
None of this has helped to resolve this issue, any help or suggestions would really be appreciated...
Managed to fix the issue myself, If anyone has the same error try this: go to your GCP and go to VM istances - firewall and add an exception for port 6688, then copy the externalIP , add it as your localhost= externalIP :6688...worked for me.

Checking my MongoDB and getting an unusual dbs

So today I was in my MongoDB and I type in show dbs. Other than my usual dbs there is an additional hacked_by_unistellar. Anyone might know what I can do here? It sounds like I have been hacked unless this is some terrible easter egg I have come across. Please advise. Thank you.
you should close your default mongoDB Port 27017. Got the same problem
I had the same on an old backup server as well.
All I can say is that it is not related to an open, public mongodb port. The mongo server is running on localhost only, but has no access password (under FreeBSD 12).
Obviously, running with a public default port and no password is just what it is, but that's not the answer.
The only ports open on the server is SSH, 80/443 (running Apache 2.4.x) and a node service at port 3xxx, along with Mongo Express (also password protected).
There is also a MySQL server installed with no password, bound to localhost only, but that remained untouched.
It seems more likely that this is a vulnerability somewhere else, that is exploiting a non-protected local connection to mongodb.
Password protecting mongo might protect the database, but does not identify the point of access, which is worrisome.
All of my data is gone!
Well, my only action now is to close any more open connections to my DB instance. My database required a password to access (so, being passwordless was not the issue).
However, I just added a Basic Firewall to bump up the security a bit, at least, now I can assume no remote access can connect directly to my DB instance.
I followed this thread
Jump to Step Seven — Set Up a Basic Firewall part of the post.
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04
Also, you can allow only some IP addresses to your DB instances. By following the instructions at https://www.linode.com/docs/security/firewalls/configure-firewall-with-ufw/#advanced-rules
I use this personally on my main instance where I trust connections would come only from one IP.
Hope this helps someone temporarily till a better fix emerges.
Are your MongoDB password protected? if so, you can access the Database with only an IP address and the port.
If your MongoDB isn`t password protected, please do it asap! your info is exposed to everyone...
Even big companies do this mistake from time to time as well...

Port mapping in Windows Server 2016 - Docker

I have been trying to setup Docker in Windows Server 2016 in an AWS instance to run an IIS program.
From this question,
Cannot access an IIS container from browser - Docker, IIS has been setup inside a container and it is accessible from the host without port mapping.
However, if I want to allow other users from the Internet/Intranet to access the website, after Google-ing it, I guess we do need port mapping...
The error I have encountered in port mapping is given in the above question so... I guess using nat is not the correct option. Therefore, my team and I tried to create another network (custom/bridge) following instructions from
https://docs.docker.com/v17.09/engine/userguide/networking/#user-defined-networks
However, we cannot create a network as follows:
; Googled answer:
https://github.com/docker/for-win/issues/1960
My team guessed maybe its because AWS blocked that option, if anyone can confirm me, please do.
Another thing that I notice is: when we create an ECS instance in AWS,
So... only default = NAT network mode is accepted in Windows server?
Our objective: put the container hosted IIS application to Internet/Intranet in Windows Server 2016...
If anyone has any suggestion/advice, please tell me, many thanks.

AWS, Load Balancer 504 error after a few requests

I am repeating a question that I posted at https://forums.aws.amazon.com/thread.jspa?threadID=275855&tstart=0
to reach out more people.
Hi,
I am trying to deploy a REST service in AWS. The current architecture is:
Domain name (Route 53) -> Load Balancer -> Single EC2 instance (bound to an Elastic IP). And I use TLS/SSL certificate issued by a Certificate Manager.
The instance is Ubuntu 16.04 machine, and the service is implemented with (bare) Vert.X (==no proxy server).
However, 504 Error (gateway timeout) occurs after a few different requests (each of which takes <1s) in a series, and then it does not respond. The requests do not reach the server instance after a few requests. I checked that it happens in the same way when I access both the domain name and the load balancer directly. I have confirmed that the exact same scenario is working with direct URL.
I run up a dummy server returning "hello world" and it's working okay with the load balancer. The problem should be caused by something no coherent between the load balancer and the server code, but I can't get where to start.
I have checked several threads complaining the 504 errors, and followed some of the instructions, but they do not work. Especially I set keep-alive option in Vert.x and set the idle time longer than the balancer's. As the delays are not longer than the idel time with the direct communication, I believe it is not the problem anyway. I have checked the Security Groups also and confirmed the right ports are open. (The first few requests are working, so it must not be the problem also.)
Does any of you have a sense where I should start looking at? Even better, know the source of the problem?
Thanks in advance.
EDIT: I just found the issue in some of the code. I've answered myself below. Thanks for reading!
Found the issue in my code. Some of the APIs (implemented by my colleague...) was not flushing the buffer of HTTP responses in the server.
In Vert.X Java, it was resp.end().
It was somehow working with direct access probably the buffer was flushed at some point, but that flush seems not caught by the load balancer.
Hope nobody experiences this, but in case...

Spinnaker on AWS: Create application hangs

I'm having trouble creating a new application on Spinnaker after following the quickstart guide for AWS. The server runs fine on Port 9000 and I've enabled Port 8084 (via AWS Security Group) for Deck/Gate to run.
However, when I try to create a new project on the UI, the menu hangs like shown here.
I've tried configuring and running this setup several times now, however I cannot get past this part. Can someone help?
Thanks in advance.
So I worked on things some more and was able to fix my problem. I realized that Spinnaker needs Authentication set up as mentioned in this FAQ.
I opted to expose my Spinnaker to end users (likely to change in the near future). While I enabled Gate and Deck to listen on 0.0.0.0, I did not associate a domain name with them which caused things not to work. After associating them with a domain name, I was able to make a new application.