zypper behind bars ... well behind proxies

Sometimes, things just go the Murphy’s law way

Consulting often means you can’t do whatever you like in terms of infrasturcture. Here I’m going to talk about my current assignment, the continuous integration platform we need to use, and how upgrading it turned out to be a bit of a puzzle =)

The context

At first, there was joy. We were ditching our old SVN for Git. The first steps were easy, create a repo in the private GitLab, convert the svn repo to a git repo, push it all into gitlab … things were great.

Then, we needed to update our jenkins slave so that it could use git, and things started to get a bit messy :-/

Our predicament pretty much unfolded this way :

  1. Project Manager : “Good news guys! We’re migrating our VCS to Git!”
  2. Infrastructure guys : “Well, you need to update your environments on your own. No worries, just explicitly set the proxy through environment variables and you should be good to go”
  3. Us : “What the heck ?! I’ve set my proxy settings up. How come zypper does not pick it up?”
  4. … an hour or two of fiddling and asking for help
  5. “Oh, ok, I get it …”

The setup

  • The CI we used is provided by our client.
  • It sports a whopping SUSE (SLES 11 … but at least it runs a kernel 3.x which is handy to be able to run a decent Git version ;)
  • Internet access is provided through an unconfigured proxy

So? What’s the big deal? You configure your environment variables for the proxy and there you go. Right?

Well … not really. It seems that zypper does not give a damn about the

1
https_proxy
/
1
http_proxy
env variables /o\.

You need to “write down” the configuration into 2 separate files :

  • 1
    /etc/sysconfig/
    
    for the proxy settings, which pretty much means to define the
    1
    HTTP_PROXY
    
    &
    1
    HTTPS_PROXY
    
    . If the file has not been edited yet, chances are the lines defining those variables just need uncommenting and editing. At that point, it seems you only need to set them to the URL of the proxy you’re going to go through, credentials setup being done in another file.
  • 1
    ~/.curlrc
    
    for your credentials: You need to specify this in the file
    1
    proxy-user="proxyuser:pass"
    
    (note that I talk about your
    1
    ~/.curlrc
    
    file, but that is because I edited it and ran zypper as
    1
    root
    
    , it might be different if you’re sudo-ing.

Wrap up

Worst part of this is we’ve gone through all this for practically nothing as our SUSE was so old and peculiar we ended up installing special packages directly via RPM. But at least it allowed us to understand a little bit how zypper works (and now we can install packages with that machine ;)

Martin Bahier

Martin Bahier
Software Craftsman during the day, gamer at night. Or both, depends on my mood

Ubuntu / Debian and NodeJS : why the odd naming?

# Why doesn't nodejs Debian package provide the "node" binary used by all my tools?Recently, I had to use my CI to host a new node projec...… Continue reading

PhantomJS trouble

Published on July 24, 2016