# Error in starting Rocket chat Vis docker compose file

**URL:** <https://forums.rocket.chat/t/error-in-starting-rocket-chat-vis-docker-compose-file/19008>\
**Category:** Community Support\
**Tags:** rocketchat-apps, docker\
**Created:** [December 25, 2023, 4:54pm UTC](https://forums.rocket.chat/t/error-in-starting-rocket-chat-vis-docker-compose-file/19008 "2023-12-25T16:54:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ConstxRocket](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@ConstxRocket](https://forums.rocket.chat/u/ConstxRocket)\
**Post date:** [December 25, 2023, 4:54pm UTC](https://forums.rocket.chat/t/error-in-starting-rocket-chat-vis-docker-compose-file/19008/1 "2023-12-25T16:54:44Z")

</div>

### Description

The docker image keeps restarting when started from docker compose. only modification that I did in .env file was to define the release for rocket chat to 6.5.0

### Server Setup Information

- Version of Rocket.Chat Server: 6.5.0
- Operating System: Debian Linux
- Deployment Method: docker
- Number of Running Instances: 1
- DB Replicaset Oplog:
- NodeJS Version: not sure based on docker
- MongoDB Version: 5.0
- Proxy: None
- Firewalls involved: None

### Any additional Information

MongoRuntimeError: Unable to parse ${MONGODB\_ADVERTISED\_HOSTNAME:-mongodb:27017 with URL  
at new HostAddress (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:848:34)  
at fromString (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:890:16)  
at Array.map ()  
at parseOptions (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/connection\_string.js:197:45)  
at new MongoClient (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/mongo\_client.js:46:63)  
at new MongoConnection (packages/mongo/mongo\_driver.js:191:17)  
at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote\_collection\_driver.js:9:16)  
at Object. (packages/mongo/remote\_collection\_driver.js:66:18)  
at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19)  
at new Collection (packages/mongo/collection.js:127:40)  
at AccountsServer.\_initializeCollection (packages/accounts-base/accounts\_common.js:98:20)  
at new AccountsCommon (packages/accounts-base/accounts\_common.js:46:23)  
at new AccountsServer (packages/accounts-base/accounts\_server.js:30:5)  
at packages/accounts-base/server\_main.js:7:12  
at module (packages/accounts-base/server\_main.js:19:31)  
at fileEvaluate (packages/modules-runtime.js:336:7) {  
cause: TypeError [ERR\_INVALID\_URL] [ERR\_INVALID\_URL]: Invalid URL: iLoveJS://${MONGODB\_ADVERTISED\_HOSTNAME:-mongodb:27017  
at new NodeError (internal/errors.js:322:7)  
at onParseError (internal/url.js:270:9)  
at new URL (internal/url.js:346:5)  
at new HostAddress (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:845:19)  
at fromString (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:890:16)  
at Array.map ()  
at parseOptions (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/connection\_string.js:197:45)  
at new MongoClient (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/mongo\_client.js:46:63)  
at new MongoConnection (packages/mongo/mongo\_driver.js:191:17)  
at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote\_collection\_driver.js:9:16)  
at Object. (packages/mongo/remote\_collection\_driver.js:66:18)  
at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19)  
at new Collection (packages/mongo/collection.js:127:40)  
at AccountsServer.\_initializeCollection (packages/accounts-base/accounts\_common.js:98:20)  
at new AccountsCommon (packages/accounts-base/accounts\_common.js:46:23)  
at new AccountsServer (packages/accounts-base/accounts\_server.js:30:5) {  
input: ‘iLoveJS://${MONGODB\_ADVERTISED\_HOSTNAME:-mongodb:27017’,  
code: ‘ERR\_INVALID\_URL’  
},  
[Symbol(errorLabels)]: Set(0) {}  
}

