Service not working - events' failed

Hello!
I installed Taiga using the official taiga-docker guide.
My env settings
TAIGA_SCHEME=http # serve Taiga using “http” or “https” (secured) connection
TAIGA_DOMAIN=10.254.255.202:80 # Taiga’s base URL
SUBPATH=“” # it’ll be appended to the TAIGA_DOMAIN (use either “” or a “/subpath”)
WEBSOCKETS_SCHEME=ws # events connection protocol (use either “ws” or “wss”)
I left all other lines unchanged.
Further, through the docker compose up -d command, I launched it all.
Created a user, logged in and…
I go to http://10.254.255.202/project/students/kanban
I keep getting errors in the browser console:
WebSocket error: [object Event]
or
app.js:3319 WebSocket connection to ‘ws://10.254.255.202/events’ failed:
Tell me, please, where and what needs to be corrected?

Hi @wertex15

Thank you for your very first post, and welcome to Taiga!

I have verified there’s no error with the events communication, by simulating your IP with a custom local domain and using your exact .env settings.

I left you here my testing environment:

/etc/hosts:

127.0.0.1         my.domain

.env:

TAIGA_SCHEME=http  # serve Taiga using "http" or "https" (secured) connection
TAIGA_DOMAIN=my.domain:80  # Taiga's base URL
SUBPATH="" # it'll be appended to the TAIGA_DOMAIN (use either "" or a "/subpath")
WEBSOCKETS_SCHEME=ws  # events connection protocol (use either "ws" or "wss")

And finally, I think the tricky part, that is my default.conf in the NGinx acting as a proxy pass to my Taiga’s docker installation:

/etc/nginx/conf.d/default.conf:

server {
  server_name my.domain;
  listen 80;

  location / {
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_redirect off;
    proxy_pass http://localhost:9000/;
  }

  # Events  <============ Review here
  location /events {
      proxy_pass http://localhost:9000/events;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header Host $host;
      proxy_connect_timeout 7d;
      proxy_send_timeout 7d;
      proxy_read_timeout 7d;
  }

  # TLS: Configure your TLS following the best practices inside your company
  # Logs and other configurations
}

If you’re facing a problem in the events, your problem could be located in the /events location, which it’s the responsible to capture all the ws://my.domain/events and redirect to the real location where it can be answered by your Taiga’s docker app: http://localhost:9000/events.

As you’re not using a subpath in your URL (TAIGA_DOMAIN .env variable), your proxy setting should use the subdomain sample mentioned in the installation guide: 1.9. Configure the proxy configuration. It’s also mentioned in the Taiga 30 mins Setup.

If that’s doesn’t solve your problem, please post us your proxy configuration in order to offer you further help.

Greetings

Hi again,

I have performed a final test to prove my theory, and it’s to comment the /event location proxy pass to reproduce your problem…

As you see, I’m now having the same problem app.js:3319 WebSocket connection to 'ws://my.domain/events' failed.

What I did is to omit the \events part from the Nginx acting as the local proxy:

server {
  server_name my.domain;
  listen 80;

  location / {
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_redirect off;
    proxy_pass http://localhost:9000/;
  }

  # Events
#  location /events {
#      proxy_pass http://localhost:9000/events;
#      proxy_http_version 1.1;
#      proxy_set_header Upgrade $http_upgrade;
#      proxy_set_header Connection "upgrade";
#      proxy_set_header Host $host;
#      proxy_connect_timeout 7d;
#      proxy_send_timeout 7d;
#      proxy_read_timeout 7d;
#  }

  # TLS: Configure your TLS following the best practices inside your company
  # Logs and other configurations
}

Hi @daniel.herrero
Thank you so much for your replies!

I figured out my mistake… I didn’t install nginx :smiley:
Now I will install and prescribe the settings according to the recommendations of Taiga 30min Setup
I’ll let you know the result

