apache / apache/cloudberry

[Bug] - CB utility analyzedb does not work

Open
#1,929 7 comments 1 reaction 0 assignees View on GitHub
type: Bug
Dominant language
C
Stars
1.4k
Forks
247
Avg merge
4d 3h
Merged PRs (30d)
39

Description

### Apache Cloudberry version

We are trying to test Apache Cloudberry 2.1.0 on Astra Linux 1.8.2 (Debian 12 based)

### What happened

Hello,

CB utility analyzedb does not work
`gpadmin@qc1:/data/cbdb/master-1/gpseg-1$ analyzedb -d dwh -p 10
20260826:18:17:57:163972 analyzedb:qc1:gpadmin-[INFO]:-Starting analyzedb with args: -d dwh -p 10
20260826:18:17:57:163972 analyzedb:qc1:gpadmin-[INFO]:-Getting and verifying input tables and materialized views...
20260826:18:17:58:163972 analyzedb:qc1:gpadmin-[INFO]:-Checking for tables with stale stats...
20260826:18:17:58:163972 analyzedb:qc1:gpadmin-[ERROR]:-'ascii' codec can't encode characters in position 13-19: ordinal not in range(128)
Traceback (most recent call last):
File "/usr/local/cloudberry-db/bin/analyzedb", line 377, in execute
heap_partitions = get_heap_tables_set(self.conn, input_tables_set) # set((schema1,table1), ...])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/cloudberry-db/bin/analyzedb", line 1005, in get_heap_tables_set
oid_str = get_oid_str(input_tables_set)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/cloudberry-db/bin/analyzedb", line 977, in get_oid_str
return ','.join(map((lambda x: regclass_schema_tbl(x[0], x[1])), table_list))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/cloudberry-db/bin/analyzedb", line 977, in
return ','.join(map((lambda x: regclass_schema_tbl(x[0], x[1])), table_list))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/cloudberry-db/bin/analyzedb", line 985, in regclass_schema_tbl
return "to_regclass('%s')" % (pg.escape_string(schema_tbl))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'ascii' codec can't encode characters in position 13-19: ordinal not in range(128)
20260826:18:17:58:163972 analyzedb:kvd-dwh-qc1-c1:gpadmin-[CRITICAL]:-analyzedb failed. (Reason=''ascii' codec can't encode characters in position 13-19: ordinal not in range(128)') exiting...`

### What you think should happen instead

_No response_

### How to reproduce

I am not sure about this problem.

### Operating System

Astra Linux 1.8.2 (Debian 12 based)

### Anything else

_No response_

### Are you willing to submit PR?

- [x] Yes, I am willing to submit a PR!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/cloudberry/blob/main/CODE_OF_CONDUCT.md).

Contributor guide

Open the contributing guide

Research direction

Start with /usr/local/cloudberry-db/bin/analyzedb, especially get_oid_str and regclass_schema_tbl around the pg.escape_string call shown in the traceback. Reproduce analyzedb against tables or materialized views with non-ASCII names on the reported environment, then verify it completes without the UnicodeEncodeError and add or run the relevant analyzedb checks if the repository provides them.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.