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
diff --git a/debian/changelog b/debian/changelog
index 2d01de6..084e4a8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
1node-configurable-http-proxy (4.5.0+~cs15.1.4-4ubuntu1) kinetic; urgency=medium
2
3 * d/rules: add test.localhost.jovyan.org to NO_PROXY (LP: #1967024)
4
5 -- Andreas Hasenack <andreas@canonical.com> Fri, 29 Apr 2022 15:56:23 -0300
6
1node-configurable-http-proxy (4.5.0+~cs15.1.4-4) unstable; urgency=medium7node-configurable-http-proxy (4.5.0+~cs15.1.4-4) unstable; urgency=medium
28
3 * Team upload9 * Team upload
diff --git a/debian/control b/debian/control
index 6354007..a747977 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,8 @@
1Source: node-configurable-http-proxy1Source: node-configurable-http-proxy
2Section: javascript2Section: javascript
3Priority: optional3Priority: optional
4Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
5Uploaders: Roland Mas <lolando@debian.org>6Uploaders: Roland Mas <lolando@debian.org>
6Testsuite: autopkgtest-pkg-nodejs7Testsuite: autopkgtest-pkg-nodejs
7Build-Depends:8Build-Depends:
diff --git a/debian/rules b/debian/rules
index a32c1e9..5b2de91 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,3 +12,6 @@ override_dh_auto_build:
12ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))12ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
13 help2man -n 'configurable-on-the-fly HTTP Proxy in Node.js' -N ./bin/configurable-http-proxy > configurable-http-proxy.113 help2man -n 'configurable-on-the-fly HTTP Proxy in Node.js' -N ./bin/configurable-http-proxy > configurable-http-proxy.1
14endif14endif
15
16override_dh_auto_test:
17 NO_PROXY=$$NO_PROXY,test.localhost.jovyan.org dh_auto_test --buildsystem=nodejs

Subscribers

People subscribed via source and target branches