已关闭
【26.09-alpha】rdfproc 执行命名存储 serialize 失败 #6
wang-kun-1005创建于  9月1日关闭于  9月2日
wang-kun-1005
wang-kun-1005成员
9月1日 创建

【缺陷描述】:请补充详细的缺陷问题现象描述

运行 rdfproc序列化命令时,提示 rdfproc: Failed to open hashes storage 'test'

一、缺陷信息

redland-1.0.17-23.oe2609

【缺陷所属的os版本】

openEuler-26.09

【内核版本】

6.6.0-163.0.0.1.oe2609

【缺陷所属软件及版本号】

redland-1.0.17-23.oe2609

【环境信息】

硬件信息

  • 提供跟硬件相关的信息,如架构、cpu和内存规格等
  • 虚拟机场景,额外补充宿主机os版本类型

软件信息

  • 跟缺陷所属软件相关的其它软件版本信息(如软件包构建失败由gcc引起,请填写gcc的版本号)

网络信息

  • 如果有特殊组网,请提供网络拓扑信息以及网络数据走向

【问题复现步骤】

  1. 安装 redland 软件包
    yum install -y redland
  2. 执行命令:rdfproc -c test serialize ntriples

【实际结果】

控制台打印报错:rdfproc: Failed to open hashes storage 'test',命令返回码为 1,测试失败

【期望结果】

命令正常执行,成功输出序列化内容,

【其他相关附件信息】

image.png

【缺陷详情及分析指导参考链接】

二、缺陷分析结构反馈
影响性分析说明:

缺陷严重等级:(Critical/High/Moderate/Low)

缺陷根因说明:

受影响版本排查(受影响/不受影响):
openEuler-20.03-LTS-SP4
openEuler-22.03-LTS-SP3
openEuler-22.03-LTS-SP4
openEuler-24.03-LTS
openEuler-24.03-LTS-SP1
openEuler-24.03-LTS-SP2

修复是否涉及abi变化(是/否):
openEuler-20.03-LTS-SP4
openEuler-22.03-LTS-SP3
openEuler-22.03-LTS-SP4
openEuler-24.03-LTS
openEuler-24.03-LTS-SP1
openEuler-24.03-LTS-SP2

likedislike
wang-kun-1005wang-kun-1005成员
9月1日 关联了里程碑:openEuler-26.09-DevStation-alpha
openeuler-ci-botopeneuler-ci-bot成员
9月1日 修改了issue 的描述
openeuler-ci-bot
openeuler-ci-bot成员
9月1日 评论:

以下的要求不是强制性的, 未按模板评论时对issue无任何影响
issue处理注意事项:
1. 当前issue受影响的分支提交pr时, 须在pr描述中填写当前issue编号进行关联, 否则无法关闭当前issue;
2. 模板内容需要填写完整, 无论是受影响或者不受影响都需要填写完整内容,未引入的分支不需要填写, 否则无法关闭当前issue;
3. 以下为模板中需要填写完整的内容, 请复制到评论区回复, 注: 内容的标题名称(影响性分析说明, 缺陷严重等级, 受影响版本排查(受影响/不受影响), 修复是否涉及abi变化(是/否))不能省略,省略后defect-manager将无法正常解析填写内容.
评论区可能使用到的指令说明:

指令 指令说明 使用权限
/check-issue 触发defect-manager校验 不限
/reason xxx /reason +挂起或取消条件 不限

影响性分析说明:

缺陷严重等级:(Critical/High/Moderate/Low)

缺陷根因说明:

受影响版本排查(受影响/不受影响):

  1. openEuler-20.03-LTS-SP4:
  2. openEuler-22.03-LTS-SP3:
  3. openEuler-22.03-LTS-SP4:
  4. openEuler-24.03-LTS:
  5. openEuler-24.03-LTS-SP1:
  6. openEuler-24.03-LTS-SP2:

abi变化(是/否):

  1. openEuler-20.03-LTS-SP4:
  2. openEuler-22.03-LTS-SP3:
  3. openEuler-22.03-LTS-SP4:
  4. openEuler-24.03-LTS:
  5. openEuler-24.03-LTS-SP1:
  6. openEuler-24.03-LTS-SP2:

缺陷issue处理具体操作请参考:
https://atomgit.com/openeuler/cve-manager/blob/master/cve-vulner-manager/doc/md/defect-manager-manual.md
pr关联issue具体操作请参考:
https://docs.atomgit.com/docs/help/home/org_project/pullrequests/pr-related-issue

