Host not found in upstream
I get this error:
2023/02/05 19:21:16 [emerg] 1#1: host not found in upstream "countly-frontend" in /opt/bitnami/nginx/conf/server_blocks/countly.conf:44
and the Nginx config file is like this:
server {
listen 8080;
listen [::]:8080 ipv6only=on;
server_name localhost;
access_log off;
location = /i {
if ($http_content_type = "text/ping") {
return 404;
}
proxy_pass http://countly-api:3001;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location ^~ /i/ {
if ($http_content_type = "text/ping") {
return 404;
}
proxy_pass http://countly-api:3001;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location = /o {
if ($http_content_type = "text/ping") {
return 404;
}
proxy_pass http://countly-api:3001;
}
location ^~ /o/ {
if ($http_content_type = "text/ping") {
return 404;
}
proxy_pass http://countly-api:3001;
}
location / {
if ($http_content_type = "text/ping") {
return 404;
}
proxy_pass http://countly-frontend:6001;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}
Comments
Hello Paolo,
Thanks for reaching out to us!
Can you share the docker file you're using to deploy Countly so that we can check this error further?
Thanks and Regards,
Gia
Hi Gia,
If one just follows your documentation to run the docker-compose version of community edition, Countly simply does not start. It gives a 502 and the nginx log says:
```
2023/02/28 04:44:23 [error] 34#34: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.112.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://192.168.112.3:6001/", host: "localhost:8080"
```
and returns a 502 on running
> curl localhost:${PORT}
It is understandable that you do not provide support to community edition. But at least the basic documentation should work as expected. I am assuming that this is a common issue for all new installations.
This was tested on Ubuntu deployed on AWS EC2. Docker info is below:
```
sudo docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Docker Buildx (Docker Inc., v0.9.1-docker)
compose: Docker Compose (Docker Inc., v2.14.1)
scan: Docker Scan (Docker Inc., v0.23.0)
Server:
Containers: 41
Running: 37
Paused: 0
Stopped: 4
Images: 35
Server Version: 20.10.22
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9ba4b250366a5ddde94bb7c9d1def331423aa323
runc version: v1.1.4-0-g5fd4c4d
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: default
cgroupns
Kernel Version: 5.15.0-1026-aws
Operating System: Ubuntu 22.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.49GiB
Name: ip-<redacted>
ID: UG4Z:FNGB:NKLC:YXDN:MI55:X4I3:4X56:PDWB:EREC:OHIN:B53R:X5MW
Docker Root Dir: /home/ubuntu/<redacted>/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
```
Regards,
Ad
To be clear, this can be replicated by git cloning your repository, then running sudo docker compose up and then doing curl on the nginx endpoint.
Update: I was able to run the server with latest master branch. I am still having problems with using my own mongodb server(using environment variables). Hopefully this can be resolved soon.
Please sign in to leave a comment.