Merge ~ahasenack/ubuntu/+source/node-configurable-http-proxy:kinetic-fix-build-1967024 into ubuntu/+source/node-configurable-http-proxy:ubuntu/devel

Proposed by Andreas Hasenack
Status: Merged
Merged at revision: faafc2ac3a53054dce6a3a2385e298d4a1d4fcac
Proposed branch: ~ahasenack/ubuntu/+source/node-configurable-http-proxy:kinetic-fix-build-1967024
Merge into: ubuntu/+source/node-configurable-http-proxy:ubuntu/devel
Diff against target: 39 lines (+11/-1)
3 files modified
debian/changelog (+6/-0)
debian/control (+2/-1)
debian/rules (+3/-0)
Reviewer Review Type Date Requested Status
Sergio Durigan Junior (community) Approve
Canonical Server Pending
Review via email: mp+420902@code.launchpad.net

Description of the change

The build-time tests try to reach out to test.localhost.jovyan.org. That DNS record returns 127.0..0.1, so it's not like the tests are fully reaching out to the internet:

$ host test.localhost.jovyan.org
test.localhost.jovyan.org has address 127.0.0.1

But launchpad builders use squid.internal as a proxy, and it will deny access to that domain, even though it returns 127.0.0.1.

The fix is to not use the proxy for that domain. A more thorough fix would also add that name to /etc/hosts, but we can't do that at build time.

I'm unsure if this is upstreamable to Debian, as they don't seem to have internet access restrictions. I can try, though, as it shouldn't break their build.

Sorry, no PPA because they are clogged up.

To test, I suggest:
- jammy build container
- another container running squid (sudo apt install squid, no config tweak needed)
- in the jammy build container, edit /etc/environment and set (replace "j-proxy.lxd:3128" with your proxy)
http_proxy=http://j-proxy.lxd:3128/
https_proxy=http://j-proxy.lxd:3128/
HTTP_PROXY=http://j-proxy.lxd:3128/
HTTPS_PROXY=http://j-proxy.lxd:3128/
no_proxy=localhost,127.0.0.1
NO_PROXY=localhost,127.0.0.1
- build this package in the jammy build container, while tailing /var/log/squid/*log in the squid container

You will see it trying to reach out to that test domain:

1651257039.836 0 10.0.100.6 TCP_DENIED/403 3890 GET http://test.localhost.jovyan.org:8902/missing/prefix - HIER_NONE/- text/html
1651257039.893 0 10.0.100.6 TCP_DENIED/403 3858 GET http://test.localhost.jovyan.org:8902/nope - HIER_NONE/- text/html
1651257039.896 0 10.0.100.6 TCP_DENIED/403 3890 GET http://test.localhost.jovyan.org:8902/missing/prefix - HIER_NONE/- text/html
1651257039.901 0 10.0.100.6 TCP_DENIED/403 3858 GET http://test.localhost.jovyan.org:8902/nope - HIER_NONE/- text/html
1651257039.903 0 10.0.100.6 TCP_DENIED/403 3890 GET http://test.localhost.jovyan.org:8902/missing/prefix - HIER_NONE/- text/html
1651257039.941 0 10.0.100.6 TCP_DENIED/403 3875 GET http://test.localhost.jovyan.org:8902/some/path - HIER_NONE/- text/html

With the fixed package, there should be no build-related hits on the proxy, and the build should succeed. You might see snaps trying to update themselves, though ;)

To post a comment you must log in.
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Ah, Bryce's link to a debian build is from reproducible builds, not the debian builders:

https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/node-configurable-http-proxy.html

So they might take this. I'll submit.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :
Download full text (6.0 KiB)

Thanks for the MP, Andreas.

Hm, I can't make the build succeed with your patch. I could reproduce the problem locally, and when I apply the changes you suggested I do indeed notice that there are no more problems with the proxy blocking requests, but I'm seeing other errors here:

+ jasmine JASMINE_CONFIG_PATH=test/jasmine.json
Randomized with seed 01637
Started
.......................................00:59:00.990 [ConfigProxy] info: Adding route / -> http://127.0.0.1:9001
00:59:00.990 [ConfigProxy] info: Route added / -> http://127.0.0.1:9001
.F00:59:11.063 [ConfigProxy] error: 503 GET /missing/ws connect ECONNREFUSED 127.0.0.1:54321
F00:59:11.072 [ConfigProxy] error: 500 GET /% URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at ConfigurableProxy.targetForReq (/home/ubuntu/node-configurable-http-proxy/node-configurable-http-proxy-4.5.0+~cs15.1.4/lib/configproxy.js:385:27)
    at ConfigurableProxy.handleProxy (/home/ubuntu/node-configurable-http-proxy/node-configurable-http-proxy-4.5.0+~cs15.1.4/lib/configproxy.js:529:17)
    at ConfigurableProxy.handleProxyWeb (/home/ubuntu/node-configurable-http-proxy/node-configurable-http-proxy-4.5.0+~cs15.1.4/lib/configproxy.js:613:17)
    at Server.<anonymous> (/home/ubuntu/node-configurable-http-proxy/node-configurable-http-proxy-4.5.0+~cs15.1.4/lib/configproxy.js:198:27)
    at Server.emit (events.js:314:20)
    at parserOnIncoming (_http_server.js:779:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:122:17)
....F......00:59:21.149 [ConfigProxy] error: 404 GET /foo/bar
.F...

Failures:
1) Proxy Tests hostRouting: routes by host
  Message:
    Unhandled promise rejection: RequestError: Error: getaddrinfo ENOTFOUND test.localhost.jovyan.org
  Stack: ...

Read more...

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I'll upload now. I'm watching debian uploads for this package, and can sync when the fix arrives there.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Just fixed a typo in the changelog/commit message

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 2d01de6..084e4a8 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,9 @@
6+node-configurable-http-proxy (4.5.0+~cs15.1.4-4ubuntu1) kinetic; urgency=medium
7+
8+ * d/rules: add test.localhost.jovyan.org to NO_PROXY (LP: #1967024)
9+
10+ -- Andreas Hasenack <andreas@canonical.com> Fri, 29 Apr 2022 15:56:23 -0300
11+
12 node-configurable-http-proxy (4.5.0+~cs15.1.4-4) unstable; urgency=medium
13
14 * Team upload
15diff --git a/debian/control b/debian/control
16index 6354007..a747977 100644
17--- a/debian/control
18+++ b/debian/control
19@@ -1,7 +1,8 @@
20 Source: node-configurable-http-proxy
21 Section: javascript
22 Priority: optional
23-Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
24+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
25+XSBC-Original-Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
26 Uploaders: Roland Mas <lolando@debian.org>
27 Testsuite: autopkgtest-pkg-nodejs
28 Build-Depends:
29diff --git a/debian/rules b/debian/rules
30index a32c1e9..5b2de91 100755
31--- a/debian/rules
32+++ b/debian/rules
33@@ -12,3 +12,6 @@ override_dh_auto_build:
34 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
35 help2man -n 'configurable-on-the-fly HTTP Proxy in Node.js' -N ./bin/configurable-http-proxy > configurable-http-proxy.1
36 endif
37+
38+override_dh_auto_test:
39+ NO_PROXY=$$NO_PROXY,test.localhost.jovyan.org dh_auto_test --buildsystem=nodejs

Subscribers

People subscribed via source and target branches