【问题标题】:Elastic Beanstalk: dictionary update sequence element #0 has length 1; 2 is requiredElastic Beanstalk:字典更新序列元素 #0 的长度为 1; 2 是必需的
【发布时间】:2015-06-15 10:10:07
【问题描述】:

我们有一个正常工作的 Elastic Beanstalk 环境,但在添加配置文件后,我们在部署期间开始收到此错误:

构建期间发生错误:字典更新序列元素 #0 的长度为 1; 2 是必需的

配置文件如下所示:

# .ebextentions/seed.config
container_commands:
  01_set_tenant_gateway:
    command: rake db:seed:set_tenant_gateway
    leader_only: true
    env: our-env

日志告诉我们:

2015-04-09 18:27:48,220 [DEBUG] 运行命令 seed_tenant_gateway 2015-04-09 18:27:48,220 [DEBUG] 为命令生成默认值 种子租户网关

2015-04-09 18:27:48,405 [DEBUG] 运行命令测试 seed_tenant_gateway 2015-04-09 18:27:48,406 [错误] 未处理 构建期间的异常:字典更新序列元素 #0 具有 长度 1; 2 是必需的 Traceback(最近一次调用最后一次):文件 “/opt/aws/bin/cfn-init”,第 122 行,在 worklog.build(detail.metadata, configSets) 文件“/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py”,行 117,正在构建中 承包商(元数据).build(configSets,self)文件“/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py”,行 502,正在构建中 self.run_config(config, worklog) 文件“/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py”,行 511,在 run_config CloudFormationCarpenter(config, self._auth_config).build(worklog) 文件“/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py”, 第 247 行,正在构建中 更改['commands'] = CommandTool().apply(self._config.commands) 文件“/usr/lib/python2.6/site-packages/cfnbootstrap/command_tool.py”, 第 84 行,在应用中 testResult = ProcessHelper(test, env=env, cwd=cwd).call() 文件“/usr/lib/python2.6/site-packages/cfnbootstrap/util.py”,第 397 行,在 初始化 self._env = dict(env) ValueError: 字典更新序列元素 #0 的长度为 1; 2 是必需的

这里可能发生了什么?

【问题讨论】:

    标签: amazon-web-services amazon-elastic-beanstalk


    【解决方案1】:

    1) env 键的语法:

    env: 
        <variable name>: <variable value>
    

    2) 另外,您需要将 command 括在引号中:

    command: "<command to run>"
    

    来自http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html

    【讨论】:

    • 谢谢,这正是我需要知道的。
    猜你喜欢
    • 1970-01-01
    • 2015-02-22
    • 1970-01-01
    • 2021-04-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-08
    • 2016-02-17
    相关资源
    最近更新 更多