原文链接:www.gbase.cn/community/p...
更多精彩内容尽在南大通用GBase技术社区,南大通用致力于成为用户最信赖的数据库产品供应商。
常见加载错误及原因
报Login denied uri
用例:
lua
gbase> load data infile 'ftp://gbase:gbase123@172.16.128.11//home/gbase/*.tbl' into table test.tmp_lxj_1212_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: Expanding wildcard operation failed with error - Login denied uri : ftp://gbase:********@172.16.128.11//home/gbase/%2a.tbl.
错误原因:gbase用户密码错误
报Couldn't connect to server
用例:
vbnet
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/1.txt' into table test.tmp_lxj_1212_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: I/O operation on ftp://gbase:*****@172.16.128.11//home/gbase/1.txt failed with error - Couldn't connect to server, File name ftp://gbase:*****@172.16.128.11//home/gbase/1.txt
报错原因:ip地址错误或者vsftpd服务没有启动
报failed to get table distribution information.
用例:
lua
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/1.txt' into table test.tmp_lxj_0621_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: failed to get table distribution information.
报错原因:所涉及加载表不存在
报550 Could not get file size.
用例:
sql
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/4.txt' into table test.tmp_lxj_1212_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: I/O operation on ftp://gbase:*****@172.16.128.11//home/gbase/4.txt failed with error - 550 Could not get file size., File name ftp://gbase:*****@172.16.128.11//home/gbase/4.txt
错误原因:/home/gbase/4.txt 这个文件不存在
报Remote file not found uri
用例:
lua
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/*.tbl' into table test.tmp_lxj_1212_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: Expanding wildcard operation failed with error - Remote file not found uri : ftp://gbase:*****@172.16.128.11//home/gbase/%2a.tbl.
错误原因:/home/gbase/*.tbl 没有匹配到文件,通配符文件不存在
报Access denied to remote resource
用例:
vbnet
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11/home/gbase/2.txt' into table test.tmp_lxj_1212_test data_format 3 max_bad_records 0;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: I/O operation on ftp://gbase:*****@172.16.128.11/home/gbase/2.txt failed with error - Access denied to remote resource, File name ftp://gbase:*****@172.16.128.11/home/gbase/2.txt
错误原因:/home/gbase/2.txt路径错误
报Too many bad records
用例:
vbnet
load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/2.txt'
into table test.tmp_lxj_1212_test data_format 3 max_bad_records 0;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: Task 262162 failed, [172.16.128.12:5050](GBA-02AD-0005)Failed to query in gnode:
DETAIL: (GBA-01-600) Gbase internal error: Task 262162, Too many bad records!
错误原因:错误数据行数超过max_bad_records指定值
报read operation timeout
用例:
less
2016-12-15 14:52:47.253 [SQLDISP][ERROR][S:83876][Q:696407]:Query failed, THD(0x4b9f6000) HOST(10.17.6.52:5050->50885) reason: (GBA-01-600) Gbase internal error: I/O operation on ftp://doubass:*********@10.255.219.24//data3/asiainfo/interface/12300/data/s_12300_BAS_04002_20161214_011_00_016.dat failed with error - read operation timeout
错误原因:如果填充一个数据块(8M)的时间超过[gbase_loader_read_timeout]参数值,加载任务将报错停止
报Timeout was reached
用例:
less
2016-12-15 15:49:52.221 [SQLDISP][ERROR][S:191527][Q:1487078]:
Query failed, THD(0x429ae000) HOST(10.17.6.95:5050->110938) reason: (GBA-01-600)
Gbase internal error: Task 622072, I/O operation on
ftp://doubass:*********@10.255.219.26//data6/asiainfo/interface/12900/data/a_12900_BAS_01002_20161214_00.verf failed with error - Timeout was reached
错误原因:ftp服务器端超时
报Unsupport local file for loader
用例:
lua
gbase> load data infile '//home/gbase/1.txt' into table test.tmp_lxj_1212_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: Unsupport local file for loader
错误原因:不支持本地文件加载,即file_list参数部分必须填写ip地址和登录用户信息
报Line length is more than gbase_loader_max_line_lengt
用例:
vbnet
gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/024123_0' into table test.tmp_lxj_1220_test data_format 3;
ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: Task 393223 failed, [172.16.128.12:5050](GBA-02AD-0005)Failed to query in gnode:
DETAIL: (GBA-01-600) Gbase internal error: Line length 8388608 is more than gbase_loader_max_line_length ( 4194304 ) in file 'ftp://gbase:*****@172.16.128.11//home/gbase/024123_0'
1024*1024
错误原因:行长度超过参数gbase_loader_max_line_length值。
报validate error
用例1:字符串加载到数字类型字段
1\]数据内容: \[root@Node1 gbase\]# cat 1.txt 1 2 3 a \[2\]表结构:create table tmp_lxj_1212_test(id int); \[3\]加载sql: ```sql gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/1.txt' into table test.tmp_lxj_1212_test data_format 3; Query OK, 3 rows affected (Elapsed: 00:00:01.32) Task 393224 finished, Loaded 3 records, Skipped 1 records ``` \[4\]存在一条skip数据,查看trc日志: ```markdown [root@Node1 gbase]# cexecs "ls -lrt /opt/gnode/log/gbase/loader_logs/393224*" ************************ coor ************************ --------- 172.16.128.11--------- -rw-rw---- 1 gbase gbase 146 12月 20 04:43 /opt/gnode/log/gbase/loader_logs/393224_test_tmp_lxj_1212_test_n1_172.16.128.11_20161220044343.trc -rw-rw---- 1 gbase gbase 2 12月 20 04:43 /opt/gnode/log/gbase/loader_logs/393224_test_tmp_lxj_1212_test_n1_172.16.128.11_20161220044343.err --------- 172.16.128.12--------- ls: 无法访问/opt/gnode/log/gbase/loader_logs/393224*: 没有那个文件或目录 [root@Node1 gbase]# cat /opt/gnode/log/gbase/loader_logs/393224_test_tmp_lxj_1212_test_n1_172.16.128.11_20161220044343.trc file_name | file_offset | record_len | column | reason ftp://gbase:*****@172.16.128.11//home/gbase/1.txt|6|2|1|validate error ``` 用例2:yyyymmdd日期格式数据加载到date字段 \[1\]数据内容 \[root@Node1 gbase\]# cat date.txt 20161212 \[2\]表结构:create table tmp_lxj_1212_date_test(v_date date); \[3\]加载sql: ```vbnet gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/date.txt' into table test.tmp_lxj_1220_date_test data_format 3 max_bad_records 0; ERROR 1733 (HY000): (GBA-01EX-700) Gbase general error: Task 393227 failed, [172.16.128.11:5050](GBA-02AD-0005)Failed to query in gnode: DETAIL: (GBA-01-600) Gbase internal error: Task 393227, Too many bad records! ``` \[4\] 查看trc日志: ```perl [root@Node2 ~]# cat /opt/gnode/log/gbase/loader_logs/393226_test_tmp_lxj_1220_date_test_n1_172.16.128.12_20161220225132.trc file_name | file_offset | record_len | column | reason ftp://gbase:*****@172.16.128.11//home/gbase/date.txt|0|9|1|validate error ``` ## 报text parser error 用例:表列数与文件列数不一致,文件列数多于表列数 \[1\]数据内容: \[root@Node1 gbase\]# cat 1212.txt 1,2 \[2\]表结构:create table tmp_lxj_1212_test(id int); \[3\]加载sql: ```sql gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/1212.txt' into table test.tmp_lxj_1212_test data_format 3 fields terminated by ','; Query OK, 0 rows affected (Elapsed: 00:00:00.63) Task 393231 finished, Loaded 0 records, Skipped 1 records ``` \[4\]存在一条skip数据,查看trc日志: ```markdown [root@Node1 gbase]# cexec "ls -lrt /opt/gnode/log/gbase/loader_logs/393231*" ************************* coor ************************* --------- 172.16.128.11--------- ls: 无法访问/opt/gnode/log/gbase/loader_logs/393231*: 没有那个文件或目录 --------- 172.16.128.12--------- -rw-rw---- 1 gbase gbase 152 12月 20 23:40 /opt/gnode/log/gbase/loader_logs/393231_test_tmp_lxj_1212_test_n1_172.16.128.12_20161220234049.trc -rw-rw---- 1 gbase gbase 4 12月 20 23:40 /opt/gnode/log/gbase/loader_logs/393231_test_tmp_lxj_1212_test_n1_172.16.128.12_20161220234049.err [root@Node2 ~]# cat /opt/gnode/log/gbase/loader_logs/393231_test_tmp_lxj_1212_test_n1_172.16.128.12_20161220234049.trc file_name | file_offset | record_len | column | reason ftp://gbase:*****@172.16.128.11//home/gbase/1212.txt|0|4|2|text parser error ``` ## 报data column size less than defined size 用例:表列数与文件列数不一致,文件列数少于表列数 \[1\]数据内容: \[root@Node1 gbase\]# cat 1.txt 1 \[2\]表结构:create table tmp_lxj_1212_test1(id int,name varchar(10)); \[3\]加载sql: ```sql gbase> load data infile 'ftp://gbase:gbase@172.16.128.11//home/gbase/1.txt' into table test.tmp_lxj_1212_test1 data_format 3; Query OK, 0 rows affected (Elapsed: 00:00:00.38) Task 393233 finished, Loaded 0 records, Skipped 4 records ``` \[4\]存在4条skip数据 ```markdown [root@Node1 gbase]# cexecs "ls -lrt /opt/gnode/log/gbase/loader_logs/393233*" ************************ coor ************************ --------- 172.16.128.11--------- ls: 无法访问/opt/gnode/log/gbase/loader_logs/393233*: 没有那个文件或目录 --------- 172.16.128.12--------- -rw-rw---- 1 gbase gbase 459 12月 20 23:47 /opt/gnode/log/gbase/loader_logs/393233_test_tmp_lxj_1212_test1_n1_172.16.128.12_20161220234703.trc -rw-rw---- 1 gbase gbase 8 12月 20 23:47 /opt/gnode/log/gbase/loader_logs/393233_test_tmp_lxj_1212_test1_n1_172.16.128.12_20161220234703.err [root@Node2 ~]# cat /opt/gnode/log/gbase/loader_logs/393233_test_tmp_lxj_1212_test1_n1_172.16.128.12_20161220234703.trc file_name | file_offset | record_len | column | reason ftp://gbase:*****@172.16.128.11//home/gbase/1.txt|0|2|1|data column size less than defined size ``` 原文链接:[www.gbase.cn/community/p...](https://link.juejin.cn?target=https%3A%2F%2Fwww.gbase.cn%2Fcommunity%2Fpost%2F6085 "https://www.gbase.cn/community/post/6085") 更多精彩内容尽在[南大通用GBase技术社区](https://link.juejin.cn?target=https%3A%2F%2Fwww.gbase.cn%2Fcommunity "https://www.gbase.cn/community"),南大通用致力于成为用户最信赖的数据库产品供应商。