Gem::RemoteFetcher::UnknownHostError

Rick Frnakel's Avatar

Rick Frnakel

01 May, 2017 04:27 PM

For the last two days, when trying to update/install gems (building a docker image so it is repeatable), I am unable to complete the build process because the following error occurs (on a different gem each time):

Building native extensions.  This could take a while...
ERROR:  While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
    no such name (https://api.rubygems.org/quick/Marshal.4.8/bundler-1.14.6.gemspec.rz)

I i run the build over-and-over, sometimes it will succeed. I see no status updates related to this, but it has been happening to me for two days, from two entirely different networks, so if it is a DNS error it is upstream of the client network.

  1. 1 Posted by Talgat Founder on 08 May, 2017 10:54 AM

    Talgat Founder's Avatar

    Yeah, I have a same issue!

  2. Support Staff 2 Posted by David Radcliffe on 08 May, 2017 12:53 PM

    David Radcliffe's Avatar

    We often see problems reported inside docker because DNS was not configured quite right. Can you double check your dns configuration and can you confirm you can resolve rubygems.org inside the container?

  3. 3 Posted by Rick Frankel on 08 May, 2017 02:44 PM

    Rick Frankel's Avatar

    A i said in the original post above, it works sometimes and not others, and does not always fail on the same gem. I have been using the same basic dockerfile config for about 2 years and it just started failing last week.

    Additional info. Here's the incantation i'm using:

    gem update --system && gem update -f && gem clean \
        && sudo -iu app bundle install \
           --deployment --without development test doc --path vendor/bundle
    

    it is failing during the gem update -f. It seems that when it gets past that it never fails on the bundle install.

  4. Support Staff 4 Posted by David Radcliffe on 08 May, 2017 03:07 PM

    David Radcliffe's Avatar

    OK I think I have a clue. I've changed something on my end. Can you see if you can get it to fail again?

  5. 5 Posted by rick on 08 May, 2017 03:40 PM

    rick's Avatar

    Still fails:

    RubyGems system software updated
    Updating installed gems
    Updating bigdecimal
    Building native extensions.  This could take a while...
    ERROR:  While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
        no such name (https://api.rubygems.org/quick/Marshal.4.8/did_you_mean-1.1.2.gemspec.rz)

  6. Support Staff 6 Posted by David Radcliffe on 08 May, 2017 03:45 PM

    David Radcliffe's Avatar

    Ok well that wasn't it then. Can you post a full Dockerfile somewhere so I can try to duplicate?

  7. 7 Posted by Rick Frankel on 08 May, 2017 04:02 PM

    Rick Frankel's Avatar

    Here's a small dockerfile which will trigger the error. Note that it doesn't happen every time, and whatever you did may have made it fail less. If feels to me like one or a few of a set of round-robin servers/processes are corrupt, but not all.

    rick
    ----- 8< cut here --- FROM alpine:3.5

    RUN apk update && apk upgrade && apk add libpq sudo \
    ruby ruby-irb ruby-rake ruby-io-console ruby-bigdecimal ruby-json ruby-bundler \ libstdc++ tzdata bash ca-certificates zlib \ && echo 'gem: --no-document' > /etc/gemrc

    add compilation env, build required gems and cleanup

    RUN apk --update add --virtual build_deps \
    build-base ruby-dev libffi-dev postgresql-dev \ libc-dev linux-headers zlib-dev RUN gem update --system
    RUN gem update -f && gem clean
    RUN apk del build_deps && rm -f /var/cache/apk/*

    CMD ["irb"]

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac