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

启动Apigee模拟器失败:api_security_actions_contract_ref表缺失求助

Apigee本地模拟器启动失败:table api_security_actions_contract_ref does not exist 问题排查思路

问题描述

按照GCP文档,使用VS Code的Cloud Code扩展搭建Apigee本地开发环境时,Apigee模拟器始终卡在启动状态,无法进入就绪状态。查看容器日志发现核心错误:table api_security_actions_contract_ref does not exist,更换多个模拟器版本后问题仍持续存在。

完整错误日志

2025-11-26 13:52:45.644 | {"level":"SEVERE","thread":"Apigee-Timer-7","mdc":{},"className":"io.apigee.hermes.engine.impl.HermesEngineImpl","method":"handleHermesException","severity":"SEVERE","message":"Cluster [s5], Error Message [table api_security_actions_contract_ref does not exist]","formattedDate":"2025-11-26T16:52:45.643Z","logger":"HermesEngineImpl","exceptionStackTrace":"com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: table api_security_actions_contract_ref does not exist\n\tat com.datastax.oss.driver.api.core.servererrors.InvalidQueryException.copy(InvalidQueryException.java:48)\n\tat com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures.getUninterruptibly(CompletableFutures.java:149)\n\tat com.datastax.oss.driver.internal.core.cql.CqlPrepareSyncProcessor.process(CqlPrepareSyncProcessor.java:59)\n\tat com.datastax.oss.driver.internal.core.cql.CqlPrepareSyncProcessor.process(CqlPrepareSyncProcessor.java:31)\n\tat com.datastax.oss.driver.internal.core.session.DefaultSession.execute(DefaultSession.java:230)\n\tat com.datastax.oss.driver.api.core.cql.SyncCqlSession.prepare(SyncCqlSession.java:224)\n\tat io.apigee.hermes.engine.impl.CQLEngineImpl.prepare(CQLEngineImpl.java:74)\n\tat io.apigee.hermes.engine.impl.HermesEngineImpl.prepare(HermesEngineImpl.java:159)\n\tat io.apigee.runtimeconfig.repository.impl.ContractRefRepositoryImpl.<init>(ContractRefRepositoryImpl.java:82)\n\tat io.apigee.runtimeconfig.repository.impl.ApiSecurityActionsContractRefRepositoryImpl.<init>(ApiSecurityActionsContractRefRepositoryImpl.java:33)\n\tat io.apigee.runtimeconfig.repository.RepositoryFactory.<init>(RepositoryFactory.java:48)\n\tat io.apigee.runtimeconfig.service.RuntimeConfigServiceImpl.<init>(RuntimeConfigServiceImpl.java:88)\n\tat io.apigee.runtimeconfig.service.RuntimeConfigServiceFactory.newInstance(RuntimeConfigServiceFactory.java:99)\n\tat io.apigee.common.service.AbstractServiceFactory.initializeService(AbstractServiceFactory.java:304)\n\tat io.apigee.runtimeconfig.service.RuntimeConfigServiceFactory.<init>(RuntimeConfigServiceFactory.java:85)\n\tat com.apigee.cps.integration.facade.CpsServiceFactoryFacade.getServiceFactory(CpsServiceFactoryFacade.java:139)\n\tat com.apigee.cps.integration.facade.CpsServiceFactoryFacade.initialize(CpsServiceFactoryFacade.java:85)\n\tat com.apigee.cps.integration.facade.CpsServiceFactoryFacade.<init>(CpsServiceFactoryFacade.java:71)\n\tat com.apigee.cps.integration.facade.CpsServiceFactoryFacade.getCpsServiceFactoryFacade(CpsServiceFactoryFacade.java:219)\n\tat com.apigee.services.cps.CpsServiceFactoryFacadeProvider.getFactoryFacade(CpsServiceFactoryFacadeProvider.java:24)\n\tat com.apigee.services.cps.CpsHybridServiceImpl$FacadeHolder.initFacade(CpsHybridServiceImpl.java:87)\n\tat com.apigee.services.cps.CpsHybridServiceImpl.initRuntimeConfigServiceFactoryFacade(CpsHybridServiceImpl.java:267)\n\tat com.apigee.services.cps.CpsHybridRuntimeServiceImpl.safeInitServiceAndHealthCheck(CpsHybridRuntimeServiceImpl.java:121)\n\tat com.apigee.threadpool.RunnableWrapperForMDCPreservation.run(RunnableWrapperForMDCPreservation.java:22)\n\tat com.apigee.threadpool.QueueAwareTask.run(QueueAwareTask.java:26)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)\n\tat java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)\n\tat java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n\tat java.base/java.lang.Thread.run(Unknown Source)\n"}

解决思路

  • 彻底清理本地容器与缓存:停止并删除所有Apigee相关容器、镜像,清理本地存储卷,避免残留数据干扰初始化:
    docker stop $(docker ps -q --filter "name=apigee")
    docker rm $(docker ps -aq --filter "name=apigee")
    docker rmi $(docker images -q --filter "reference=apigee/*")
    docker volume prune -f
    
  • 检查Cloud Code扩展配置:确认VS Code中Cloud Code的Apigee本地环境配置参数正确,无冲突项导致数据库初始化不完整。
  • 手动创建缺失的Cassandra表:进入模拟器的Cassandra容器,手动初始化缺失的表:
    1. 进入Cassandra容器:docker exec -it <cassandra-container-name> cqlsh
    2. 切换到Apigee keyspace:USE apigee;
    3. 创建目标表:
      CREATE TABLE api_security_actions_contract_ref (
          contract_ref_id UUID PRIMARY KEY,
          action_id UUID,
          created_at TIMESTAMP,
          updated_at TIMESTAMP
      );
      
  • 检查Docker资源分配:确保Docker至少分配4核CPU和8GB内存,资源不足会导致数据库初始化过程中断,引发表缺失问题。
  • 重装Cloud Code扩展:卸载当前Cloud Code扩展,清理VS Code缓存后重新安装最新版本,排除扩展文件损坏的可能。

内容的提问来源于stack exchange,提问作者Rodrigo Campos

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.11 23:44:52