RTM:ERROR RtmUnauthenticatedError: Error Code 7. The vendor enabled the dynamic key, but uses the static key.

请问,集成RTM的时候,报错:RTM:ERROR RtmUnauthenticatedError: Error Code 7. The vendor enabled the dynamic key, but uses the static key.
这是在哪里设置呢?
谢谢

应该是你启用了 APP 证书但是却没有使用 Token 鉴权方式。
如果你那边目前是在测试阶段,建议新建一个没有启用 APP 证书的项目,直接使用静态密钥(APPID)的鉴权方式即可。如果项目需要上线了,再去启用 APP 证书,使用动态密钥(Token)鉴权方式。
详情请参考文档:
https://docs.agora.io/cn/Real-time-Messaging/RTM_key?platform=All%20Platforms

是的,确实是这个问题,多谢!
请问您使用过这个git吗:https://github.com/AgoraIO-Usecase/eEducation。在线互动课堂。
我把代码下载到本机,成功运行了里面的 education_web,但是就是仅仅主页而已,无法创建教室。是不是还需要启动其他项目呢?比如education_server。
谢谢

嗯,你还需要用docker来集成服务端部分的,请参考:

我在docker build的时候,执行到RUN cd /usr/src/app/agora-rtm-nodejs && npm install --ignore-scripts && npm run build:addon && npm run build:ts
总是报错:missing script: build
我查了一些资料,npm和node也都卸载后重新安装了,但是还是有问题,请问如何解决呢?

报错后有没有生成详细些的日志文件呢?看下?

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/local/bin/node’, ‘/usr/local/bin/npm’, ‘run’, ‘build’ ]
2 info using npm@6.9.0
3 info using node@v12.6.0
4 verbose stack Error: missing script: build
4 verbose stack at run (/usr/local/lib/node_modules/npm/lib/run-script.js:155:19)
4 verbose stack at /usr/local/lib/node_modules/npm/lib/run-script.js:63:5
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:115:5
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:418:5
4 verbose stack at checkBinReferences_ (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:373:45)
4 verbose stack at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:416:3)
4 verbose stack at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:160:5)
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:280:12
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:90:16
4 verbose stack at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
5 verbose cwd /Users/bbchuxing04/Downloads/eEducation-master/education_server/app/agora-rtm-nodejs
6 verbose Darwin 18.6.0
7 verbose argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” “build”
8 verbose node v12.6.0
9 verbose npm v6.9.0
10 error missing script: build
11 verbose exit [ 1, true ]

我单独执行npm run build都会报错

我们这边先测试下。

请问 missing script: build:addon 的问题解决了吗?

我这边测试过了,请参考Education server and web demo 运行指南:

Demo 链接:https://github.com/AgoraIO-Usecase/eEducation-with-Electron

  1. 需要先完成 docker 安装,然后填写镜像加速的地址;
  2. 到项目的根目录,分别执行 git submodule init 和 git submodule update;
  3. 到server目录执行 docker-compose up —-force-recreate;
  4. 安装完之后如果需要修改 AppID,那么需要把每个工程里面的 AGORA_APPID 字段改成相应的 AppID。
  5. 把 web 里面的 src /modules/Adapter/Signal.ts ROOM_CONTROL_SERVICE 改为 http://localhost:8080
  6. 把 electron 里面的 app/ modules/Adapter/Signal.ts ROOM_CONTROL_SERVICE 改为 http://localhost:8080
  7. npm intsall web的工程
  8. 最后执行 npm run start

请参考Education server and web demo 运行指南:

Demo 链接:https://github.com/AgoraIO-Usecase/eEducation-with-Electron

  1. 需要先完成 docker 安装,然后填写镜像加速的地址;
  2. 到项目的根目录,分别执行 git submodule init 和 git submodule update;
  3. 到server目录执行 docker-compose up —-force-recreate;
  4. 安装完之后如果需要修改 AppID,那么需要把每个工程里面的 AGORA_APPID 字段改成相应的 AppID。
  5. 把 web 里面的 src /modules/Adapter/Signal.ts ROOM_CONTROL_SERVICE 改为 http://localhost:8080
  6. 把 electron 里面的 app/ modules/Adapter/Signal.ts ROOM_CONTROL_SERVICE 改为 http://localhost:8080
  7. npm intsall web的工程
  8. 最后执行 npm run start

Thanks, got it

docker-compose up还是失败,麻烦帮看下什么原因?

—> 1dee9ec1d7d4

Step 10/12 : RUN cd /usr/src/app && npm install && npm run prestart

—> Running in ed579e953ac5

npm WARN server@1.0.0 No repository field.

audited 214 packages in 3.27s

found 0 vulnerabilities

server@1.0.0 prestart /usr/src/app

tsc

src/components/sentry/index.ts(77,7): error TS2531: Object is possibly ‘null’.

src/components/sentry/index.ts(82,7): error TS2531: Object is possibly ‘null’.

src/components/sentry/index.ts(101,17): error TS2345: Argument of type ‘AgoraRtmChannel | null’ is not assignable to parameter of type ‘AgoraRtmChannel | PromiseLike | undefined’.

Type ‘null’ is not assignable to type ‘AgoraRtmChannel | PromiseLike | undefined’.

src/components/sentry/index.ts(103,7): error TS2531: Object is possibly ‘null’.

src/components/sentry/index.ts(131,7): error TS2531: Object is possibly ‘null’.

src/components/sentry/index.ts(171,15): error TS2531: Object is possibly ‘null’.

src/components/sentry/index.ts(173,9): error TS2531: Object is possibly ‘null’.

npm ERR! code ELIFECYCLE

npm ERR! errno 2

npm ERR! server@1.0.0 prestart: tsc

npm ERR! Exit status 2

npm ERR!

npm ERR! Failed at the server@1.0.0 prestart script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR! /root/.npm/_logs/2019-12-25T16_20_51_485Z-debug.log

ERROR: Service ‘sentry’ failed to build: The command ‘/bin/sh -c cd /usr/src/app && npm install && npm run prestart’ returned a non-zero code: 2

看下详细日志?

是按照这个步骤操作的么?