likedislike
openeuler-ci-botopeneuler-ci-bot成员
9月1日 将 small_leek、Charlie_li1、wang-kun-1005 设为负责人
openeuler-ci-botopeneuler-ci-bot成员
9月1日 添加了label:DEFECT/UNFIXED
openeuler-ci-botopeneuler-ci-bot成员
9月1日 添加了label:sig/Runtime
openeuler-ci-bot
openeuler-ci-bot成员
9月1日 评论:

Welcome To openEuler Community

Hey @wang-kun-1005 , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands. You can self-configure the PR merge rules for this repository. For more details, please refer to Here.

Contact Guide

If you have any questions, please contact the SIG: Runtime ,
and any of the maintainers: @Charlie_li1, @small_leek ,
and any of the committers: @gitee-cmd, @starlet-dx, @wang--ge .

likedislike
wang--ge成员
9月2日 评论:

该问题主要是由于 libdb 依赖被清退,spec里加了 --without-bdb 参数移除了 libdb 支持
https://atomgit.com/src-openeuler/redland/pull/16
而 rdfproc工具硬编码默认存储类型 hashes、默认存储选项 hash-type='bdb',dir='.'。由于 librdf 的 hash 工厂是编译期注册的(librdf_init_hash_bdb 未编译),bdb 后端不存在,导致未显式指定存储类型的 rdfproc 命令(如 rdfproc -c test serialize ntriples、parse、add、print 等)全部无法打开默认存储导致报错

目前需要适配用例, 可以将libdb 切换为 sqlite 执行
mugen 用例参考如下说明进行适配
oe_test_redland_rdfproc_01.sh:
存储命令统一加 -s sqlite,期望文件名从 bdb 的 *.db 改为 sqlite 的实际文件名(= 存储名),并加 2>/dev/null 屏蔽 sqlite 懒建表的"no such table" 噪音(exit 返回0,不影响退出码断言)

    # master (24.09+) 的 redland 以 --without-bdb 构建,默认 bdb hashes 存储不可用,
    # 统一改用 sqlite 存储(-s sqlite);sqlite 以存储名直接作为 db 文件名
    rdfproc -s sqlite -c test serialize ntriples 2>/dev/null && test -f test
    CHECK_RESULT $? 0 0 "Check rdfproc -c test serialize ntriples failed"

    rdfproc -s sqlite --contexts test1 serialize ntriples 2>/dev/null && test -f test1
    CHECK_RESULT $? 0 0 "Check rdfproc --contexts test1 serialize ntriples failed"

    rdfproc -s sqlite -n test2 add SUBJECT PREDICATE OBJECT 2>/dev/null && test -f test2
    CHECK_RESULT $? 0 0 "Check rdfproc -n test2 add SUBJECT PREDICATE OBJECT failed"

    rdfproc -s sqlite --new test3 add SUBJECT PREDICATE OBJECT 2>/dev/null && test -f test3
    CHECK_RESULT $? 0 0 "Check rdfproc --new test3 add SUBJECT PREDICATE OBJECT failed"

    rdfproc -s sqlite -o rdfxml test4 print 2>/dev/null && test -f test4
    CHECK_RESULT $? 0 0 "Check rdfproc -o rdfxml test4 print failed"

    rdfproc -s sqlite --output ntriples test5 print 2>/dev/null && test -f test5
    CHECK_RESULT $? 0 0 "Check rdfproc --output ntriples test5 print failed"

    echo test123 | rdfproc -s sqlite -p test6 add SUBJECT PREDICATE OBJECT 2>/dev/null && test -f test6
    CHECK_RESULT $? 0 0 "Check echo Huawei@123 | rdfproc -p test6 add SUBJECT PREDICATE OBJECT failed"

    echo test123 | rdfproc -s sqlite --password test7 add SUBJECT PREDICATE OBJECT 2>/dev/null && test -f test7
    CHECK_RESULT $? 0 0 "Check echo Huawei@123 | rdfproc --password test7 add SUBJECT PREDICATE OBJECT failed"

oe_test_redland_rdfproc_02.sh:

