Amazon AWS compatibility

167 views
Skip to first unread message

adao.p...@gmail.com

unread,
Feb 7, 2015, 3:01:26 PM2/7/15
to npgsq...@googlegroups.com
Hello,

I've made several works (web) using C# and Npgsql. However, I need to transfer them to Amazon AWS and got some issues:

1) Amazon no longer recommends Ngpsql cause there are troubles using SSL connections. Please, see https://forums.aws.amazon.com/thread.jspa?messageID=568367#568367;

2) When using AWS Beanstalk component to deploy web applications I need to create a DNS CNAME record to map my domain name and the beanstalk endpoint that seems to change time to time. It seems Npgsql tries to make connections using the beanstalk endpoint and doen't to get the right IP. Please see below the message from exception:

Npgsql.NpgsqlException: No such host is known ---> System.Net.Sockets.SocketException: No such host is known
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
at Npgsql.NpgsqlClosedState.Open(NpgsqlConnector context) in C:\projects\Npgsql2\src\Npgsql\NpgsqlClosedState.cs:line 137
--- End of inner exception stack trace ---
at Npgsql.NpgsqlClosedState.Open(NpgsqlConnector context) in C:\projects\Npgsql2\src\Npgsql\NpgsqlClosedState.cs:line 232
at Npgsql.NpgsqlConnector.Open() in C:\projects\Npgsql2\src\Npgsql\NpgsqlConnector.cs:line 683
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection) in C:\projects\Npgsql2\src\Npgsql\NpgsqlConnectorPool.cs:line 481
at Npgsql.NpgsqlConnectorPool.RequestPooledConnectorInternal(NpgsqlConnection Connection) in C:\projects\Npgsql2\src\Npgsql\NpgsqlConnectorPool.cs:line 252
at Npgsql.NpgsqlConnectorPool.RequestPooledConnector(NpgsqlConnection Connection) in C:\projects\Npgsql2\src\Npgsql\NpgsqlConnectorPool.cs:line 205
at Npgsql.NpgsqlConnection.Open() in C:\projects\Npgsql2\src\Npgsql\NpgsqlConnection.cs:line 543
at WSGeral.ObtemMunic(String siglauf, String id_acesso)

I'll appreciate so much some hints to solve this problem. I've been using Npgsql until now and I'm satisfied with it. It will be a terrible option to me accept the Amazon recomendation to change to ODBC.


Thanks in advance.


Adão Paulino

Shay Rojansky

unread,
Feb 8, 2015, 4:10:36 AM2/8/15
to adao.p...@gmail.com, npgsq...@googlegroups.com
Hi Adão!

I'm surprised to hear about the Amazon recommendation.

First, I've opened a separate issue for the LC_MONETARY problem (https://github.com/npgsql/npgsql/issues/476), it will be taken care of.

Regarding your main problem with the DNS, there's probably some non-Npsql problem involved. Npgsql simply tries to connect to the host you provide it, and in this case it seems to be a non-existing name. Can you ping it from the command-line?

Shay


--
You received this message because you are subscribed to the Google Groups "Npgsql Help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to npgsql-help...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/npgsql-help/25e50555-4fd0-45c5-b24f-aec2398ae7c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

adao.p...@gmail.com

unread,
Feb 8, 2015, 7:04:15 AM2/8/15
to npgsq...@googlegroups.com, adao.p...@gmail.com
Hi, Shay.

I ping my domain name but the corresponding IPv4 address changes over time because I need to use a Amazon procedure that includes the Elastic Load Balancer service. It generates a new DNS name to access my application so It is necessary to create a CNAME record in my DNS Zone (on Amazon Route 53) to associate my friendly DNS name (www.example.com) with that DNS name (awseb-e-j-AWSEBLoa-17P00PDVNVNTU-519361140.us-east-1.elb.amazonaws.com).
I think Npgsql uses my DNS A Record (fixed all the time) but CNAME to Amazon DNS name cause the problem while its IP address is not fixed.

Thanks for your help!

Adão Paulino.

Shay Rojansky

unread,
Feb 8, 2015, 12:46:12 PM2/8/15
to adao.p...@gmail.com, npgsq...@googlegroups.com
Hi Adão.

Npgsql itself doesn't know anything about name resolution - it doesn't specifically query A or CNAME records, it simply uses .NET to resolve hostnames. Such a hostname may even be locally-defined (e.g. localhost). What this means is that if you're able to ping an address from a given machine, you should really be able to connect to the same address *from the same machine* with Npgsql. Have you tried pinging from the same machine on which Npgsql is running?

Shay

Reply all
Reply to author
Forward
0 new messages