Elastic Beanstalk:字典更新序列元素#0 的长度为 1; 2 是必需的
Elastic Beanstalk: dictionary update sequence element #0 has length 1; 2 is required
我们有一个有效的 Elastic Beanstalk 环境,但在添加配置文件后,我们在部署期间开始出现此错误:
Error occurred during build: dictionary update sequence element #0 has length 1; 2 is required
配置文件如下所示:
# .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] Running command seed_tenant_gateway
2015-04-09 18:27:48,220 [DEBUG] Generating defaults for command
seed_tenant_gateway <<<
2015-04-09 18:27:48,405 [DEBUG] Running test for command
seed_tenant_gateway 2015-04-09 18:27:48,406 [ERROR] Unhandled
exception during build: dictionary update sequence element #0 has
length 1; 2 is required Traceback (most recent call last): File
"/opt/aws/bin/cfn-init", line 122, in
worklog.build(detail.metadata, configSets) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line
117, in build
Contractor(metadata).build(configSets, self) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line
502, in build
self.run_config(config, worklog) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line
511, in run_config
CloudFormationCarpenter(config, self._auth_config).build(worklog) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py",
line 247, in build
changes['commands'] = CommandTool().apply(self._config.commands) File "/usr/lib/python2.6/site-packages/cfnbootstrap/command_tool.py",
line 84, in apply
testResult = ProcessHelper(test, env=env, cwd=cwd).call() File "/usr/lib/python2.6/site-packages/cfnbootstrap/util.py", line 397, in
init
self._env = dict(env) ValueError: dictionary update sequence element #0 has length 1; 2 is required
这里可能发生了什么?
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
我们有一个有效的 Elastic Beanstalk 环境,但在添加配置文件后,我们在部署期间开始出现此错误:
Error occurred during build: dictionary update sequence element #0 has length 1; 2 is required
配置文件如下所示:
# .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] Running command seed_tenant_gateway 2015-04-09 18:27:48,220 [DEBUG] Generating defaults for command seed_tenant_gateway <<<
2015-04-09 18:27:48,405 [DEBUG] Running test for command seed_tenant_gateway 2015-04-09 18:27:48,406 [ERROR] Unhandled exception during build: dictionary update sequence element #0 has length 1; 2 is required Traceback (most recent call last): File "/opt/aws/bin/cfn-init", line 122, in worklog.build(detail.metadata, configSets) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 117, in build Contractor(metadata).build(configSets, self) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 502, in build self.run_config(config, worklog) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 511, in run_config CloudFormationCarpenter(config, self._auth_config).build(worklog) File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 247, in build changes['commands'] = CommandTool().apply(self._config.commands) File "/usr/lib/python2.6/site-packages/cfnbootstrap/command_tool.py", line 84, in apply testResult = ProcessHelper(test, env=env, cwd=cwd).call() File "/usr/lib/python2.6/site-packages/cfnbootstrap/util.py", line 397, in init self._env = dict(env) ValueError: dictionary update sequence element #0 has length 1; 2 is required
这里可能发生了什么?
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