obd web白屏部署“预检查”时,出现请求错误Internal Server Error

【 使用环境 】测试环境
【 OB or 其他组件 】OBD
【 使用版本 】OBD2.1.1
【问题描述】obd web命令进行白屏部署。选项如下
1、完全部署。
2、Zone 名称把默认的后面2个删掉了,只留了1个Zone1(OBServer节点)
3、集群模式为最小可用。

【问题现象及影响】
1、在“集群配置”选项时,点“更多配置”,会报错网络异常,您的网络发生异常,无法连接服务器。见附件1.
2、在“预检查”步骤时,出现请求错误,Internal Server Error。
错误截图和obd web打印日志已在附件。

【附件】

obd web预检查错误时的日志


这个环境之前部署过obd吗? 另外浏览器打开f12 看看点击更多配置时 发送的请求和响应的数据

1 个赞

是的,之前部署过obd的,然后卸载了重装过。

点击“ 更多参数”时 请求内容如下:

POST /api/v1/components/parameters HTTP/1.1
Host: 172.16.0.58:8680
Connection: keep-alive
Content-Length: 87
Pragma: no-cache
Cache-Control: no-cache
Accept: application/json
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Mobile Safari/537.36
Content-Type: application/json
Origin: http://172.16.0.58:8680
Referer: http://172.16.0.58:8680/
Accept-Encoding: gzip, deflate
Cookie: grafana_session=cbfdd530c64eab68de7cde2ca29e3cde; _TRACERT_COOKIE__SESSION=fc3a3da4-88cf-4a7c-a450-ad8dd1611f20; tree=a3696%019b43cfa5-628c-46b8-9e9a-22792460664b%012

{"filters":[{"component":"oceanbase-ce","version":"4.1.0.1","is_essential_only":true}]}

返回内容:

HTTP/1.1 500 Internal Server Error
date: Fri, 16 Jun 2023 10:02:58 GMT
server: uvicorn
content-length: 21
content-type: text/plain; charset=utf-8

Internal Server Error

点击预检查时,调用了2次precheck,一次为Post一次为Get,如图

第一次precheck如下

POST /api/v1/deployments/wisdombase/precheck HTTP/1.1
Host: 172.16.0.58:8680
Connection: keep-alive
Content-Length: 0
Pragma: no-cache
Cache-Control: no-cache
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Mobile Safari/537.36
Accept: */*
Origin: http://172.16.0.58:8680
Referer: http://172.16.0.58:8680/
Accept-Encoding: gzip, deflate
Cookie: grafana_session=cbfdd530c64eab68de7cde2ca29e3cde; _TRACERT_COOKIE__SESSION=fc3a3da4-88cf-4a7c-a450-ad8dd1611f20; tree=a3696%019b43cfa5-628c-46b8-9e9a-22792460664b%012

返回:

HTTP/1.1 200 OK
date: Fri, 16 Jun 2023 10:06:32 GMT
server: uvicorn
content-type: application/json
x-process-time: 73.30107688903809ms
x-request-id: 9480bbc9b96f42f39ae2cf0949623e77
access-control-expose-headers: X-Request-ID
content-encoding: gzip
vary: Accept-Encoding
Transfer-Encoding: chunked

{"code":200,"data":"precheck for wisdombase","msg":"successful","success":true}

第二次Precheck如下:

GET /api/v1/deployments/wisdombase/precheck HTTP/1.1
Host: 172.16.0.58:8680
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Mobile Safari/537.36
Accept: */*
Referer: http://172.16.0.58:8680/
Accept-Encoding: gzip, deflate
Cookie: grafana_session=cbfdd530c64eab68de7cde2ca29e3cde; _TRACERT_COOKIE__SESSION=fc3a3da4-88cf-4a7c-a450-ad8dd1611f20; tree=a3696%019b43cfa5-628c-46b8-9e9a-22792460664b%012

返回:

HTTP/1.1 500 Internal Server Error
date: Fri, 16 Jun 2023 10:06:32 GMT
server: uvicorn
content-length: 21
content-type: text/plain; charset=utf-8

Internal Server Error
1 个赞

怀疑2个方面:
1、obweb 服务异常 — 》通过kill obd web进程 重启解决
2、obd环境之前没卸载干净 --》 卸载obd 删除~/.obd 重新安装

