Odd issue fetching docs for local use: Couldn't find docs for package with name elixir

I’m trying to fetch hex docs for local use. About to get on an airplane with no wifi. Lots of packages are not found though, and I’m not sure why.

I run mix hex.docs fetch elixir and I get the message Couldn't find docs for package with name elixir or version 1.13.3. Anyone have any idea what’s going on? There are several packages that this happens with.

From the code of hex.docs it seems that this message shows up when the answer isn’t a 200

   case Hex.Repo.get_docs(repo, package, version) do
      {:ok, {200, body, _}} ->
        File.mkdir_p!(Path.dirname(target))
        File.write!(target, body)
        true

      _ ->
        message = "Couldn't find docs for package with name #{package} or version #{version}"
        Hex.Shell.error(message)
        false
    end

Maybe the network you’re connected is doing some kind of shenanigans with your connection.

Thanks, thought that might be a possibility but ruled it out becasue others were downloaded without issue. Will try my cell connection and report back!

Perfect, seems to be some weird shite with the airport network. Any idea why some would get fetched successfully and others wouldn’t?

My guess would be some kind of DNS spoofing associated with certain keywords, airports and hotels usually do this kind of shit to their connections.

2 Likes

Perhaps use your phone’s cellular network as a hotspot to bypass the airport network?

Elixir is not a package, so you can’t fetch the docs like that. We may address this in the near future though.

Meanwhile you can download Elixir docs from its release page on GitHub.

1 Like
~ ❯❯❯ mix hex.docs fetch elixir
Docs fetched: /home/tfortes/.hex/docs/hexpm/elixir/1.13.4

~/.h/d/h/e/1.13.4 ❯❯❯ ls | head -n 5
assets
dist
404.html
Access.html
Agent.html

Weird…

I think it must’ve changed recently. The good news is that you CAN fetch the elixir docs like that! After I switched to my cellular connection it worked like a charm.

So slick, I’m glad we’ve got such a robust offering of tools in the elixir ecosystem! Even simple things like this make me excited for what’s to come.

3 Likes

Ok, so please ignore me, I was clearly wrong :smiley:

4 Likes

As someone that works in security I strongly advise against the use of any WiFi that is not the one in your own home, because other devices connected to the same network can spread malware into other devices. And in your home WiFi you shouldn’t allow guests to connect to the same WiFi network as you, neither let any of your IoT stuff be connect to it.

I’m aware of the risks, but unfortunately I don’t have any other options. I’m travelling long-term and don’t have a home anymore. The prospect of me not getting any work done is far more problematic than the possibility of someone breaking into my device on public wifi. Also with the norm of default-configured home networking devices and aging firmware, you’re not necessarily more secure in that environment when faced with anyone determined.

1 Like

I understand your situation, but in that case shouldn’t you plan to have a good data plan on your SIM card?
I have one on mine that also works well when in roaming.

This becomes also a security risk for your employer, but many employers are not yet aware of the risk associated with employees working on public wifi, or they downplay the risk, but in some industries its not an acceptable risk.

Attackers when wanting they always achieve, but the public wifi risk are by far bigger then the ones you face at home.
Not only old routers, even modern routers are crap in terms of security for a persistent attacker.

When on public wifi (or at home if the attacker is outside your home) you also face the danger of the wifi being spoofed by a device like this:

P.S: Maybe a moderator want to split this into another topic with a tile like Risks of working on a public wifi

2 Likes

Might be best to setup a VPN somewhere in Iceland for example. I understand and sympathize that this is not your first prio right now – but I have acquaintances that work from like 20 different places in the world and investing in their own VPN (hosted on an obscure VPS provider) was something that netted them huge returns in peace of mind and reliability.

Just something to have in mind when you can spare $15 a month and a day or two of setting up WireGuard / Tailscale / ZeroTier.

…Or use Mullvad. They are amazing in every way you can think of.

1 Like

True, I could. The thing is, using a vpn doesn’t really guard against any of the attack vectors that Exadra37 suggested. If someone has physical access to the network or effectively owns it, all the tunnels in the world won’t change the fact that I’m working on a personal machine that isn’t hardened to attackers who have direct network access.

Actually it does protect you. Unless the attackers perfectly spoof a VPN handshake (which requires perfect timing as well) then afterwards every packet is encrypted and then checked on both sides.

VPNs eliminate like 99% of the potential dangers of public WiFi networks.