Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error:taos connect failed, reason: Unexpected generic error in RPC. #3010

Closed
whwqs opened this issue Aug 11, 2020 · 11 comments
Closed

error:taos connect failed, reason: Unexpected generic error in RPC. #3010

whwqs opened this issue Aug 11, 2020 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@whwqs
Copy link

whwqs commented Aug 11, 2020

Bug Description
运行服务后,在linux控制台,运行taos报错:
taos connect failed, reason: Unexpected generic error in RPC.

To Reproduce
Steps to reproduce the behavior:

  1. linux版本:Linux version 3.10.0-229.el7.x86_64
  2. TDengine版本:TDengine-server-2.0.0.1-Linux-x64.rpm
  3. 运行taos报错:taos connect failed, reason: Unexpected generic error in RPC.

Expected Behavior
正常运行

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Linux version 3.10.0-229.el7.x86_64
  • Memory, CPU, current Disk Space
  • TDengine Version [TDengine-server-2.0.0.1-Linux-x64.rpm]

Additional Context
上传日志给你们
log.zip

@whwqs whwqs added the bug Something isn't working label Aug 11, 2020
@Aries-Lee1991 Aries-Lee1991 changed the title 调用taos报错:taos connect failed, reason: Unexpected generic error in RPC. error:taos connect failed, reason: Unexpected generic error in RPC. Aug 11, 2020
@localvar
Copy link
Contributor

localvar commented Aug 13, 2020

您可以查看一下服务器是否配置了 hostname 吗?谢谢

$ hostname

@whwqs
Copy link
Author

whwqs commented Aug 13, 2020

配置文件在zip文件里有,看了一下,配置好像都是用#号注释了,应该是没有配置hostname

@whwqs
Copy link
Author

whwqs commented Aug 13, 2020

卸载后重新安装,依然是同样错误,把过程贴上来,看有没有参考价值

[root@redis ~]# rpm -e TDengine
TDengine taosd is running, stopping it...
TDEngine is removed successfully!
warning: file /usr/local/taos/cfg/taos.cfg: remove failed: No such file or direc tory
[root@redis ~]# cd /opt/tdengine
[root@redis tdengine]# dir
TDengine-client TDengine-server-2.0.0.1-Linux-x64.rpm
TDengine-client-2.0.0.1-Linux-x64.tar.gz
[root@redis tdengine]# rpm -iv TDengine-server-2.0.0.1-Linux-x64.rpm
Preparing packages...
TDengine-2.0.0.1-3.x86_64
Start to install TDEngine...
Created symlink from /etc/systemd/system/multi-user.target.wants/taosd.service t o /etc/systemd/system/taosd.service.

Enter FQDN:port (like h1.taosdata.com:6030) of an existing TDengine cluster node to join
OR leave it blank to build one:
To configure TDengine : edit /etc/taos/taos.cfg
To start TDengine : sudo systemctl start taosd
To access TDengine : use taos in shell

TDengine is installed successfully!
[root@redis tdengine]# taos

Welcome to the TDengine shell from Linux, Client Version:2.0.0.1
Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.

taos connect failed, reason: Unexpected generic error in RPC.

[root@redis tdengine]# systemctl start taosd
[root@redis tdengine]# taos

Welcome to the TDengine shell from Linux, Client Version:2.0.0.1
Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.

taos connect failed, reason: Unexpected generic error in RPC.

@whwqs

This comment has been minimized.

@localvar
Copy link
Contributor

localvar commented Aug 14, 2020

请在 操作系统 shell 中执行下

$ hostname

看是否能取到正确的机器名。

@whwqs
Copy link
Author

whwqs commented Aug 14, 2020

能取到机器名:redis

@whwqs
Copy link
Author

whwqs commented Aug 14, 2020

刚才用 taos -h localhost 试了下,报错变成了:
taos connect failed, reason: Unable to establish connection.

@whwqs
Copy link
Author

whwqs commented Aug 15, 2020

今天早上用taos -h localhost ,先是这样:
[root@redis ~]# taos -h localhost

Welcome to the TDengine shell from Linux, Client Version:2.0.0.6
Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.

Failed to open file /root/.taos_history 报这个错
taos>

quit后再 taos -h localhost 正常了:
[root@redis ~]# taos -h localhost

Welcome to the TDengine shell from Linux, Client Version:2.0.0.6
Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.

taos>

直接taos还是一样的错:
Welcome to the TDengine shell from Linux, Client Version:2.0.0.6
Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.

taos connect failed, reason: Unexpected generic error in RPC.

@whwqs
Copy link
Author

whwqs commented Aug 15, 2020

基本查明原因了,是因为该虚拟机主机名起名为redis,但在 /etc/hosts 文件中未把redis配置进去,导致直接运行taos时不能把redis解析为127.0.0.1
解决方案就是:在 /etc/hosts文件中把redis配置进去,例如:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 redis

bug的线索其实也挺明显,就在 /var/log/taos/taosdlog.0文件中:
08/14 14:22:07.465621 0x7f3d4c09d740 UTL ERROR failed to get fqdn, code:-2, reason:Name or service not known
08/14 14:22:07.465661 0x7f3d4c09d740 UTL localEp is: :6030
08/14 14:22:07.466083 0x7f3d4c09d740 UTL timezone not configured, set to system default: (ADT, -0300)
08/14 14:22:07.466123 0x7f3d4c09d740 UTL ERROR locale not configured, set to system default:en_US.UTF-8
08/14 14:22:07.466133 0x7f3d4c09d740 UTL WARN charset not configured, set to system default:UTF-8
08/14 14:22:07.466166 0x7f3d4c09d740 UTL taos config & system info:
08/14 14:22:07.466170 0x7f3d4c09d740 UTL ==================================
08/14 14:22:07.466173 0x7f3d4c09d740 UTL firstEp: :6030
08/14 14:22:07.466175 0x7f3d4c09d740 UTL secondEp: :6030
08/14 14:22:07.466178 0x7f3d4c09d740 UTL fqdn:
08/14 14:22:07.466180 0x7f3d4c09d740 UTL serverPort: 6030
fqdn读取出错
大家以后碰到这个问题:直接运行taos,报错:taos connect failed, reason: Unexpected generic error in RPC.
可以尝试如下步骤解决:
1、运行hostname查看主机名
2、看 /etc/hosts文件中是否配置了上面的主机名
3、没有配置,配置好,一般就解决了

@whwqs whwqs closed this as completed Aug 15, 2020
@whwqs whwqs reopened this Aug 15, 2020
@whwqs whwqs closed this as completed Aug 15, 2020
@whwqs
Copy link
Author

whwqs commented Aug 15, 2020

抱歉,用得不熟练,bug关了又开的

@AlvinCage
Copy link

AlvinCage commented Aug 24, 2020

我使用 docker tdengine/tdengine:2.0 遇到了同样的问题:
[root@f614b2808614 TDengine-server]# taos
Welcome to the TDengine shell from Linux, Client Version:2.0.1.1
Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.
taos>
taos> create database demo;

DB error: Unexpected generic error in RPC

hostname配置操作如下(taos.cfg 默认):
[root@f614b2808614 TDengine-server]# hostname
f614b2808614
[root@f614b2808614 TDengine-server]#
[root@f614b2808614 TDengine-server]#
[root@f614b2808614 TDengine-server]# cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.3 f614b2808614
[root@f614b2808614 TDengine-server]#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants