Unable to access table with "ERROR: Unexpected internal error (cdbgang.c:1673)" in Pivotal Greenplum
search cancel

Unable to access table with "ERROR: Unexpected internal error (cdbgang.c:1673)" in Pivotal Greenplum

book

Article ID: 295867

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

Symptoms:
When attempting to access a table with a command, such as select * from test_table limit 10;, the following error is outputted:
psql (8.2.15)
Type "help" for help.
test_db=> select * from test_table limit 10; 
ERROR: Unexpected internal error (cdbgang.c:1673)
The master log does not provide a clear reason for the error:
2018-12-20 16:28:26.805990 CST,"test_user","test_db",p19871,th186427168,"[local]",,2018-12-20 16:28:19 CST,29026571,con2930,,seg-1,,dx4426,x29026571,sx1,"ERROR","XX000","Unexpected internal error (cdbgang.c:1673)",,,,,,"select * from test_table limit 10;",0,,"cdbgang.c",1673,"Stack trace:
1    0xb08272 postgres <symbol not found> (elog.c:502)
2    0xb0c6e2 postgres elog_internalerror (elog.c:279)
3    0xc34b91 postgres allocateWriterGang (cdbgang.c:1640)
4    0x76f466 postgres AssignGangs (execUtils.c:1900)
5    0x755baf postgres ExecutorStart (execMain.c:558)
6    0x9a281d postgres PortalStart (pquery.c:847)
7    0x99ad93 postgres <symbol not found> (postgres.c:1775)
8    0x99f249 postgres PostgresMain (postgres.c:4761)
9    0x8f981e postgres <symbol not found> (postmaster.c:6672)
10   0x8fc4b0 postgres PostmasterMain (postmaster.c:7603)
11   0x7fbf0f postgres main (main.c:206)
12   0x30a061ed1d libc.so.6 __libc_start_main + 0xfd
13   0x4bea69 postgres <symbol not found> + 0x4bea69


First, check whether any other users can access the table.

If a different user cannot access the table, the issue lies on the user itself instead of the table.

Environment


Cause

From the catalog log, observe the following inconsistency issues:
test_db=# select oid from pg_authid where rolname = 'test_user';
  oid  
-------
 25110
(1 row)

20181220:08:52:02:041201 gpcheckcat-[ERROR]:-  pg_authid has 2 issue(s)
    oid | rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcatupdate | rolcanlogin | rolconnlimit | rolpassword | rolvaliduntil | rolconfig | rolresqueue | rolcreaterextgpfd | rolcreaterexthttp | rolcreatewextgpfd | rolcreaterexthdfs | rolcreatewexthdfs | segids
    25110 | test_user | f | t | f | f | f | t | -1 | md532fbe0451e5b8ae4b3e30548538c6d50 | None | None | 17379 | f | f | f | f | f | {-1}
    25110 | test_user | f | t | f | f | f | f | -1 | md532fbe0451e5b8ae4b3e30548538c6d50 | None | None | 17379 | f | f | f | f | f | {NULL}
You can see that the column "rolcanlogin" shows 't' for master and shows 'f' for segments. This means that you have accessibility to only the master.

This can be verified by executing the following operation:
[gpadmin@sdw1 pg_log]$ PGOPTIONS='-c gp_session_role=utility' psql -h sdw1 -p 40001 -U test_user
psql: FATAL: role "test_user" is not permitted to log in

Resolution

Re-grant the necessary login privilege on segments to the desired user:
alter role test_user with login;