You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Docker Compose部署Neo4j APOC时apoc.create.addLabels存储过程未找到问题

解决Neo4j中apoc.create.addLabels存储过程未找到的问题

问题情况

执行以下Cypher语句时,触发Neo.ClientError.Procedure.ProcedureNotFound错误,提示数据库未注册apoc.create.addLabels存储过程:

match (from:_Category)<-[:_from]-(r:_Relationship)-[:_to]->(to:_Category)
match (x)-[rel]->(y)
where type(rel) = r.name
call apoc.create.addLabels(x,[from.name]) yield node as xs
call apoc.create.addLabels(y,[to.name]) yield node as ys
return count(xs) + count(ys) + " nodes updated"

当前使用的Docker Compose配置如下:

services:
  neo4j:
    image: neo4j:latest
    volumes:
        - /home/ted/neo4j/logs:/logs
      #  - /home/ted/neo4j/conf:/conf
        - /home/ted/neo4j/data:/data
        - /home/ted/neo4j/plugins:/plugins
    environment:
      - NEO4J_dbms_security_procedures_unrestricted=apoc.*
      - NEO4J_dbms_security_procedures_allowlist=apoc.*
      - NEO4J_apoc_import_file_enabled=true
      - NEO4J_apoc_export_file_enabled=true
      - NEO4J_apoc_trigger_enabled=true
      - NEO4J_dbms_security_procedures_unrestricted=*
    ports:
      - "7474:7474"
      - "7687:7687"
    restart: unless-stopped

解决办法

下载apoc-core扩展并搭配apoc-extended扩展,即可解决该问题。

额外提醒

  • 务必保证APOC扩展版本与Neo4j版本严格对应,版本不兼容会导致存储过程无法被识别
  • 将APOC的jar文件放入挂载的/plugins目录后,必须重启Neo4j容器才能生效
  • 你的Docker Compose环境变量中重复设置了NEO4J_dbms_security_procedures_unrestricted,建议保留其中一项即可,避免配置冲突

内容的提问来源于stack exchange,提问作者Grumpel Pumpel Alias

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 20:42:37