Talk: Talk only redirects to `/install` with error `Tenant has already been installed`

Created on 28 May 2020  路  5Comments  路  Source: coralproject/talk

I have Talk in a Docker container on a Digital Ocean droplet
with nginx. I am continually redirected to https://talk.ourdomain.net/install where I get the error: Tenant has already been installed. (I had installed this instance before setting up Nginx).

I think it may be an issue with e.g. TRUST_PROXY but I'm not sure.

Does anyone know? Thank you!

Expected behavior:
Talk should give access to all admin pages.

Actual behavior:
Redirects to /install.

Versions:

  • NodeJS: 12.16.1
  • NPM: 6.13.4
  • MongoDB: 4.2
  • Redis: 3.2
  • Browser: Firefox 76.0.1 (and other browsers)
  • OS: Ubuntu 18.04.3 LTS

docker-compose.yml

version: "2"
services:
  talk:
    image: coralproject/talk:6
    restart: always
    ports:
      - "3000:5000"
    depends_on:
      - mongo
      - redis
    environment:
      - MONGODB_URI=mongodb://mongo:27017/coral
      - REDIS_URI=redis://redis:6379
      - SIGNING_SECRET=SECRET
      - TRUST_PROXY=uniquelocal
  mongo:
    image: mongo:4.2
    volumes:
      - ./data/mongo:/data/db
  redis:
    image: redis:3.2
    volumes:
      - ./data/redis:/data

NGINX config at /etc/nginx/sites-available/default:

server {

    server_name talk.ourdomain.net;


        location / {
                proxy_pass http://localhost:3000;
                proxy_redirect     off;
                proxy_set_header   Host $host;
                proxy_set_header   X-Real-IP $remote_addr;
                proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header   X-Forwarded-Proto https;
                proxy_set_header   X-Forwarded-Host $server_name;
                proxy_hide_header  X-powered-by;
}

location /api/v1/live {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        include /etc/nginx/proxy_params;
}

    listen [::]:443 ssl ipv6only=on;
    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/talk.ourdomain.net/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/talk.ourdomain.net/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
    if ($host = talk.ourdomain.net) {
        return 301 https://$host$request_uri;
    } # managed by Certbot
        listen 80 ;
        listen [::]:80 ;
    server_name talk.ourdomain.net;
    return 404;
}
bug

All 5 comments

If you setup Coral before setting up Nginx, you will need to edit the domain field of the associated document in the tenants collection to match the domain of your site being proxied by nginx. This is because Coral is multi-tenant aware, and uses the domain/hostname to separate tenants.

I did that by accessing mongo in its container and running:

db.tenants.updateOne({"id" : "d5236f5c-0fd1-421-a0f48dc71227"}, {$set: {domain: "talk.domain.net"}})

but that didn't seem to work either. I will just reinstall Coral and see how that goes.

Thanks for you response!

Once you've updated the tenant, you might need to restart the server because it caches the tenant in memory!

Hey @mattlinares - we can also set up the hosting for you, if you're interested, just send an email to our support channel and I can send you some options: [email protected] 馃帀

@mattlinares Hi it worked me thanks, you just need to restart server after changing db.

Was this page helpful?
0 / 5 - 0 ratings