小编Edw*_*uel的帖子

AWS Elastic Beanstalk 部署失败

当我尝试将 Java Web 应用程序部署到 Elastic Beanstalk Tomcat 容器时,它失败并显示以下错误:

Service:AmazonCloudFormation, Message:TemplateURL must reference a valid S3 object to which you have access.
Run Code Online (Sandbox Code Playgroud)

请注意以下几点:

  • 部署是通过运行在 EC2 服务器上的 Jenkins 自动化的。
  • 此错误不是一个持续的问题。有时它部署成功,但有时它因上述错误而失败。

amazon-ec2 amazon-web-services amazon-elastic-beanstalk

4
推荐指数
2
解决办法
2762
查看次数

Psycopg2 - AttributeError:'NoneType'对象没有属性'fetchall'

我有一个Python脚本来列出使用psycopg2的PostgreSQL模式.

#!/usr/bin/env python

import yaml
import psycopg2

def load_config(file_name):
    with open(file_name, 'r') as stream:
        config = yaml.load(stream)
    return config

config = load_config('config.yml')['database']
conn = psycopg2.connect(host=config['host'], port=config['port'], dbname=config['name'], user=config['user'], password=config['password'])
cursor = conn.cursor()

print('conn = %s' % conn)
print('cursor = %s' % cursor)

sql_list_schemas = """
SELECT *
FROM information_schema.schemata
WHERE schema_name <> 'information_schema'
  AND schema_name !~ E'^pg_';
"""
list_schemas = cursor.execute(sql_list_schemas)
print('list_schemas = %s' % list_schemas)
print('list_schemas.fetchall() = %s' % list_schemas.fetchall())
Run Code Online (Sandbox Code Playgroud)

当我运行脚本时,我得到了:

conn = <connection object at 0x7f0e12eef050; dsn: 'user=test …
Run Code Online (Sandbox Code Playgroud)

python postgresql psycopg2

4
推荐指数
1
解决办法
8641
查看次数