alswl / excalidraw-collaboration

excalidraw with collaboration feature, self-hosting, and only one-click deploy
MIT License
391 stars 67 forks source link

无法保存到后端数据库。如果问题持续存在,您应该保存文件到本地,以确保您的工作不会丢失。 #41

Open xvbai0317 opened 11 months ago

xvbai0317 commented 11 months ago

92d791f896c0cf27d39557c10bd36a4e 307fb03b94f035c9e2d47fd41591e35f

xvbai0317 commented 11 months ago

version: "3.8"

services: excalidraw: image: kiliandeca/excalidraw healthcheck: disable: true ports:

xvbai0317 commented 11 months ago

可以直接改成mysql://用户名:密码@localhost:3306吗

alswl commented 11 months ago

你使用的镜像都不是我提供的,是不是找错了仓库了?

xvbai0317 commented 11 months ago

services: frontend: image: alswl/excalidraw:v0.17.0-fork-b2 environment:

xvbai0317 commented 11 months ago

bc73ff073262c0979544b938710ba921 这个改了之后会抱这个错误,能请教一下您吗?

alswl commented 11 months ago

你可以查看 https://github.com/alswl/excalidraw-storage-backend 源码。另外参考 https://github.com/jaredwray/keyv 如何使用 MySQL 连接。

leesonaa commented 11 months ago

services: frontend: image: alswl/excalidraw:v0.17.0-fork-b2 environment: - VITE_APP_BACKEND_V2_GET_URL=https://test.com/api/v2/ - VITE_APP_BACKEND_V2_POST_URL=https://test.com/api/v2/post/ - VITE_APP_WS_SERVER_URL=http://127.0.0.1:8082 - VITE_APP_FIREBASE_CONFIG={} # alswl'fork env # forked excalidraw can use env alswl/excalidraw#5 - VITE_APP_HTTP_STORAGE_BACKEND_URL=http://127.0.0.1:8081/api/v2 - VITE_APP_STORAGE_BACKEND=http ports: - 80:80

storage: image: alswl/excalidraw-storage-backend:v2023.11.11 restart: always environment: # docs https://github.com/alswl/excalidraw-storage-backend#environement-variables - PORT=8081 - STORAGE_URI=mysql://root:sjl.0927@localhost:3306 ports: - 8081:8081

room: image: excalidraw/excalidraw-room:sha-49bf529 ports: - 8082:80

redis: image: redis ports: - "6379:6379"

你的mysql都不在这个网桥组里,那肯定不能通过主机名去访问呀。

xvbai0317 commented 11 months ago

services: frontend: image: alswl/excalidraw:v0.17.0-fork-b2 environment: - VITE_APP_BACKEND_V2_GET_URL=https://test.com/api/v2/ - VITE_APP_BACKEND_V2_POST_URL=https://test.com/api/v2/post/ - VITE_APP_WS_SERVER_URL=http://127.0.0.1:8082 - VITE_APP_FIREBASE_CONFIG={} # alswl'fork env # forked excalidraw can use env alswl/excalidraw#5 - VITE_APP_HTTP_STORAGE_BACKEND_URL=http://127.0.0.1:8081/api/v2 - VITE_APP_STORAGE_BACKEND=http ports: - 80:80 storage: image: alswl/excalidraw-storage-backend:v2023.11.11 restart: always environment: # docs https://github.com/alswl/excalidraw-storage-backend#environement-variables - PORT=8081 - STORAGE_URI=mysql://root:sjl.0927@localhost:3306 ports: - 8081:8081 room: image: excalidraw/excalidraw-room:sha-49bf529 ports: - 8082:80 redis: image: redis ports: - "6379:6379"

你的mysql都不在这个网桥组里,那肯定不能通过主机名去访问呀。

请教一下,那我要想存在本地的mysql数据库应该怎么改呢

leesonaa commented 11 months ago

services: frontend: image: alswl/excalidraw:v0.17.0-fork-b2 environment: - VITE_APP_BACKEND_V2_GET_URL=https://test.com/api/v2/ - VITE_APP_BACKEND_V2_POST_URL=https://test.com/api/v2/post/ - VITE_APP_WS_SERVER_URL=http://127.0.0.1:8082 - VITE_APP_FIREBASE_CONFIG={} # alswl'fork env # forked excalidraw can use env alswl/excalidraw#5 - VITE_APP_HTTP_STORAGE_BACKEND_URL=http://127.0.0.1:8081/api/v2 - VITE_APP_STORAGE_BACKEND=http ports: - 80:80 storage: image: alswl/excalidraw-storage-backend:v2023.11.11 restart: always environment: # docs https://github.com/alswl/excalidraw-storage-backend#environement-variables - PORT=8081 - STORAGE_URI=mysql://root:sjl.0927@localhost:3306 ports: - 8081:8081 room: image: excalidraw/excalidraw-room:sha-49bf529 ports: - 8082:80 redis: image: redis ports: - "6379:6379"

