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

开启动态脱敏后没有配置的库报errlevel #1826

Closed
fiendbaal opened this issue Sep 8, 2022 · 1 comment
Closed

开启动态脱敏后没有配置的库报errlevel #1826

fiendbaal opened this issue Sep 8, 2022 · 1 comment

Comments

@fiendbaal
Copy link

重现步骤

开启了动态脱敏功能,配置了几十个脱敏字段,都是不同库表手机号,大多数都正常能实现手机号的脱敏;
唯独一个库db_ds_sso,无法脱敏,后台有errlevel报错,将data_masking_columns表与data_masking_rules表清空后报错依旧

预期外的结果

开启脱敏后,脱敏字段配置db_ds_sso库后,前端页面展示无法脱敏,且后台有报错;
删除脱敏字段配置后,后台报错依旧

日志文本

[2022-09-08 14:54:44,380][MainThread:140547087767360][task_id:default][data_masking.py:50][WARNING]- 数据脱敏异常,错误信息:Traceback (most recent call last):
  File "/opt/archery/sql/utils/data_masking.py", line 28, in data_masking
    select_list = inception_engine.query_data_masking(instance=instance, db_name=db_name, sql=sql)
  File "/opt/archery/sql/engines/goinception.py", line 188, in query_data_masking
    if print_info['errlevel'] == 0 and print_info['errmsg'] is None:
KeyError: 'errlevel'

[2022-09-08 14:54:44,381][MainThread:140547087767360][task_id:default][query.py:125][WARNING]- 数据脱敏异常,按照配置放行,查询语句:select * from tb_user_bind limit 100;,错误信息:'errlevel'

版本

1.8.5

部署方式

Docker

是否还有其他可以辅助定位问题的信息?比如数据库版本等

mysql:8.0.29

@fiendbaal
Copy link
Author

感觉和我连接用户的密码是以*号开头的有关系啊,换个账号就好了

[2022-09-09 17:22:01,032][MainThread:139948722526016][task_id:default][data_masking.py:20][WARNING]- print ================== start 
[2022-09-09 17:22:01,032][MainThread:139948722526016][task_id:default][data_masking.py:21][WARNING]- db_ds_sso
[2022-09-09 17:22:01,032][MainThread:139948722526016][task_id:default][data_masking.py:22][WARNING]- db_ds_sso
[2022-09-09 17:22:01,032][MainThread:139948722526016][task_id:default][data_masking.py:23][WARNING]- select * from tb_user limit 100;
[2022-09-09 17:22:01,032][MainThread:139948722526016][task_id:default][data_masking.py:24][WARNING]- <sql.engines.models.ResultSet object at 0x7f4845f2f730>
[2022-09-09 17:22:01,032][MainThread:139948722526016][task_id:default][data_masking.py:25][WARNING]- print ================== end 
[2022-09-09 17:22:01,040][MainThread:139948722526016][task_id:default][goinception.py:181][WARNING]- sql ====================== start
[2022-09-09 17:22:01,041][MainThread:139948722526016][task_id:default][goinception.py:182][WARNING]- /*--user=db_ds_sso;--password=*324234sfdsf;--host=172.13.111.3;--port=3306;--masking=1;*/
                          inception_magic_start;
                          use `db_ds_sso`;
                          select * from tb_user limit 100;
                          inception_magic_commit;
[2022-09-09 17:22:01,041][MainThread:139948722526016][task_id:default][goinception.py:183][WARNING]- <sql.engines.models.ResultSet object at 0x7f4845f2f4c0>
[2022-09-09 17:22:01,041][MainThread:139948722526016][task_id:default][goinception.py:184][WARNING]- sql ====================== end
[2022-09-09 17:22:01,041][MainThread:139948722526016][task_id:default][goinception.py:192][WARNING]- print_info ====================== start
[2022-09-09 17:22:01,041][MainThread:139948722526016][task_id:default][goinception.py:193][WARNING]- {'order_id': 1, 'stage': 'CHECKED', 'error_level': 2, 'stage_status': 'Audit Completed', 'error_message': '不正确的数据源信息(主机名为空,端口为0,用户名为空).', 'sql': '\n                          inception_magic_start', 'affected_rows': 0, 'sequence': '0_0_00000000', 'backup_dbname': None, 'execute_time': '0', 'sqlsha1': None, 'backup_time': '0'}
[2022-09-09 17:22:01,041][MainThread:139948722526016][task_id:default][goinception.py:194][WARNING]- print_info ====================== end
[2022-09-09 17:22:01,042][MainThread:139948722526016][task_id:default][data_masking.py:59][WARNING]- 数据脱敏异常,错误信息:Traceback (most recent call last):
  File "/opt/archery/sql/utils/data_masking.py", line 34, in data_masking
    select_list = inception_engine.query_data_masking(instance=instance, db_name=db_name, sql=sql)
  File "/opt/archery/sql/engines/goinception.py", line 195, in query_data_masking
    if print_info['errlevel'] == 0 and print_info['errmsg'] is None:
KeyError: 'errlevel'

@hhyo hhyo closed this as completed in b5bab4e Sep 17, 2022
nick2wang pushed a commit to nick2wang/Archery that referenced this issue Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant