bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
From: "Enrico Scholz" <enrico.scholz@sigma-chemnitz.de>
To: "Ross Burton" <ross@burtonini.com>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [bitbake-devel] [PATCH v3 3/4] fetch2/wget: ensure all variables are set when calling urllib
Date: Tue, 17 Aug 2021 20:45:07 +0200	[thread overview]
Message-ID: <ly35r7ykp8.fsf@ensc-virt.intern.sigma-chemnitz.de> (raw)
In-Reply-To: <ly5yw4rmx4.fsf@ensc-virt.intern.sigma-chemnitz.de> (Enrico Scholz via lists openembedded org's message of "Tue, 17 Aug 2021 19:39:03 +0200")

"Enrico Scholz via lists.openembedded.org"
<enrico.scholz=sigma-chemnitz.de@lists.openembedded.org> writes:

> "Ross Burton" <ross@burtonini.com> writes:
>
>> Instead of just exporting the proxy variables when calling into urllib,
>> use bb.utils.environment() to export all of the known variables that are
>> needed for proper connectivity.
>
> This patch breaks fetching from sstate servers[1].
> 
> | https_proxy=http://www-cache:3128/
> | no_proxy='.sigma-chemnitz.de,...'
> 
> I can reproduce it here e.g. by
>
> | $ bitbake gettext-minimal-native -ccleansstate
> | $ bitbake gettext-minimal-native
> | ERROR: gettext-minimal-native-0.21-r0 do_populate_lic_setscene: No suitable staging package found
> |
> | DEBUG: checkstatus() urlopen failed: <urlopen error Tunnel connection failed: 403 Forbidden>

I guess this happens because in

| +        with bb.utils.environment(**newenv):
| +            handlers = [...
| +                        urllib.request.ProxyHandler(),

the urllib.request.ProxyHandler constructor takes 'https_proxy' from
environment (but not 'no_proxy').

Real open happens later (when the 'with bb.utils.environment...' has
been left) and there,

| class ProxyHandler(BaseHandler):
|     def proxy_open(self, req, proxy, type):
|         ...
|         if req.host and proxy_bypass(req.host):
|             return None

is called.  'proxy_bypass()' checks 'no_proxy' from env which is not
available anymore.


Normale fetching does not seem to be affected because proxy vars are in
BB_ENV_EXTRAWHITE and exported to jobs.  But 'sstate' fetching does not
seem to use this mechanism.



Enrico

  parent reply	other threads:[~2021-08-17 18:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 16:55 [PATCH v3 1/4] utils: add environment updating context manager Ross Burton
2021-08-10 16:55 ` [PATCH v3 2/4] fetch2: expose environment variable names that need to be exported Ross Burton
2021-08-10 16:55 ` [PATCH v3 3/4] fetch2/wget: ensure all variables are set when calling urllib Ross Burton
2021-08-17 17:39   ` [bitbake-devel] " Enrico Scholz
2021-08-17 17:44     ` Enrico Scholz
2021-08-17 18:45     ` Enrico Scholz [this message]
2021-08-18  9:28     ` Enrico Scholz
2021-08-18 10:07       ` Ross Burton
2021-08-10 16:55 ` [PATCH v3 4/4] fetch2/wget: fetch securely by default Ross Burton
2021-08-11 13:46   ` [bitbake-devel] " Michael Opdenacker
2021-08-11 15:39     ` Peter Kjellerstedt
2021-08-13 16:41     ` Ross Burton
2021-08-13 22:00       ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ly35r7ykp8.fsf@ensc-virt.intern.sigma-chemnitz.de \
    --to=enrico.scholz@sigma-chemnitz.de \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=ross@burtonini.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).