Pivotal Knowledge Base

Follow

ANALYZEDB fails with "[CRITICAL]:-analyzedb failed. (Reason='list index out of range') exiting..."

Environment

Pivotal Greenplum: 4.3.x

Symptom

When running analyzedb with an option -f and a file list, you get an error.

Error Message:

master/gpadmin:~$ analyzedb -d MYDATABASE -f /tmp/table_list.txt -a
20170721:14:00:18:013903 analyzedb:mdw:gpadmin-[INFO]:-Starting analyzedb with args: -d cf_stg -f /tmp/table_list.txt -a
20170721:14:00:19:013903 analyzedb:mdw:gpadmin-[INFO]:-Getting and verifying input tables...
20170721:14:00:19:013903 analyzedb:mdw:gpadmin-[CRITICAL]:-analyzedb failed. (Reason='list index out of range') exiting...

Resolution

In my case, it was an extra empty like at the end of the table list (3rd line in the listening below)

master/gpadmin:~$ cat -A /tmp/table_list.txt
myschema.my_table_1^M$
myschema.my_table_2^M$
^M$

Remove the empty line, and analyzedb should work 

master/master:~$ sed -i '$ d' /tmp/table_list.txt # remove the last line
master/master:~$ cat -A /tmp/table_list.txt
cf.ufch_gf_main_v1_partitions^M$
cf.ut_gf_main_v1_partitions^M$
master/master:/tmp$ analyzedb -d MYDATABASE -f /tmp/table_list.txt -a
20170721:14:00:34:013942 analyzedb:mdw:gpadmin-[INFO]:-Starting analyzedb with args: -d cf_stg -f /tmp/table_list.txt -a
20170721:14:00:34:013942 analyzedb:mdw:gpadmin-[INFO]:-Getting and verifying input tables...
20170721:14:00:34:013942 analyzedb:mdw:gpadmin-[INFO]:-Checking for tables with stale stats...
20170721:14:00:34:013942 analyzedb:mdw:gpadmin-[INFO]:----------------------------------------------------
20170721:14:00:34:013942 analyzedb:mdw:gpadmin-[INFO]:-Total 2 tables or partitions to be analyzed
20170721:14:00:34:013942 analyzedb:mdw:gpadmin-[INFO]:----------------------------------------------------
20170721:14:00:34:013942 analyzedb:mdw:gpadmin-[INFO]:-Starting analyze with 2 workers...
20170721:14:00:35:013942 analyzedb:mdw:gpadmin-[INFO]:-Created /data1/master/gpseg-1/db_analyze/MYDATABASE/20170721140034
20170721:14:00:35:013942 analyzedb:mdw:gpadmin-[INFO]:-Writing report file /data1/master/gpseg-1/db_analyze/MYDATABASE/20170721140034/analyze_20170721140034_report
20170721:14:00:35:013942 analyzedb:mdw:gpadmin-[INFO]:-Total elapsed time: 0 seconds. Analyzed 2 out of 2 table(s) or partition(s) successfully.
20170721:14:00:35:013942 analyzedb:mdw:gpadmin-[INFO]:-Done.

Comments

Powered by Zendesk