RocketChat / Docker.Official.Image

Docker hub - community managed image
291 stars 217 forks source link

Loading animation and attempt to POST to localhost:3000 #199

Open alithechemist opened 10 months ago

alithechemist commented 10 months ago

Hi all, I'm running Haproxy (ssl offload) ->rocketchat(docker). The container starts ok but in the browser i can only see the three dots animation and in my browser dev-tools/network i see a failed POST request to localhost:3000.

The request is:

http://localhost:3000/__meteor__/dynamic-import/fetch

I would expect that the configuration of the url is picked up from .env ROOT_URL It seems to me that something keeps using localhost:3000 for URL building. Do you guys know what this can be?

Here is my env, the compose.yaml is untouched:

### Rocket.Chat configuration

# Rocket.Chat version
# see:- https://github.com/RocketChat/Rocket.Chat/releases
#RELEASE=
# MongoDB endpoint (include ?replicaSet= parameter)
#MONGO_URL=
# MongoDB endpoint to the local database
#MONGO_OPLOG_URL=
# IP to bind the process to
#BIND_IP=
# URL used to access your Rocket.Chat instance
ROOT_URL=https://rchat.example.com
# Port Rocket.Chat runs on (in-container)
#PORT=
# Port on the host to bind to
#HOST_PORT=

### MongoDB configuration
# MongoDB version/image tag
#MONGODB_VERSION=
# See:- https://hub.docker.com/r/bitnami/mongodb

### Traefik config (if enabled)
# Traefik version/image tag
#TRAEFIK_RELEASE=
# Domain for https (change ROOT_URL & BIND_IP accordingly)
DOMAIN=rchat.example.com
# Email for certificate notifications
#LETSENCRYPT_EMAIL=

Do I need to disable traefik in compose.yaml?

Many thanks in advance.

mrchenxxx commented 10 months ago

The same thing happened to me. Have you solved it?

alithechemist commented 10 months ago

No, not yet.

alithechemist commented 10 months ago

Ok, so i tried a lot of different things, but what worked for me was running the docker container manually instead of docker compose up and it worked. But not according to the readme, i had in fact made some changes to avoid errors. I also did not specify a version and i've got 6.3.5.

The problem was that the docker container does not take into account ROOT_URL, I noticed at the start of the container, in logs i could see:

+--------------------------------------------------------+
|                     SERVER RUNNING                     |
+--------------------------------------------------------+
|                                                        |
|  Rocket.Chat Version: 6.3.5                            |
|       NodeJS Version: 14.21.3 - x64                    |
|      MongoDB Version: 5.0.21                           |
|       MongoDB Engine: wiredTiger                       |
|             Platform: linux                            |
|         Process Port: 3000                             |
|             Site URL: http://loclhost:3000 |
|     ReplicaSet OpLog: Enabled                          |
|          Commit Hash: 5c9c3f7864                       |
|        Commit Branch: HEAD                             |
|                                                        |
+--------------------------------------------------------+

Kept saying "Site URL: http://loclhost:3000" that was a pretty clear indication.

A few more problem popped up during the fix, for instance: When trying to run the docker run command for mongo from the instruction in the readme.MD i have docker logs 3089bfefa7ba Error parsing command line: unrecognised option '--smallfiles', so i adjusted the command into: docker run --name db -d mongo:5.0 mongod

In the instructions also suggests: docker run --name db -d mongo:4.0 mongod --smallfiles While it should be version 5 if it has to work with "latest" which the devs advise not to use, but it's default. Maybe it needs a stable branch?

Replacing localhost in the compose file or in the env file did not work, I instead ran the command: docker run --name rocketchat -p 3000:3000 --env ROOT_URL=https://rocketchat.myactualdomain.com --link db:db -d rocket.chat

This worked. And finally at start it logs the correct external URL.

If you ask me, both the readme and the deploy guide here https://docs.rocket.chat/deploy/deploy-rocket.chat/deploy-with-docker-and-docker-compose just don't work for a number of reasons, they are partially outdated (mixing specific version of mongo with 'latest' ) but mainly because no one recently tested the instructions IMHO, that is evident.

I don't feel like closing this because these problem must be solved elsewhere. What i did was not a fix, it was desperation to see how much it takes to make it work. Answer: several hours of struggle for an environmental variable that is not picked up :) I actually do not know why the ROOT_URL in .env and the ROOT_URL in compose.yml don't work. It would be great to have chance to fix this and have compose do the job.

Thanks in advance. Chip

alithechemist commented 10 months ago

Honestly I am now in the process of removing it (and advise the same to others) because of what I read in the terms of service:

Customer hereby grants Rocket.Chat a worldwide license to use, host, store, reproduce, modify, create derivative works (e.g. as translations, adaptations or other changes we make so that the content in question works better with the Services), communicate, publish, perform, display and distribute User Data.

That's not cool. We need User respecting software not abusive software. Thank you, Chip.

mrchenxxx commented 10 months ago

Honestly I am now in the process of removing it (and advise the same to others) because of what I read in the terms of service:

Customer hereby grants Rocket.Chat a worldwide license to use, host, store, reproduce, modify, create derivative works (e.g. as translations, adaptations or other changes we make so that the content in question works better with the Services), communicate, publish, perform, display and distribute User Data.

That's not cool. We need User respecting software not abusive software. Thank you, Chip.

Well, I'm going to get rid of it, too

yfjiang-danny commented 10 months ago

Set BIND_IP and DOMAIN work for me. Error occur when i set ROOT_URL.

shuy2023 commented 9 months ago

So, it's been a long time, when can this error be fixed?😑