Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
313 views
in Technique[技术] by (71.8m points)

lambda - Connection attempts to Aurora Postgresql delivering inconsistent results

I have recently been exploring AWS with a view to converting a local database from SQL server to Postgresql then moving it to the cloud and accessing it via an API. I have created the db and the api and tested them locally. I have created an Aurora instance and migrated data into it. I have created a Lambda application of my API following along the lines outlined by Julie Lerman (https://codemag.com/Article/2008041/Transform-Your-ASP.NET-Core-API-into-AWS-Lambda-Functions).

  1. I run my API locally but connect to the Aurora database. I then run a client to call the API and I test by returning a list of the views in the database. This is successful.
  2. I run my API as a Lambda application, connecting to the same database with the same connection string. When I run the same client, the open database statement fails with the error at the bottom of this post.

Note: to further compound my confusion. If I use the master password for Aurora in the second situation, the connection succeeds but only a much small number of views is returned.

I am new to both AWS and Postgresql so would value any suggestions of avenues to explore.

Edit 1: I have discovered that the postgresql log reports the role does not exist, yet I can see it listed using PGAdmin. ---2021-01-07 13:55:40 UTC:172.31.2.123(45921):david@PBKS_SH:[4049]:DETAIL: Role "david" does not exist. Connection matched pg_hba.conf line 13: "host all all 0.0.0.0/0 md5"

Cloudwatch Error in SetupService:Any(Setup request): { "ClassName": "Npgsql.PostgresException", "Message": "28P01: password authentication failed for user "postgres"", "Data": { "Severity": "FATAL", "InvariantSeverity": "FATAL", "SqlState": "28P01", "MessageText": "password authentication failed for user "postgres"", "File": "auth.c", "Line": "333", "Routine": "auth_failed" }, "InnerException": null, "HelpURL": null, "StackTraceString": " ........., "RemoteStackTraceString": null, "RemoteStackIndex": 0, "ExceptionMethod": null, "HResult": -2147467259, "Source": "Npgsql", "WatsonBuckets": null, "Severity": "FATAL", "InvariantSeverity": "FATAL", "SqlState": "28P01", "MessageText": "password authentication failed for user "postgres"", "Detail": null, "Hint": null, "Position": 0, "InternalPosition": 0, "InternalQuery": null, "Where": null, "SchemaName": null, "TableName": null, "ColumnName": null, "DataTypeName": null, "ConstraintName": null, "File": "auth.c", "Line": "333", "Routine": "auth_failed"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...