# Mattermost docker refuses to connect after reboot

**URL:** <https://forum.mattermost.com/t/mattermost-docker-refuses-to-connect-after-reboot/15288>\
**Category:** Troubleshooting\
**Created:** [March 6, 2023, 9:46pm UTC](https://forum.mattermost.com/t/mattermost-docker-refuses-to-connect-after-reboot/15288 "2023-03-06T21:46:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rikrdo89](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/rikrdo89/32/6494_2.png) [@rikrdo89](https://forum.mattermost.com/u/rikrdo89)\
**Post date:** [March 6, 2023, 9:46pm UTC](https://forum.mattermost.com/t/mattermost-docker-refuses-to-connect-after-reboot/15288/1 "2023-03-06T21:46:00Z")

</div>

I installed MM via docker-compose (Ubuntu 20.04), and it was working fine via url, and locally via localhost:8065, that is until I decided to reboot my proxy server (apache) and reboot the docker container. Now, whenever I start the docker container, I cannot longer access my mattermost. When testing for the port using telnet, it looks like it gets connected but then the connection is closed.

From host server:

```auto
$ telnet localhost 8065
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

```

From local network:

```auto
$ telnet mylanIP 8065
Trying mylanIP ...
telnet: Unable to connect to remote host: Connection refused

```

From the web:

> Proxy Error  
> The proxy server received an invalid response from an upstream server.  
> The proxy server could not handle the request
> 
> Reason: Error reading from remote server

The docker logs show this:

```auto
matter-mattermost-1 | {"timestamp":"2023-03-06 16:53:40.096 -05:00","level":"info","msg":"Server is listening on 127.0.0.1:8065","caller":"app/server.go:952","address":"127.0.0.1:8065"}

```

Can someone please help me solve this issue?

---

<div class="post-metadata">

**Author:** ![rikrdo89](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/rikrdo89/32/6494_2.png) [@rikrdo89](https://forum.mattermost.com/u/rikrdo89)\
**Post date:** [March 6, 2023, 10:45pm UTC](https://forum.mattermost.com/t/mattermost-docker-refuses-to-connect-after-reboot/15288/2 "2023-03-06T22:45:27Z")

</div>

I was able to find a temporary workaround by deleting the config file `config/config.json` in the docker container. However, I have to do this everytime I stop the docker container.

I found a post having the same issue 5 years ago ([[SOLVED] Mattermost suddenly crashed and after reboot Web Container doesn't response - #12 by rikrdo89](https://forum.mattermost.com/t/solved-mattermost-suddenly-crashed-and-after-reboot-web-container-doesnt-response/3050/12) , still unsolved)

Hopefully someone can find a long term solution to this issue. I don’t know what type of configuration I am losing by erasing the config file every time, if it is nothing important, then the conf file should be made a tmp file that is removed when stopping the container.

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [March 7, 2023, 6:06am UTC](https://forum.mattermost.com/t/mattermost-docker-refuses-to-connect-after-reboot/15288/3 "2023-03-07T06:06:16Z")

</div>

How do you restart the Mattermost application container?  
What’s the output of `docker ps` before and after you restart it?

---

<div class="post-metadata">

**Author:** ![rikrdo89](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/rikrdo89/32/6494_2.png) [@rikrdo89](https://forum.mattermost.com/u/rikrdo89)\
**Post date:** [March 8, 2023, 3:35am UTC](https://forum.mattermost.com/t/mattermost-docker-refuses-to-connect-after-reboot/15288/4 "2023-03-08T03:35:47Z")

</div>

I restart it by using `docker-compose down` and `docker-compose up`. The output shows the containers for MM loaded after restart, but they are not accessible as I mentioned earlier.

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [March 8, 2023, 4:01am UTC](https://forum.mattermost.com/t/mattermost-docker-refuses-to-connect-after-reboot/15288/5 "2023-03-08T04:01:30Z")

</div>

Can you please share the output? I’m interested in the port mappings and the health status, f.ex.  
If you missed the port mapping config file when starting the containers, f.ex., they will only listen internally:

```auto
# docker-compose up
[...]
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
afb18b589605 mattermost/mattermost-team-edition:latest "/entrypoint.sh matt…" 4 seconds ago Up 2 seconds (health: starting) 8065/tcp, 8067/tcp, 8074-8075/tcp mm-780-mattermost-1
4f689b0faf35 postgres:13-alpine "docker-entrypoint.s…" 4 seconds ago Up 3 seconds 5432/tcp mm-780-postgres-1

```

vs.

```auto
# docker-compose -f docker-compose.yml -f docker-compose.without-nginx.yml up -d
[...]
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
14a84b3cdcf6 mattermost/mattermost-team-edition:latest "/entrypoint.sh matt…" 3 seconds ago Up 1 second (health: starting) 8067/tcp, 0.0.0.0:8065->8065/tcp, :::8065->8065/tcp, 8074-8075/tcp, 0.0.0.0:8443->8443/udp, :::8443->8443/udp mm-780-mattermost-1
9eede1bdfc55 postgres:13-alpine "docker

```

I assume you did just use `docker-compose up` without specifying both yml files, right?