你的mysql都不在这个网桥组里,那肯定不能通过主机名去访问呀。

请教一下,那我要想存在本地的mysql数据库应该怎么改呢

STORAGE_URI=mysql://root:sjl.0927@localhost:3306 你这段不对吧,把localhost改成你mysql映射的那个宿主的ip地址才行吧 因为 我看上面你的mysql并不在这个compose里。

xvbai0317 commented 11 months ago

services: frontend: image: alswl/excalidraw:v0.17.0-fork-b2 environment: - VITE_APP_BACKEND_V2_GET_URL=https://test.com/api/v2/ - VITE_APP_BACKEND_V2_POST_URL=https://test.com/api/v2/post/ - VITE_APP_WS_SERVER_URL=http://127.0.0.1:8082 - VITE_APP_FIREBASE_CONFIG={} # alswl'fork env # forked excalidraw can use env alswl/excalidraw#5 - VITE_APP_HTTP_STORAGE_BACKEND_URL=http://127.0.0.1:8081/api/v2 - VITE_APP_STORAGE_BACKEND=http ports: - 80:80 storage: image: alswl/excalidraw-storage-backend:v2023.11.11 restart: always environment: # docs https://github.com/alswl/excalidraw-storage-backend#environement-variables - PORT=8081 - STORAGE_URI=mysql://root:sjl.0927@localhost:3306 ports: - 8081:8081 room: image: excalidraw/excalidraw-room:sha-49bf529 ports: - 8082:80 redis: image: redis ports: - "6379:6379"

你的mysql都不在这个网桥组里,那肯定不能通过主机名去访问呀。

请教一下,那我要想存在本地的mysql数据库应该怎么改呢

STORAGE_URI=mysql://root:sjl.0927@localhost:3306 你这段不对吧,把localhost改成你mysql映射的那个宿主的ip地址才行吧 因为 我看上面你的mysql并不在这个compose里。

8940b063ac80969a3ed61300c75e8741 我按您说的做了,然后就发生了这个问题,这个应该怎么解决,我再去试试

leesonaa commented 11 months ago

服务:前端:图像:alswl/excalidraw:v0.17.0-fork-b2 环境:- VITE_APP_BACKEND_V2_GET_URL=https://test.com/api/v2/ - VITE_APP_WS_SERVER_URL=https://test.com/api/v2/post/ - VITE_APP_BACKEND_V2_POST_URL= - VITE_APP_FIREBASE_CONFIG={} # alswl'fork env # forked excalidraw 可以使用 env alswl /excalidraw#5 - VITE_APP_HTTP_STORAGE_BACKEND_URL=http://127.0.0.1:8081/api/v2 - VITE_APP_STORAGE_BACKEND= HTTP 端口:- 80:80 存储:图像:alswl/excalidraw-storage-backend:v2023.11.11 重新启动:始终环境:# docs https://github.com/alswl/excalidraw-storage-backend#environement-variables - PORT=8081 - STORAGE_URI=mysql://root:sjl.0927@localhost:3306 端口:- 8081:8081 房间:图像:excalidraw/excalidraw-room:sha-49bf529 端口:- 8082:80 redis:图像:redis 端口:-“6379:6379”

你的mysql都不在这个网桥组里,那肯定不能通过主机名去访问呀。

请教一下,那我原来存在本地的mysql数据库应该怎么改呢?

STORAGE_URI=mysql://root:sjl.0927@localhost:3306 你大概不对吧,把localhost改成你mysqlmap的那个ip地址才行吧因为我上面看你的mysql不在这个compose里。

8940b063ac80969a3ed61300c75e8741 我按你说的做了,然后就出现了这个问题,这个应该怎么解决,我再去尝试一下

我没用mysql,我用的mongodb,保存也仅仅是以文件方式保存到客户端的本地。

filwu8 commented 4 months ago

我也遇到,偶尔发生这种问题,一般是在和远程共享白板协作过程中

imysl0 commented 4 months ago

@alswl help!

我也遇到的这个问题。只要协作就会出现。用的也是大佬的镜像。

