mx-space / core

😎 The next generation of RESTful API service and more feature for Mix Space, powered by @nestjs.
Other
330 stars 100 forks source link

更新後無法連接到 core #1862

Closed seriaati closed 1 month ago

seriaati commented 1 month ago

Describe the bug

更新到 v6.0.1 後,沒辦法連接到 api 導致前端也死去: https://seria.vercel.app/ image

mx space 也死去 image

日誌: mx-server-20240711114322.log

Reproduction

執行了 docker compose pull && docker compose up -d

System Info

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (2) x64 AMD EPYC-Rome Processor
    Memory: 1.05 GB / 3.82 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 18.19.0 - /usr/bin/node
    npm: 9.2.0 - /usr/bin/npm

Validations

linear[bot] commented 1 month ago

MXD-137 更新後無法連接到 core

Innei commented 1 month ago

看日志是你的 redis 挂了

seriaati commented 1 month ago

redis 應該是 mx-space core 的 docker 裡負責設置的吧? 我對這些東西不太熟,但看起來容器有啟動,日誌:

1:C 11 Jul 2024 11:46:01.840 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:C 11 Jul 2024 11:46:01.841 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 11 Jul 2024 11:46:01.841 * Redis version=7.2.5, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 11 Jul 2024 11:46:01.841 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 11 Jul 2024 11:46:01.841 * monotonic clock: POSIX clock_gettime
1:M 11 Jul 2024 11:46:01.842 * Running mode=standalone, port=6379.
1:M 11 Jul 2024 11:46:01.842 * Server initialized
1:M 11 Jul 2024 11:46:01.842 * Loading RDB produced by version 7.2.5
1:M 11 Jul 2024 11:46:01.842 * RDB age 0 seconds
1:M 11 Jul 2024 11:46:01.843 * RDB memory usage when created 0.84 Mb
1:M 11 Jul 2024 11:46:01.843 * Done loading RDB, keys loaded: 10, keys expired: 0.
1:M 11 Jul 2024 11:46:01.843 * DB loaded from disk: 0.000 seconds
1:M 11 Jul 2024 11:46:01.843 * Ready to accept connections tcp
root@vultr:~# ps aux | grep redis
999      3759488  0.2  0.3 131364 14964 ?        Ssl  19:46   0:00 redis-server *:6379
root     3761716  0.0  0.0   6408  1964 pts/0    S+   19:47   0:00 grep redis
seriaati commented 1 month ago

能幫我看一下怎麼回事嗎,弄了半天還是沒能成功 redis 很明顯是有啟動在 6479 端口了,但是 mx-server 就是連不上他,我不知道為什麼 問了 chatgpt 說也許是在不同 docker network 的問題

seriaati commented 1 month ago

有辦法從文件夾裡將文章導出嗎?

Innei commented 1 month ago

docker compose 里面的 redis url 要填写 docker redis 的 hostname

seriaati commented 1 month ago

沒有在 mx-space/core/docker-compose.yml 裡看到 redis url 的選項

seriaati commented 1 month ago

我把 mx-space/core/docker-compose.yml 刪除後,用 wget https://fastly.jsdelivr.net/gh/mx-space/core@master/docker-compose.yml 重新拉了新的鏡像,用 docker compose up -d 啟動容器後就能成功進入 mix space 了。 進去後之前寫的文章都沒了…

seriaati commented 1 month ago

備份裡居然有資料,回滾後就有之前的文章了

Innei commented 1 month ago

应该是你 docker compose 两次不是同一个 mongo 实例导致的