I tried all the options, but it did not help (

Here are my current settings:

server {
  server_name 10.254.255.202;
  listen 80;

  location / {
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_redirect off;
    proxy_pass http://localhost:9000/;
  }

  # Events  <============ Review here
  location /events {
      proxy_pass http://localhost:9000/events;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header Host $host;
      proxy_connect_timeout 7d;
      proxy_send_timeout 7d;
      proxy_read_timeout 7d;
  }

  # TLS: Configure your TLS following the best practices inside your company
  # Logs and other configurations
}

In the proxy settings, I tried to disable the events section as in your second example, but the error did not disappear.

# Taiga's URLs - Variables to define where Taiga should be served
TAIGA_SCHEME=http  # serve Taiga using "http" or "https" (secured) connection
TAIGA_DOMAIN=10.254.255.202:80  # Taiga's base URL
SUBPATH="" # it'll be appended to the TAIGA_DOMAIN (use either "" or a "/subpath")
WEBSOCKETS_SCHEME=ws  # events connection protocol (use either "ws" or "wss")

RABBITMQ_ERLANG_COOKIE=secret-erlang-cookie  # unique value shared by any connected instance of RabbitMQ

Or maybe it is related to the RABBITMQ_ERLANG_COOKIE line? I left it there as is.

  taiga-gateway:
    image: nginx:1.19-alpine
    ports:
      - "9000:80"
    volumes:
      - ./taiga-gateway/taiga.conf:/etc/nginx/conf.d/default.conf
      - taiga-static-data:/taiga/static
      - taiga-media-data:/taiga/media
    networks:
      - taiga
    depends_on:
      - taiga-front
      - taiga-back
      - taiga-events

Maybe in here in the port line it is necessary to specify something differently? And match with the string TAIGA_DOMAIN=10.254.255.202:80 # Taiga’s base URL?

upd
docker ps -a

Hi @wertex15
I’m assuming you are trying this in your local machine, isn’t it? have you tried with a local domain? I think it would be a useful test.

  1. in your /etc/hosts file add this:
127.0.0.1         taiga.example.com
  1. in your .env file configure this (and only this):
TAIGA_DOMAIN=taiga.example.com  # Taiga's base URL

and docker-compose up -d

  1. in your nginx config file, configure this:
server {
  listen 80 default_server;
  server_name taiga.example.com;

and restart nginx.

Now, you can enter in your browser in “http://taiga.example.com”. Let’s see if this still gives you an error or it helps with the problem. It’ll help us to understand better what’s going on.

Cheers!

Hi @TaigaTeam

Not certainly in that way. I have an Ubuntu server where I installed Docker and started a Taiga container. Ubuntu in CLI mode and all I can do is make a request via curl.

Also tell me, please, why do I need a proxy server in the form of nginx ? Why can’t you directly access the container’s incoming port?

Hi @wertex15 !

the taiga-docker repository is just one of many ways to use the docker images. You can even build your own images from the source code following if you want the official Dockerfile but adding your own changes.

That said, you can definetly access the container’s port (http://localhost:9000); we don’t recommend using this without a SSL/TLS termination but it’s up to every user.

Cheers!

Hi @TaigaTeam
Yesterday I once again went through the entire instructions for launching the container. I downloaded the repository and did all the steps, but it did not help. The error still shows up. How can I solve the problem when logging into Taiga from another PC?

Hi @wertex15,

It’s not a problem with the RABBITMQ_ERLANG_COOKIE line, it should porperly work as it’s by default.

You shouldn’t change the taiga-gateway service either, because it’s mapping the internal docker port from taiga-front (which runs in 80), to the 9000 port in the machine which is hosting docker.

In fact, you should be able to access directly to that address and port http://10.254.255.202:9000, without using the second nginx layer i suggest you initially.

I’m afraid I’ve run out of ideas. I’d suggest you to install Taiga in your local machine (not in a third Ubuntu server), in order to remove a layer of complexity, and perform easier configuration changes to understand what’s really going on.

Please, keep us updated. We hope you finally come to a solution!

A post was merged into an existing topic: Help with the 30min setup