Hi Asheesh, thanks a lot for your quick and helpful response. Meanwhile I've read the Wiki about the public UDD mirror. This has mentioned that for "older" psql versions the old method needs to be used. I wanted to stay on the save side and reverted to the old method but the new mirror / user / password settings. This helped and while not beeing as elegant ist might work more reliably on different systems.
I'll keep your fixes in mind and your analysis is correcht: $ echo $PGPORT 5452 which I have set on my local machine which I've used. Thanks a lot for maintaining the UDD mirror which is really helpful Andreas. On Sun, Nov 29, 2020 at 04:51:16PM -0500, Asheesh Laroia wrote: > On Sun, Nov 29, 2020 at 3:10 PM Andreas Tille <andr...@fam-tille.de> wrote: > > > > Hi Asheesh, > > > > I admit I applied your patch while beeing on a very poor connection and > > I thought this would be the reason for a failure. But now beeing behind > > a normal connection I get: > > > > LC_ALL=C psql postgresql://udd-mirror:udd-mir...@udd-mirror.debian.net/udd > > -t udd -c "select version from packages where package = 'abacas' ; " > > psql: error: could not connect to server: Connection timed out > > Is the server running on host "udd-mirror.debian.net" > > (147.75.35.146) and accepting > > TCP/IP connections on port 5452? > > > > Is this a temporary issue or is something wrong with the query? > > Sorry for the trouble! I think the problem is that you're connecting > to this server on a non-standard postgres port number. > > The issue appears to be that UDD itself is on port 5452 [1], but > postgres's default is 5432 [2]. I'm not sure what causes your script > to use port 5452 -- perhaps the PGPORT variable is being used? > > The simplest approach might be to add the port number to the URL. The > cleanest approach (IMHO) is to only use the PGPORT= environment > variable in the case that you're using real UDD, and/or to use a URL > to access real UDD. > > FWIW, I can reproduce the timeout with these commands. > > $ LC_ALL=C psql > postgresql://udd-mirror:udd-mir...@udd-mirror.debian.net:5452/udd -t > udd -c "select version from packages where package = 'abacas' ; " > > $ PGPORT=5452 LC_ALL=C psql > postgresql://udd-mirror:udd-mir...@udd-mirror.debian.net/udd -t udd -c > "select version from packages where package = 'abacas' ; " > > When I try these commands, there's no timeout: > > $ LC_ALL=C psql > postgresql://udd-mirror:udd-mir...@udd-mirror.debian.net:5432/udd -t > udd -c "select version from packages where package = 'abacas' ; " > > $ PGPORT=5452 LC_ALL=C psql > postgresql://udd-mirror:udd-mir...@udd-mirror.debian.net:5432/udd -t > udd -c "select version from packages where package = 'abacas' ; " > > Given all that, the simplest approach would probably be to add the > port number (5432) to the script. > > Happy to give further advice or chat more. I'm open to reconfiguring > udd-mirror to listen on port 5452 if that ends up being the best > approach. > > Asheesh. > > 1. https://wiki.debian.org/UltimateDebianDatabase/ > > 2. > https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=postgres > -- http://fam-tille.de