Log From mongodb docker container:  
hot count: 0, oldest timestamp: (1703522542, 1) , meta checkpoint timestamp: (1703522842, 1) base write gen: 324"}}  
{“t”:{“$date”:“2023-12-25T16:48:24.846+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:22430, “ctx”:“Checkpointer”,“msg”:“WiredTiger message”,“attr”:{“message”:“[1703522904:846731][1:0x7f83c111b700], WT\_SESSION.checkpoint: [WT\_VERB\_CHECKPOINT\_PROGRESS] saving checkpoint snapshot min: 171, snapshot max: 171 snapshot count: 0, oldest timestamp: (1703522602, 1) , meta checkpoint timestamp: (1703522902, 1) base write gen: 324”}}  
{“t”:{“$date”:“2023-12-25T16:49:25.056+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:22430, “ctx”:“Checkpointer”,“msg”:“WiredTiger message”,“attr”:{“message”:“[1703522965:56225][1:0x7f83c111b700], WT\_SESSION.checkpoint: [WT\_VERB\_CHECKPOINT\_PROGRESS] saving checkpoint snapshot min: 186, snapshot max: 186 snapshot count: 0, oldest timestamp: (1703522662, 1) , meta checkpoint timestamp: (1703522962, 1) base write gen: 324”}}  
{“t”:{“$date”:“2023-12-25T16:50:25.226+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:22430, “ctx”:“Checkpointer”,“msg”:“WiredTiger message”,“attr”:{“message”:“[1703523025:226257][1:0x7f83c111b700], WT\_SESSION.checkpoint: [WT\_VERB\_CHECKPOINT\_PROGRESS] saving checkpoint snapshot min: 201, snapshot max: 201 snapshot count: 0, oldest timestamp: (1703522722, 1) , meta checkpoint timestamp: (1703523022, 1) base write gen: 324”}}  
{“t”:{“$date”:“2023-12-25T16:51:25.487+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:22430, “ctx”:“Checkpointer”,“msg”:“WiredTiger message”,“attr”:{“message”:“[1703523085:487601][1:0x7f83c111b700], WT\_SESSION.checkpoint: [WT\_VERB\_CHECKPOINT\_PROGRESS] saving checkpoint snapshot min: 216, snapshot max: 216 snapshot count: 0, oldest timestamp: (1703522782, 1) , meta checkpoint timestamp: (1703523082, 1) base write gen: 324”}}  
{“t”:{“$date”:“2023-12-25T16:52:25.831+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:22430, “ctx”:“Checkpointer”,“msg”:“WiredTiger message”,“attr”:{“message”:“[1703523145:831747][1:0x7f83c111b700], WT\_SESSION.checkpoint: [WT\_VERB\_CHECKPOINT\_PROGRESS] saving checkpoint snapshot min: 231, snapshot max: 231 snapshot count: 0, oldest timestamp: (1703522842, 1) , meta checkpoint timestamp: (1703523142, 1) base write gen: 324”}}  
{“t”:{“$date”:“2023-12-25T16:53:26.068+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:22430, “ctx”:“Checkpointer”,“msg”:“WiredTiger message”,“attr”:{“message”:“[1703523206:68543][1:0x7f83c111b700], WT\_SESSION.checkpoint: [WT\_VERB\_CHECKPOINT\_PROGRESS] saving checkpoint snapshot min: 246, snapshot max: 246 snapshot count: 0, oldest timestamp: (1703522902, 1) , meta checkpoint timestamp: (1703523202, 1) base write gen: 324”}}

---

<div class="post-metadata">

**Author:** ![Krish90](https://avatars.discourse-cdn.com/v4/letter/k/e8c25b/32.png) [@Krish90](https://forums.rocket.chat/u/Krish90)\
**Post date:** [December 17, 2024, 6:07pm UTC](https://forums.rocket.chat/t/error-in-starting-rocket-chat-vis-docker-compose-file/19008/2 "2024-12-17T18:07:18Z")

</div>

Did you ever get an answer on this? Having the same problem sadly.

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [December 18, 2024, 8:23am UTC](https://forums.rocket.chat/t/error-in-starting-rocket-chat-vis-docker-compose-file/19008/3 "2024-12-18T08:23:37Z")

</div>

> [@Krish90](#):
>
> Did you ever get an answer on this? Having the same problem sadly.

The answer is in the first line.

> [@ConstxRocket](#):
>
> MongoRuntimeError: Unable to parse ${MONGODB\_ADVERTISED\_HOSTNAME:-mongodb:27017 with URL  
> at new HostAddress

Pretty sure yours is different so please give some proper debug info.

Long logs on pastebin etc please.

---

<div class="post-metadata">

**Author:** ![Krish90](https://avatars.discourse-cdn.com/v4/letter/k/e8c25b/32.png) [@Krish90](https://forums.rocket.chat/u/Krish90)\
**Post date:** [December 18, 2024, 3:31pm UTC](https://forums.rocket.chat/t/error-in-starting-rocket-chat-vis-docker-compose-file/19008/4 "2024-12-18T15:31:20Z")

</div>

Sorry, not sure what you mean by the answer is in the first line. Without any modifications to a docker compose file why would this error show up? A default installation should not break in this way, no?

Just to let you know, as I do believe I had the same problem, I managed to temporarily fix this by manually setting the MONGO\_URL field in services-\>rocketchat-\>environment section on compose.yml to the following:

MONGO\_URL: mongodb://mongodb:27017/rocketchat?replicaSet=rs0

This is simply the fallback defaults provided by the environment file without the variables. The default line is this:

MONGO\_URL: “${MONGO\_URL:-  
mongodb://${MONGODB\_ADVERTISED\_HOSTNAME:-mongodb}:${MONGODB\_INITIAL\_PRIMARY\_PORT\_NUMBER:-27017}/  
${MONGODB\_DATABASE:-rocketchat}?replicaSet=${MONGODB\_REPLICA\_SET\_NAME:-rs0}}”

Does this not mean that there is an issue with the variables in the MONGO\_URL field of compose.yml that is resulting in the string not being properly parsed for deployment? Please let me know what debug information you require and I can provide that today, thanks very much for the response.

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [December 18, 2024, 5:11pm UTC](https://forums.rocket.chat/t/error-in-starting-rocket-chat-vis-docker-compose-file/19008/5 "2024-12-18T17:11:34Z")

</div>

> [@Krish90](#):
>
> Sorry, not sure what you mean by the answer is in the first line

Because it is.

> [@Krish90](#):
>
> Without any modifications to a docker compose file why would this error show up? A default installation should not break in this way, no?

Before stating such things bear in mind that these files are used by many people. There would be a truck load of issues if they were wrong. If you check github, here, open.rocket there aren’t.

However, there are a plethora of people not understand ing what they are doing, not reading the docs, making mistakes etc.

If you read the docs carefully it clearly says:

> download the example `compose.yml` file

> Edit environment variables

Note ‘example’ and Edit.

[https://docs.rocket.chat/docs/deploy-with-docker-docker-compose](https://docs.rocket.chat/docs/deploy-with-docker-docker-compose)

So that means that whatever the OP, and you , have done is incorrect.

If you read the files you will see that

`MONGODB_ADVERTISED_HOSTNAME: ${MONGODB_ADVERTISED_HOSTNAME:-mongodb}`

In other words use the .env variable MONGODB\_ADVERTISED\_HOSTNAME or if not default to mongodb which is the name of the container, as you said.

Which is what you have shortened it too here:

> manually setting the MONGO\_URL field in services-\>rocketchat-\>environment section on compose.yml to the following:
> 
> MONGO\_URL: mongodb://mongodb:27017/rocketchat?replicaSet=rs0

> <https://github.com/RocketChat/Docker.Official.Image/blob/main/compose.yml>

So somewhere, somehow you have got something wrong syntactically.

As you haven’t provided details of your logs or your setup it’s hard to guess. I can only go on what someone posted a year ago.

---

<div class="post-metadata">

**Author:** ![Krish90](https://avatars.discourse-cdn.com/v4/letter/k/e8c25b/32.png) [@Krish90](https://forums.rocket.chat/u/Krish90)\
**Post date:** [December 18, 2024, 5:48pm UTC](https://forums.rocket.chat/t/error-in-starting-rocket-chat-vis-docker-compose-file/19008/6 "2024-12-18T17:48:01Z")

</div>

The compose file was completely unmodified when I downloaded it and tried to run. If the defaults are in place, and there is no change by me, it should work. Formatting issue when running curl? No idea. I’m not arguing that something may have happened but I can assure you no changes were made to the yaml.

The steps from the links you sent (that, yes, I had already looked at):

-Go to your preferred directory and create a `compose.yml` file and copy the content from [our example](https:// github .com/RocketChat/Docker.Official.Image/blob/master/compose.yml).

Alternatively, you can use the `curl` command to download the example `compose.yml` file by executing this command:

```auto
curl -L https:// raw.githubusercontent .com/RocketChat/Docker.Official.Image/master/compose.yml -O

```

-Set the `RELEASE` variable in the `.env` to your desired Rocket.Chat version. See our [releases page] and [available docker images]. Keeping the default release as `latest` is **not recommended**.

Both of these steps were done and I changed release as needed. The guide doesn’t say to set anything else unless you want to do something different like a standalone MongoDB server.

Logs: [user@rocketchat:/home/rocketchat# docker logs -f rocketchat\_rocketchat\_1(node: - Pastebin.com](https://pastebin.com/XxCzc5F9)

compose.yml: [user@rocketchat:/home/rocketchat# cat compose.yml volumes: mongodb\_data: - Pastebin.com](https://pastebin.com/bm64diAA)

I provided whatever details were requested from the setup on my own post for this, but here you go:

Server Setup Information

```
Version of Rocket.Chat Server: 7.0.3 (prev tried 6.13.0/6.13.1)
Operating System: Debian 12.5
Deployment Method: docker
Number of Running Instances: 1
DB Replicaset Oplog:
NodeJS Version: Appears to be 20.17.0
MongoDB Version: 6.0
Proxy: Proxy used to download the images, nothing else running locally
Firewalls involved: None

```

---

<div class="post-metadata">

**Author:** ![Krish90](https://avatars.discourse-cdn.com/v4/letter/k/e8c25b/32.png) [@Krish90](https://forums.rocket.chat/u/Krish90)\
**Post date:** [December 18, 2024, 5:50pm UTC](https://forums.rocket.chat/t/error-in-starting-rocket-chat-vis-docker-compose-file/19008/7 "2024-12-18T17:50:41Z")

</div>

I can only put 2 links in a post so the env and oplog status are here:

oplog: [rs0 [direct: primary] test\> rs.printReplicationInfo()actual oplog size'990 M - Pastebin.com](https://pastebin.com/PwXRL7Pi)

.env: [user@rocketchat:/home/rocketchat# cat .env### Rocket.Chat configuration # - Pastebin.com](https://pastebin.com/3GdDkmfR)

Also, if it helps at all, this is a Debian VM like I said before, but it is running on Proxmox.

Once more, please let me know if there is any additional info needed.

Edit: one thing I will try is verifying docker version and seeing if the parsing error is due to a version problem.

Best,  
Krish

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [December 18, 2024, 7:14pm UTC](https://forums.rocket.chat/t/error-in-starting-rocket-chat-vis-docker-compose-file/19008/8 "2024-12-18T19:14:16Z")

</div>

> [@Krish90](#):
>
> The compose file was completely unmodified when I downloaded it and tried to run. If the defaults are in place, and there is no change by me, it should work

I said before. It is an EXAMPLE. It is a ‘representation’. That does NOT mean it is guaranteed to work.

The same with the .env file.

Note the very first error which you seem to have ignored:

> The URL [http://localhost](http://localhost):${HOST\_PORT:-3000} is invalid

You need to fill in the settings correctly for YOUR environment. No one can set those for you, and that is why everything is an example.
