DCOS Marathon-LB returns 503 - haproxy

I deployed application 1 on service port 10101. It's an external facing app with label HAPROXY_0_VHOST=vhost1.xxx.xxx. And it works with no problems.
Then I deployed a similar application 2 on service port 10102, with HAPROXY_1_VHOST=vhost2.xxx.xxx. I read Marathon-LB's document and this is my understanding of how to deploy 2 apps on different VHOST. However, curl http://vhost2.xxx.xxx returns HTTP/1.0 503 Service Unavailable.
I confirmed that application 2 is running normally by checking the result from curl marathon-lb.marathon.mesos:10102 on DCOS master node.
Did I configure VHOST incorrectly? Or something else was wrong?

Figured this out: the app for vhost2 should be labeled HAPROXY_0_VHOST=vhost2.xxx.xxx instead of HAPROXY_1_VHOST=vhost2.xxx.xxx. The documentation is note clear here.

Related

Nginx Proxy Manager redirects hosted website to 502 Bad Gateway

I have a website running where I use Nginx Proxy Manager to redirect to this website. However, as soon as I hit my website I get the following message:
Does anyone have a clue what is happening here?
Finally, I came to the following conclusion. I think from my experience it can mean two things:
Either your website/docker container is not running
Or Nginx cannot find an index.html file on the main root of web address 'example.com'.
However, hostinger.com points out the following:
Unresolved domain name
Server overload
Browser issues
Home-network equipment error
Firewall blocks
So make sure that index.html is present for your website and you have trouble shooted your container where you are 100% sure that docker container has no exceptions, errors and runs perfectly fine. Try use something like 'docker-compose logs' where the docker-compose.yml is located (this only works for a running docker container)

Getting 503 error after every 30 seconds with akka and node js env

we have created one api to export patient details in csv file, this export request takes 2.5 min to execute.
we are using below technology for this app: Scala, akka, nginx and react/node js as front end.
when i will hit on export link, request got executed and able to see in logs.
but immediately after 30sec got error on browser console GET /export/request 503 (service unavailable ) with java script error in promise block.
after refering akka documentation i have increased ideal-timeout setting to 240s.
application.conf
http {
server {
request-timeout: 240s
idle-timeout: 240s
}
}
and it works on my local/development env. /export/ request was executed in 2 min.
after deploying this change at TEST env. issue is still there getting 503 after 30 sec.
on TEST env. application is running with docker env.
request flow/application setup:
Internal AWS load balancer => EC2 instance => nginx proxy (listing :80) => front end app (react js app) => backend (scala and akka)
i have not found any configuration key which has set to 30s.
Could you please help me with this ?
Many thanks
It seems your problem is on any intermediary proxy. You can perform your request with curl and check the response header Server:
curl -v -s -o /dev/null your_hostname/export/request
If it were akka you'd see a line as follows:
< Server: akka-http/10.2.4
Hopefully you can get more insights on your issue with this technique

"host not allowed" error when deploying a play framework application to Amazon AWS with Boxfuse

I am trying to deploy a simple web application written using Play Framework in Scala to Amazon web service.
The web application is running OK in development mode and production mode in my local machine, and I've changed its default port to 80.
I used Boxfuse to deploy to AWS as suggested.
I first run "sbt dist"
then "boxfuse run -env=prod"
Things went well as desired. The image is fused and pushed to AWS. AMI is created. Instance was started and my application was running.
i-0f696ff22df4a2b71 => 2017-07-13 01:28:23.940 [info] play.api.Play - Application started (Prod)
Then came the error message:
WARNING: Healthcheck (http://35.156.38.90/) returned 400 instead of 200. Retrying for the next 300 seconds ...
i-0f696ff22df4a2b71 => 2017-07-13 01:28:24.977 [info] p.c.s.AkkaHttpServer - Listening for HTTP on /0.0.0.0:80
i-0f696ff22df4a2b71 => 2017-07-13 01:28:25.512 [warn] p.f.h.AllowedHostsFilter - Host not allowed: 35.156.38.90
The instance was terminated after repeated try after 3 minutes. It gave a warning like:
Ensure your application responds with an HTTP 200 at / on port 80
But I've made sure the application responds in local machine, and I tried both Windows and Ubuntu, all works well.
Also, running "boxfuse run" on local machine, I can connect to it using "http://localhost", but still have the error.
Hope someone with experience can give me some suggestions. Thanks in advance.
ps: not sure if relevant, I added these settings to application.conf
http {
address = 0.0.0.0
port = 80
}
Judging from the error message, it looks like the problem might be related to play.filters.hosts.allowed not set up in application.conf. The filter lets you configure which hosts can access your application. More details about the Play filter is available here.
Here's a configuration example:
play.filters.hosts {
allowed = ["."]
}
Note that allowed = ["."] matches all hosts hence would not be recommended in a production environment.
As stated in the Boxfuse Play Documentation:
If your application uses the allowed hosts filter you must ensure play.filters.hosts.allowed in application.conf allows connections from anywhere as this filter otherwise causes ELB healthchecks to fail. For example:
play.filters.hosts {
allowed = ["."]
}
More info in the official Play documentation.

Clearing a faulty service in WSo2

I have recently built a proxy service in WSo2 ESB that was not fully implemented. When I saved it generated a fault service message and a link was provided to a faulty service group at the top of the ESB console. Since then, I have corrected the service and it has been transferring files as I have intended. However the service does not show in the initial list of services and I have to click on the link 7 deployed service group(s) to now view it in the proxy list.
Here is what the link looks like:
6 active services. 7 deployed service group(s). 1 faulty service(s).
When I click on the 1 faulty service(s) I see the following but cannot delete it in an attempt to clear it.
*Faulty Service Actions
RenZipExtractProxy proxy
Unable to configure the service RenZipExtractProxy for the VFS transport: Service doesn't have configuration information for transport vfs. This service is being marked as faulty and will not be available over the VFS transport.*
How do I clear this faulty service issue? My updated service works fine but I continue to get the faulty service situation as stated above.
You can manually delete deployment artifacts in the directory <ESB>/repository/deployment/server/synapse-configs/default/proxy-services
I have noticed that when we configure WSO2 esb with VFS protocol and do not provide any parameter then it is going under Faulty service. I resolved this problem after mentioning VFS related parameters.
Please refer https://docs.wso2.com/display/ESB481/VFS+Transport
Note: If we try to delete faulty proxy service from console then also it will not deleted. Please try to delete it from file system.
<ESB_HOME>/repository/deployment/server/synapse-configs/default/proxy-services

HTTP 503 error after first deploy

After my first deploy on Next dotCloud I saw a 503 error when visiting the site. Haven't found anything in the logs.
The problem was that no web container was running.
The solution is to call
$ dcapp <app name>/default deploy --container 1