new='yes' 是 sqlite 存储的"新建"选项——告诉 sqlite 存储把这次打开当作"新建一个存储"处理,等价于命令行 -n/--new 的语义,但通过存储选项(-t)传入。

    # master (24.09+) 的 redland 以 --without-bdb 构建,统一改用 sqlite 存储(-s sqlite);
    # sqlite 以存储名作为 db 文件名;-n 确保首次写入建表(sqlite 懒建表,无 -n 会静默丢数据)
    rdfproc -s sqlite -q test add SUBJECT PREDICATE OBJECT 2>/dev/null && test -f test
    CHECK_RESULT $? 0 0 "Check rdfproc -q test add SUBJECT PREDICATE OBJECT failed"

    rdfproc -s sqlite --quiet test1 add SUBJECT PREDICATE OBJECT 2>/dev/null && test -f test1
    CHECK_RESULT $? 0 0 "Check rdfproc --quiet test1 add SUBJECT PREDICATE OBJECT failed"

    rdfproc -s sqlite -r json test2 find SUBJECT PREDICATE OBJECT 2>/dev/null && test -f test2
    CHECK_RESULT $? 0 0 "Check rdfproc -r json test2 find SUBJECT PREDICATE OBJECT failed"

    rdfproc -s sqlite --results json test3 find SUBJECT PREDICATE OBJECT 2>/dev/null && test -f test3
    CHECK_RESULT $? 0 0 "Check rdfproc --results json test3 find SUBJECT PREDICATE OBJECT failed"

    rdfproc -s sqlite -n testDbd parse test.rdf 2>/dev/null && test -f testDbd
    CHECK_RESULT $? 0 0 "Check rdfproc -s sqlite testDbd parse test.rdf failed"

    rdfproc -s sqlite -n testDbd1 parse test.rdf 2>/dev/null && test -f testDbd1
    CHECK_RESULT $? 0 0 "Check rdfproc --storage sqlite testDbd1 parse test.rdf failed"

    rdfproc -s sqlite -t "new='yes'" testDbd2 print -V 2>/dev/null && test -f testDbd2
    CHECK_RESULT $? 0 0 "Check rdfproc -s sqlite -t new='yes' testDbd2 print -V failed"

    rdfproc -s sqlite --storage-options "new='yes'" testDbd3 print --verbose 2>/dev/null && test -f testDbd3
    CHECK_RESULT $? 0 0 "Check rdfproc --storage-options new='yes' testDbd3 print --verbose failed"

redland-db-upgrade 仅支持 bdb 存储(内部硬编码 hash-type='bdb'),由于libdb被删除无法使用,需禁用该测试用例

用例中 rdfproc -c test serialize ntriples 期望"成功输出序列化内容",但空库序列化只能输出空内容;
要验证"解析→序列化"完整链路,就得先用rdfproc -s sqlite -n -c test parse rss.rdf命令把 rss.rdf 灌进 test 存储(这是 redland.md 文档里写但脚本没执行的预置步骤)。

[root@localhost test]# rdfproc -s sqlite  -n -c test parse rss.rdf
rdfproc: Parsing URI file:///root/test/rss.rdf with default parser
[root@localhost test]# rdfproc -s sqlite -c test serialize ntriples
<http://planetrdf.com/guide/rss.rdf> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/rss/1.0/channel> .
<http://planetrdf.com/guide/rss.rdf> <http://purl.org/rss/1.0/title> "Dave Beckett's RDF Resource Guide" .
<http://planetrdf.com/guide/rss.rdf> <http://purl.org/rss/1.0/link> "http://planetrdf.com/guide/" .
<http://planetrdf.com/guide/rss.rdf> <http://purl.org/rss/1.0/description> "A comprehensive guide to resources about RDF." .
<http://planetrdf.com/guide/rss.rdf> <http://purl.org/dc/elements/1.1/creator> "Dave Beckett" .
likedislike
wang-kun-1005
wang-kun-1005成员
9月2日 评论:

按照评论给的方法修改,用例已通过 非问题,修改用例即可
image.pngimage.png

likedislike
wang-kun-1005wang-kun-1005成员
9月2日 issue状态由 待办的 改变为 已取消
wang-kun-1005wang-kun-1005成员
9月2日 关闭了 issue
openeuler-ci-botopeneuler-ci-bot成员
9月2日 issue状态由 已取消 改变为 待办的
openeuler-ci-botopeneuler-ci-bot成员
9月2日 移除了负责人 Charlie_li1、lyn1001、wang-kun-1005
openeuler-ci-botopeneuler-ci-bot成员
9月2日 重新打开了 issue
openeuler-ci-bot
openeuler-ci-bot成员
9月2日 评论:

@small_leek
issue变更为 [已取消/已挂起] 状态前,请操作者填写相关原因
请按如下格式评论原因后,重新进行操作


/reason xxxxxx

likedislike
wang-kun-1005
wang-kun-1005成员
9月2日 评论:

/reason 用例问题,已修改用例适配

likedislike
wang-kun-1005wang-kun-1005成员
9月2日 issue状态由 待办的 改变为 已取消
wang-kun-1005wang-kun-1005成员
9月2日 关闭了 issue