Import Neo4j-不是链条的一部分!关系遍历器

Import Neo4j-不是链条的一部分!关系遍历器,import,neo4j,cypher,py2neo,Import,Neo4j,Cypher,Py2neo,对于数据导入,我突然发现以下错误: neo4j.exceptions.DatabaseError: NOT PART OF CHAIN! RelationshipTraversalCursor[id=328769435, open state with: denseNode=false, next=328769435, mode=regular, underlying record=Relationship[328769435,used=false,source=0,target=0,type=

对于数据导入,我突然发现以下错误:

neo4j.exceptions.DatabaseError: NOT PART OF CHAIN! RelationshipTraversalCursor[id=328769435, open state with: denseNode=false, next=328769435, mode=regular, underlying record=Relationship[328769435,used=false,source=0,target=0,type=0,sPrev=0,sNext=0,tPrev=0,tNext=0,prop=0,secondaryUnitId=-1,!sFirst,!tFirst] ]
这个错误实际上意味着什么?我如何进一步调试它

我还没有找到关于这个的任何文档

debug.log的最后一部分(StackOverflow不允许有更多内容):

对于我以前成功导入的文件,现在也会发生这种情况

这一定与我的cypher查询有关,因为当我将其减少到绝对最小值时,它会起作用,但了解错误会有所帮助

编辑-尝试调试 现在我被这个错误所困扰

通过我的脚本中的超级最小密码查询,一切正常:

WITH $custom_dict as pubmed_list
UNWIND pubmed_list as article
    MERGE (p:Publication {pmid: COALESCE (article.pmid, 'NO-PMID')})
    ON CREATE SET p.title = article.article_title, p.journal_title = article.journal_title, p.db = 'pubmed'
但是,当我添加以下内容时:

    MERGE (dc:Date { year: COALESCE (article.year_revised, 'NO-YEAR-COMPLETION') })
    MERGE (p)-[:COMPLETED]->(dc)

    MERGE (dr:Date { year: COALESCE (article.year_completed, 'NO-YEAR-REVISION')})
    MERGE (p)-[:REVISED]->(dr)
我正在传递的解卷命令看起来也非常好:

编辑2-一致性检查 运行一致性检查后:

$“$NEO4J_HOME”/bin/NEO4J管理员检查一致性--数据库=graph.db

它是这样开始的:

2018-07-20 08:41:15.337+0000 INFO [o.n.k.i.s.f.RecordFormatSelector] Selected RecordFormat:StandardV3_4[v0.A.9] record format from store /Users/rich/Library/Application Support/Neo4j Desktop/Application/neo4jDatabases/database-4ca696a4-add3-4f69-a97b-1b89ce8e854b/installation-3.4.0/data/databases/graph.db
2018-07-20 08:41:15.340+0000 INFO [o.n.k.i.s.f.RecordFormatSelector] Format not configured. Selected format from the store: RecordFormat:StandardV3_4[v0.A.9]
Inconsistent with: Node[6577082,used=true,rel=329016678,prop=11682171,labels=Inline(0x1000000000:[0]),light,secondaryUnitId=-1]
2018-07-20 09:07:05.171+0000 ERROR [o.n.c.ConsistencyCheckService] This record should be the first in the target chain, but the target node does not reference this record.
    Relationship[314188818,used=true,source=140353187,target=78456590,type=4,sPrev=314188819,sNext=314188812,tCount=32,tNext=301551374,prop=-1,secondaryUnitId=-1,!sFirst, tFirst]
然后我得到几千个这样的:

2018-07-20 08:42:49.837+0000 ERROR [o.n.c.ConsistencyCheckService] The referenced relationship group record is not in use.
    Node[145800979,used=true,group=8661147,prop=275750014,labels=Inline(0x1000000000:[0]),light,secondaryUnitId=-1]
    Inconsistent with: RelationshipGroup[8661147,type=0,out=0,in=0,loop=0,prev=-1,next=0,used=false,owner=0,secondaryUnitId=-1]
然后继续:

...  10%
....................  20%
................2018-07-20 08:49:01.023+0000 ERROR [o.n.c.ConsistencyCheckService] This record should be the first in the source chain, but the source node does not reference this record.
现在它将永远运行,并出现前面描述的错误,如下所示:

2018-07-20 08:41:15.337+0000 INFO [o.n.k.i.s.f.RecordFormatSelector] Selected RecordFormat:StandardV3_4[v0.A.9] record format from store /Users/rich/Library/Application Support/Neo4j Desktop/Application/neo4jDatabases/database-4ca696a4-add3-4f69-a97b-1b89ce8e854b/installation-3.4.0/data/databases/graph.db
2018-07-20 08:41:15.340+0000 INFO [o.n.k.i.s.f.RecordFormatSelector] Format not configured. Selected format from the store: RecordFormat:StandardV3_4[v0.A.9]
Inconsistent with: Node[6577082,used=true,rel=329016678,prop=11682171,labels=Inline(0x1000000000:[0]),light,secondaryUnitId=-1]
2018-07-20 09:07:05.171+0000 ERROR [o.n.c.ConsistencyCheckService] This record should be the first in the target chain, but the target node does not reference this record.
    Relationship[314188818,used=true,source=140353187,target=78456590,type=4,sPrev=314188819,sNext=314188812,tCount=32,tNext=301551374,prop=-1,secondaryUnitId=-1,!sFirst, tFirst]
这是:

2018-07-20 09:08:14.715+0000 ERROR [o.n.c.ConsistencyCheckService] The next record in the target chain does not have this record as its previous record.
    Relationship[192261,used=true,source=28336,target=5180,type=4,sPrev=192264,sNext=192260,tPrev=191008,tNext=184760,prop=-1,secondaryUnitId=-1,!sFirst,!tFirst]
    Inconsistent with: Relationship[184760,used=true,source=24761,target=5180,type=4,sPrev=184750,sNext=184761,tPrev=184738,tNext=192261,prop=-1,secondaryUnitId=-1,!sFirst,!tFirst]

这对我的数据库意味着什么?我如何修复它?

看起来数据库已损坏。这通常是由于Neo4j运行时磁盘空间不足(现在最新版本可以缓解这一问题),或者是由于复制db(filecopy,而不是使用
Neo4j admin backup
的热备份功能),或者在Neo4j运行时修改文件

您应该对数据库进行备份(禁用一致性检查,您不再需要该检查),然后使用从备份中重建数据库,然后从重建的数据存储中恢复实例(或群集)


重建存储将跳过所有损坏的记录,因此您可能希望在操作完成后检查数据的完整性。

我可以在一个测试中重现此错误,只需在单个事务上调用两个线程的遍历。因此,从neo4j关于事务的文档来看,不鼓励使用这种访问模式


或者,如果您的遍历被卡在无限循环中,或者可能正在等待锁(检查线程转储),然后,这也可能表示在具有多个线程的单个事务上运行遍历,或者在另一个事务中使用来自其他未提交事务的节点/关系。

是否可以尝试在数据库上运行?“也许有什么东西被破坏了。”我用一致性检查更新了我的答案。现在显示错误一小时。让一致性检查运行到底有意义吗?似乎有数以百万计的损坏记录或其他任何记录。谢谢你,我会尝试这一个,只要我得到开发人员/教育版,这是执行
neo4j管理备份所需的。是否有可能由于更改/损坏的cypher语句或在导入内容时操作数据库(例如,在导入运行时运行算法/执行合并语句)而导致损坏?我会对这两种情况都说不。坏密码要么根本不会运行,要么会对数据进行意外更改,但不会损坏数据。同样,在导入的同时进行更改时,这不应该导致损坏。啊,好的,你的答案中的“磁盘”是指RAM和/或硬盘驱动器吗?我很容易就用完了RAM,但没有gard drive。