Tcp connect failing since upgrade to 8.15 on termux

I ran into this error when running raco pkg migrate 8.14. Can someone help me figure out what's going on? I can visit the host through a browser on my device. I don't have a VPN or proxy or anything. I'm on termux on Android if that matters. With racket bc.

11: Resolving "scribble-lib" via https://download.racket-lang.org/releases/8.15/catalog/
12: Resolving "threading-lib" via https://download.racket-lang.org/releases/8.15/catalog/
tcp-connect: connection failed;
 host not found
  address: download.racket-lang.org
  port number: 443
  system error: Invalid value for ai_flags; gai_err=3
  context...:
   /data/data/com.termux/files/usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt:555:3
   /data/data/com.termux/files/usr/share/racket/collects/net/http-client.rkt:67:0: http-conn-open!
   /data/data/com.termux/files/usr/share/racket/collects/net/http-client.rkt:274:0
   /data/data/com.termux/files/usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt:555:3
   /data/data/com.termux/files/usr/share/racket/collects/net/url.rkt:201:0: http://getpost-impure-port
   /data/data/com.termux/files/usr/share/racket/collects/net/url.rkt:309:2: redirection-loop
   /data/data/com.termux/files/usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt:555:3
   /data/data/com.termux/files/usr/share/racket/collects/pkg/private/network.rkt:59:3
   /data/data/com.termux/files/usr/share/racket/collects/pkg/private/network.rkt:33:4
   /data/data/com.termux/files/usr/share/racket/collects/racket/private/more-scheme.rkt:206:2: call-handled-body
   /data/data/com.termux/files/usr/share/racket/collects/pkg/private/catalog.rkt:138:9: for-loop
   /data/data/com.termux/files/usr/share/racket/collects/pkg/private/catalog.rkt:135:2: lookup-normally
   /data/data/com.termux/files/usr/share/racket/collects/pkg/private/prefetch.rkt:129:4
   /data/data/com.termux/files/usr/share/racket/collects/racket/private/more-scheme.rkt:206:2: call-handled-body
   /data/data/com.termux/files/usr/share/racket/collects/pkg/private/prefetch.rkt:128:2
   /data/data/com.termux/files/usr/share/racket/collects/pkg/private/prefetch.rkt:172:7

Wondering if it's related to this recent change which I see mentioned here: Release Announcement for v8.15 - #21 by shhyou

I didn't get this bug when migrating on a different machine in my network. So I don't think it's network conditions. That was a Linux desktop

Tcp connect is failing on my machine. Here's some output when trying to set up a basic connection.

> (tcp-connect "google.com" 443)
tcp-connect: connection failed;
 host not found
  address: google.com
  port number: 443
  system error: Invalid value for ai_flags; gai_err=3
  context...:
   instantiate
   eval-one-top
> (tcp-connect "google.com" 80)
tcp-connect: connection failed;
 host not found
  address: google.com
  port number: 80
  system error: Invalid value for ai_flags; gai_err=3
  context...:
   instantiate
   eval-one-top

It does look like rktio: use `AI_V4MAPPED` and `AI_ADDRCONFIG` · racket/racket@3acb5b3 · GitHub is causing trouble for Android. Are you building Racket from source, so that you could try removing those lines?

No, I'm not. And it's not something I'm likely to do either. Termux distributes bc which I don't think my device is powerful enough to build, and for some reason cs has a very long startup time on my device. Like 15s.

It looks like non-support for AI_V4MAPPED on Android is a common problem, and I've pushed a repair (hopefully) as rktio: avoid `AI_V4MAPPED` on Android · racket/racket@78fbcab · GitHub. Maybe someone responsible for the Racket package on Termux could try that patch.

1 Like