1、已经重开终端,重新obd web重新开始也一样错误。
2、obd环境,已经通过obd cluster destroy卸载。
也通过rpm -qa|grep ob-deploy和rpm -e --nodeps xxx 卸载了。
并且把.obd删除了rm -rf ~/.obd/*
同时环境变量 ~/.bash_profile/内的已经删除并且重启了终端。

1 个赞

你用的obd 通过在线去拉镜像 还是通过all in one形式安装的

之前是通过all in one安装的,这次是在线安装的。

通过obd cluster list发现有好几个有可能是以前的?有影响吗?
其中wisdombase才是新建的

all in one卸载的时候需要删除环境变量,我刚拿了一个干净的环境用这个包装是好使的。还是考虑环境 或者网络问题 ,先清理一下 all in one的环境变量试下,或者你有别的机器的话可以试一下

obd --verison 看一下 目前生效的版本

这些操作都试过了,清理过了

obd --verison版本
OceanBase Deploy: 2.1.1
REVISION: e2826f90e44dba3aadf030d3fc7b8bfe02984aec
BUILD_BRANCH: HEAD
BUILD_TIME: Jun 09 2023 10:26:36OURCE

点击“更多配置”时日志打印的异常是这样的,你看下根据错误提示能不能有点头绪:
有句TypeError: ‘NoneType’ object is not callable是不是关键问题?

2023-06-16 19:25:20,341 INFO list_component_parameters (component_handler.py:147                                                                                        ) [b4dc24a103fb457992c9f7f1d3cca132] dump config
Exception in ASGI application
Traceback (most recent call last):
  File "uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
  File "uvicorn/middleware/proxy_headers.py", line 78, in __call__
  File "fastapi/applications.py", line 270, in __call__
  File "starlette/applications.py", line 124, in __call__
  File "starlette/middleware/errors.py", line 184, in __call__
  File "starlette/middleware/errors.py", line 162, in __call__
  File "starlette/middleware/gzip.py", line 24, in __call__
  File "starlette/middleware/gzip.py", line 43, in __call__
  File "asgi_correlation_id/middleware.py", line 81, in __call__
  File "starlette/middleware/base.py", line 106, in __call__
  File "starlette_prometheus/middleware.py", line 57, in dispatch
  File "starlette_prometheus/middleware.py", line 53, in dispatch
  File "starlette/middleware/base.py", line 80, in call_next
  File "starlette/middleware/base.py", line 69, in coro
  File "starlette/middleware/base.py", line 106, in __call__
  File "service/middleware/request_response_log.py", line 42, in dispatch
  File "starlette/middleware/base.py", line 80, in call_next
  File "starlette/middleware/base.py", line 69, in coro
  File "starlette/middleware/base.py", line 106, in __call__
  File "service/middleware/process_time.py", line 32, in dispatch
  File "starlette/middleware/base.py", line 80, in call_next
  File "starlette/middleware/base.py", line 69, in coro
  File "starlette/middleware/exceptions.py", line 79, in __call__
  File "starlette/middleware/exceptions.py", line 68, in __call__
  File "fastapi/middleware/asyncexitstack.py", line 21, in __call__
  File "fastapi/middleware/asyncexitstack.py", line 18, in __call__
  File "starlette/routing.py", line 706, in __call__
  File "starlette/routing.py", line 276, in handle
  File "starlette/routing.py", line 66, in app
  File "fastapi/routing.py", line 235, in app
  File "fastapi/routing.py", line 161, in run_endpoint_function
  File "service/api/v1/components.py", line 42, in list_component_parameters
  File "service/handler/component_handler.py", line 161, in list_component_param                                                                                        eters
  File "core.py", line 184, in call_plugin
TypeError: 'NoneType' object is not callable

把软件包 all-in-one 都下载下来 ,把之前的安装包和目录都手动删除掉。(rpm -e 和 /bin/rm -rf ~/.obd, 退出所有终端,看看 .bash_profile 里有残留 环境变量 export 设置么)
另外看看 python 版本。
重新安装试试,参考: OB 社区版 4.1 和 OCP express 笔记本电脑部署体验 (qq.com) ,每一步命令操作,截大图,所有信息 都提供(不要部分信息和图)。如果报错,有 log 就提供log 。
信息全了,有问题大家也能帮忙看。

官网下载的 oceanbase-all-in-one 里 OBD 版本是 2.1.0 。 先全部下载下来试试。

@谐云 已经安装了 OBD 2.1.0 的,好像没有办法通过 obd update 升级到 2.1.1 .

[root@server066 soft]$obd --version
OceanBase Deploy: 2.1.0
REVISION: a44bf47214329b0d9dcbcbed7ab827c0b6d98892
BUILD_BRANCH: HEAD
BUILD_TIME: May 19 2023 10:50:39OURCE
Copyright (C) 2021 OceanBase
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[root@server066 soft]$obd update
No updates detected. OBD is already up to date.
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 1ae57c44-0ca7-11ee-844e-0050569ddf56
If you want to view detailed obd logs, please run: obd display-trace 1ae57c44-0ca7-11ee-844e-0050569ddf56
[root@server066 soft]$obd display-trace 1ae57c44-0ca7-11ee-844e-0050569ddf56
[2023-06-17 08:37:14.539] [DEBUG] - cmd: []
[2023-06-17 08:37:14.539] [DEBUG] - opts: {}
[2023-06-17 08:37:14.539] [DEBUG] - mkdir /root/.obd/lock/
[2023-06-17 08:37:14.539] [DEBUG] - unknown lock mode
[2023-06-17 08:37:14.540] [DEBUG] - try to get share lock /root/.obd/lock/global
[2023-06-17 08:37:14.540] [DEBUG] - share lock `/root/.obd/lock/global`, count 1
[2023-06-17 08:37:14.540] [DEBUG] - try to get exclusive lock /root/.obd/lock/global
[2023-06-17 08:37:14.540] [DEBUG] - exclusive lock `/root/.obd/lock/global`, count 1
[2023-06-17 08:37:14.541] [DEBUG] - mkdir /root/.obd/plugins
[2023-06-17 08:37:14.542] [DEBUG] - mkdir /root/.obd/mirror
[2023-06-17 08:37:14.542] [DEBUG] - mkdir /root/.obd/mirror/remote
[2023-06-17 08:37:14.542] [DEBUG] - mkdir /root/.obd/mirror/local
[2023-06-17 08:37:14.542] [DEBUG] - try to get exclusive lock /root/.obd/lock/mirror_and_repo
[2023-06-17 08:37:14.543] [DEBUG] - exclusive lock `/root/.obd/lock/mirror_and_repo`, count 1
[2023-06-17 08:37:14.543] [DEBUG] - exclusive lock `/root/.obd/lock/mirror_and_repo`, count 2
[2023-06-17 08:37:14.543] [DEBUG] - load repo config: /root/.obd/mirror/remote/OceanBase.repo
[2023-06-17 08:37:14.543] [DEBUG] - open /root/.obd/mirror/remote/OceanBase.repo for r
[2023-06-17 08:37:14.544] [DEBUG] - exclusive lock `/root/.obd/lock/mirror_and_repo`, count 3
[2023-06-17 08:37:14.545] [DEBUG] - md5 is None
[2023-06-17 08:37:14.545] [DEBUG] - name is ob-deploy
[2023-06-17 08:37:14.545] [DEBUG] - arch is ['ia32e', 'x86_64', 'athlon', 'i686', 'i586', 'i486', 'i386', 'noarch']
[2023-06-17 08:37:14.545] [DEBUG] - release is None
[2023-06-17 08:37:14.545] [DEBUG] - version is None
[2023-06-17 08:37:14.545] [DEBUG] - MirrorRepositoryType.LOCAL mirror local found pkg: None
[2023-06-17 08:37:14.545] [INFO] No updates detected. OBD is already up to date.
[2023-06-17 08:37:14.545] [INFO] See https://www.oceanbase.com/product/ob-deployer/error-codes .
[2023-06-17 08:37:14.546] [INFO] Trace ID: 1ae57c44-0ca7-11ee-844e-0050569ddf56
[2023-06-17 08:37:14.546] [INFO] If you want to view detailed obd logs, please run: obd display-trace 1ae57c44-0ca7-11ee-844e-0050569ddf56
[2023-06-17 08:37:14.546] [DEBUG] - exclusive lock /root/.obd/lock/mirror_and_repo release, count 2
[2023-06-17 08:37:14.546] [DEBUG] - exclusive lock /root/.obd/lock/mirror_and_repo release, count 1
[2023-06-17 08:37:14.546] [DEBUG] - exclusive lock /root/.obd/lock/mirror_and_repo release, count 0
[2023-06-17 08:37:14.546] [DEBUG] - unlock /root/.obd/lock/mirror_and_repo
[2023-06-17 08:37:14.546] [DEBUG] - exclusive lock /root/.obd/lock/global release, count 0
[2023-06-17 08:37:14.546] [DEBUG] - try to get share lock /root/.obd/lock/global
[2023-06-17 08:37:14.546] [DEBUG] - share lock /root/.obd/lock/global release, count 0
[2023-06-17 08:37:14.547] [DEBUG] - unlock /root/.obd/lock/global

问题已解决。原因是使用教程文章《 通过 OBD 白屏部署 OceanBase 集群》的“在线部署”方案时,可能下载的组件缺失或有问题。
教程地址:
https://www.oceanbase.com/docs/common-oceanbase-database-cn-10000000001697442
解决方案是:
使用这教程里的“离线部署”方案,把 all-in-one 安装包拷到目标机器里再安装。

建议:
在线安装部分教程可能存在问题,请检查核实。

1 个赞

如果是在线包缺失 可以在~/.obd/repository/ 目录下删除组件对应的包 下次会自动下载。目前下载检查逻辑只判断了 有对应的包 就不会下载了。没有才下载

~/.obd/删除过几次了,然后按文章教程的重复在线安装数次,依然提示这个。你们重复下这些步骤看能否重现?