services:
  frontend:
    image: alswl/excalidraw:v0.17.3-fork-b1
    environment:
      - VITE_APP_BACKEND_V2_GET_URL=https://10.35.144.14:2086/api/v2/scenes/
      - VITE_APP_BACKEND_V2_POST_URL=https://10.35.144.14:2086/api/v2/scenes/
      - VITE_APP_WS_SERVER_URL=https://10.35.144.14:2087
      - VITE_APP_FIREBASE_CONFIG={}
      - VITE_APP_HTTP_STORAGE_BACKEND_URL=https://10.35.144.14:2086/api/v2
      - VITE_APP_STORAGE_BACKEND=https
    ports:
      - 7080:80
  storage:
    image: alswl/excalidraw-storage-backend:v2023.11.11
    restart: always
    environment:
      # docs https://github.com/alswl/excalidraw-storage-backend#environement-variables
      - PORT=8081
      - STORAGE_URI=pg://excalidraw:excalidraw@10.35.144.15:5432/exca
    ports:
      - 8081:8081
  room:
    image: excalidraw/excalidraw-room:sha-49bf529
    ports:
      - 8082:80

使用了https反代,postgre数据库。目前只要一协作就报无法保存到数据库。 image

excalidraw-storage-backend容器报这个错误:

> excalidraw-storage-backend@0.0.1 start:prod
> node dist/main
[Nest] 17  - 07/27/2024, 3:10:35 AM     LOG [NestFactory] Starting Nest application...
[Nest] 17  - 07/27/2024, 3:10:35 AM   ERROR [ExceptionHandler] The "id" argument must be of type string. Received undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:406:5)
    at validateString (node:internal/validators:162:11)
    at Module.require (node:internal/modules/cjs/loader:1108:3)
    at require (node:internal/modules/helpers:130:18)
    at loadStore (/app/node_modules/keyv/src/index.js:22:15)
    at new Keyv (/app/node_modules/keyv/src/index.js:50:22)
    at /app/dist/storage/storage.service.js:25:26
    at Array.forEach (<anonymous>)
    at new StorageService (/app/dist/storage/storage.service.js:24:39)
    at Injector.instantiateClass (/app/node_modules/@nestjs/core/injector/injector.js:330:19)
imysl0 commented 4 months ago

@alswl help!

我也遇到的这个问题。只要协作就会出现。用的也是大佬的镜像。

services:
  frontend:
    image: alswl/excalidraw:v0.17.3-fork-b1
    environment:
      - VITE_APP_BACKEND_V2_GET_URL=https://10.35.144.14:2086/api/v2/scenes/
      - VITE_APP_BACKEND_V2_POST_URL=https://10.35.144.14:2086/api/v2/scenes/
      - VITE_APP_WS_SERVER_URL=https://10.35.144.14:2087
      - VITE_APP_FIREBASE_CONFIG={}
      - VITE_APP_HTTP_STORAGE_BACKEND_URL=https://10.35.144.14:2086/api/v2
      - VITE_APP_STORAGE_BACKEND=https
    ports:
      - 7080:80
  storage:
    image: alswl/excalidraw-storage-backend:v2023.11.11
    restart: always
    environment:
      # docs https://github.com/alswl/excalidraw-storage-backend#environement-variables
      - PORT=8081
      - STORAGE_URI=pg://excalidraw:excalidraw@10.35.144.15:5432/exca
    ports:
      - 8081:8081
  room:
    image: excalidraw/excalidraw-room:sha-49bf529
    ports:
      - 8082:80

使用了https反代,postgre数据库。目前只要一协作就报无法保存到数据库。 image

excalidraw-storage-backend容器报这个错误:

> excalidraw-storage-backend@0.0.1 start:prod
> node dist/main
[Nest] 17  - 07/27/2024, 3:10:35 AM     LOG [NestFactory] Starting Nest application...
[Nest] 17  - 07/27/2024, 3:10:35 AM   ERROR [ExceptionHandler] The "id" argument must be of type string. Received undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:406:5)
    at validateString (node:internal/validators:162:11)
    at Module.require (node:internal/modules/cjs/loader:1108:3)
    at require (node:internal/modules/helpers:130:18)
    at loadStore (/app/node_modules/keyv/src/index.js:22:15)
    at new Keyv (/app/node_modules/keyv/src/index.js:50:22)
    at /app/dist/storage/storage.service.js:25:26
    at Array.forEach (<anonymous>)
    at new StorageService (/app/dist/storage/storage.service.js:24:39)
    at Injector.instantiateClass (/app/node_modules/@nestjs/core/injector/injector.js:330:19)

经过一番折腾,发现不使用https,而使用localhost,是可以使用的。那么就是经过https反代就出现了问题。后来参考大佬的https://github.com/alswl/excalidraw-collaboration/tree/master/advanced-nginx 终于成功了。 1、我用的redis,mongo和postgre有莫名的错。

  1. 还有Nginx中,如果是非标端口,记得用proxy_set_header Host $http_host;
ajf12f commented 1 week ago

通过 redis 然后可以正常解决,然后通过域名使用 https 正常使用。可以有偿协助部署 , 邮箱: st09100#126.com