#1106428 node-body-parser: FTBFS: Error: expected 201 "Created", got 405 "Method Not Allowed" #1106428
- Package:
- src:node-body-parser
- Source:
- src:node-body-parser
- Submitter:
- Santiago Vila
- Date:
- 2025-08-21 18:03:03 UTC
- Severity:
- normal
- Tags:
Dear maintainer:
During a rebuild of all packages in unstable, your package failed to build:
--------------------------------------------------------------------------------
[...]
debian/rules clean
dh clean
dh_auto_clean --buildsystem=nodejs
rm -rf ./node_modules/.cache ./.nyc_output
rm -rf types-body-parser/node_modules/.cache types-body-parser/.nyc_output
rm ./node_modules/.cache
rm types-body-parser/node_modules/.cache
rm ./node_modules/.cache
unlink node_modules/@types/body-parser
dh_clean
debian/rules binary
dh binary
dh_update_autotools_config
dh_autoreconf
dh_auto_configure --buildsystem=nodejs
Link node_modules/@types/body-parser -> ../../types-body-parser
dh_auto_build --buildsystem=nodejs
No build command found, searching known files
No build command found, searching known files
debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
mocha --require test/support/env --reporter spec --check-leaks --bail test/
bodyParser()
undefined should default to {}
undefined should parse JSON
undefined should parse x-www-form-urlencoded
undefined should handle duplicated middleware
http methods
undefined should support ACL requests
undefined should support BIND requests
undefined should support CHECKOUT requests
undefined should support COPY requests
undefined should support DELETE requests
undefined should support GET requests
undefined should support HEAD requests
undefined should support LINK requests
undefined should support LOCK requests
undefined should support M-SEARCH requests
undefined should support MERGE requests
undefined should support MKACTIVITY requests
undefined should support MKCALENDAR requests
undefined should support MKCOL requests
undefined should support MOVE requests
undefined should support NOTIFY requests
undefined should support OPTIONS requests
undefined should support PATCH requests
undefined should support POST requests
undefined should support PROPFIND requests
undefined should support PROPPATCH requests
undefined should support PURGE requests
undefined should support PUT requests
1) should support QUERY requests
27 passing (95ms)
1 failing
1) bodyParser()
http methods
should support QUERY requests:
Error: expected 201 "Created", got 405 "Method Not Allowed"
at Context.<anonymous> (test/body-parser.js:100:12)
at callFnAsync (/usr/share/nodejs/mocha/lib/runnable.js:392:21)
at Runnable.run (/usr/share/nodejs/mocha/lib/runnable.js:336:7)
at Runner.runTest (/usr/share/nodejs/mocha/lib/runner.js:677:10)
at /usr/share/nodejs/mocha/lib/runner.js:800:12
at next (/usr/share/nodejs/mocha/lib/runner.js:592:14)
at /usr/share/nodejs/mocha/lib/runner.js:602:7
at next (/usr/share/nodejs/mocha/lib/runner.js:485:14)
at Immediate._onImmediate (/usr/share/nodejs/mocha/lib/runner.js:570:5)
at process.processImmediate (node:internal/timers:483:21)
----
at Test._assertStatus (/usr/share/nodejs/supertest/lib/test.js:252:14)
at /usr/share/nodejs/supertest/lib/test.js:308:13
at Test._assertFunction (/usr/share/nodejs/supertest/lib/test.js:285:13)
at Test.assert (/usr/share/nodejs/supertest/lib/test.js:164:23)
at Server.localAssert (/usr/share/nodejs/supertest/lib/test.js:120:14)
at Object.onceWrapper (node:events:638:28)
at Server.emit (node:events:524:28)
at emitCloseNT (node:net:2338:8)
at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
make[1]: *** [debian/rules:19: override_dh_auto_test] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:8: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here:
https://people.debian.org/~sanvila/build-logs/202505/
About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.
If you could not reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.
If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:node-body-parser, so that this is still
visible in the BTS web page for this package.
Thanks.
Hi, after a little research, i found the following comment in the test case on node-body-parser: > // Skipping HTTP QUERY tests on Node 21, it is reported in http.METHODS on 21.7.2 but not supported > // update this implementation to run on supported versions of 21 once they exist > // upstream tracking https://github.com/nodejs/node/issues/51562 > // express tracking issue: https://github.com/expressjs/express/issues/5615 > return getMajorVersion(versionString) === '21' see: https://github.com/expressjs/body-parser/blob/1.20.3/test/body-parser.js#L80-L86 and despite being tagged with "dont-land-on-v20.x" in the upstream pr on nodejs (https://github.com/nodejs/node/pull/51719) it did in fact land on 20.19.2 (LTS) which is used by trixie (see https://github.com/nodejs/node/commit/eb25047b1b08180ed68dcefe2299682fbc7966ab and https://nodejs.org/en/blog/release/v20.19.2) on 2025-05-14. Hope this helps Best, Joachim
Thanks a lot for the investigation! So, it seems the logical thing to do here is to disable those failing tests, as they were not really intended to be run with nodejs 20. Is there any team preference about how to do that? I can think of at least three methods. Method 1: Skip also when running nodejs 20--- a/test/body-parser.js +++ b/test/body-parser.js @@ -82,7 +82,7 @@ describe('bodyParser()', function () { // update this implementation to run on supported versions of 21 once they exist // upstream tracking https://github.com/nodejs/node/issues/51562 // express tracking issue: https://github.com/expressjs/express/issues/5615 - return getMajorVersion(versionString) === '21' + return getMajorVersion(versionString) === '20' || getMajorVersion(versionString) === '21' } methods.slice().sort().forEach(function (method) { Method 2: Make the function to return true unconditionally, since this is targeted for trixie which will have nodejs 20.--- a/test/body-parser.js +++ b/test/body-parser.js @@ -82,7 +82,7 @@ describe('bodyParser()', function () { // update this implementation to run on supported versions of 21 once they exist // upstream tracking https://github.com/nodejs/node/issues/51562 // express tracking issue: https://github.com/expressjs/express/issues/5615 - return getMajorVersion(versionString) === '21' + return true } methods.slice().sort().forEach(function (method) { Method 3: Assume that the function would return true in the place where the return value is used:--- a/test/body-parser.js +++ b/test/body-parser.js @@ -89,7 +89,7 @@ describe('bodyParser()', function () { if (method === 'connect') return it('should support ' + method.toUpperCase() + ' requests', function (done) { - if (method === 'query' && shouldSkipQuery(process.versions.node)) { + if (method === 'query') { this.skip() } request(this.server)[method]('/') I could make a team upload if some authorized voice tells me which solution is best/preferred. (My personal preference would be method 2). Thanks.
if they run again now? Could they fail? Thanks.
Le jeu. 5 juin 2025 à 03:17, Santiago Vila <sanvila@debian.org> a écrit : I believe this case is supported by the transition-to-testing logic.
Le jeu. 5 juin 2025 à 02:28, Santiago Vila <sanvila@debian.org> a écrit : The best fix would be in the embedded copy of llhttp in nodejs 20.19.2 - remove the HTTP QUERY support that was added in https://github.com/nodejs/node/commit/eb25047b1b08180ed68dcefe2299682fbc7966ab This would avoid potentially hidden bugs in the nodejs-dependents packages. Shall we reassign this bug to nodejs ?
Le jeu. 5 juin 2025 à 11:20, Santiago Vila <sanvila@debian.org> a écrit : It already is ;) https://github.com/nodejs/node/issues/51562#issuecomment-2943008360
reassign 1106428 nodejs found 1106428 20.19.2+dfsg-1 affects 1106428 src:node-body-parser forwarded 1106428 https://github.com/nodejs/node/issues/51562#issuecomment-2943008360 thanks El 5/6/25 a las 11:21, Jérémy Lal escribió: Ok. Let's see what they say. Thanks.
El 5/6/25 a las 9:11, Jérémy Lal escribió: Maybe, but in such case we might also forward this upstream. It would be troublesome if Debian adds or removes something in our nodejs 20.19.2 and then they remove or add it again in 20.19.3. Thanks.
Good news from the github issue: "I'm gonna include 65c8380 in the v20 release" https://github.com/nodejs/node/issues/51562#issuecomment-2943090159 Thanks.
Le jeu. 5 juin 2025 à 11:53, Santiago Vila <sanvila@debian.org> a écrit : I'm waiting a few hours to see if someone steps up, and will upload a patched nodejs with that commit.
Hi Jérémy, I saw you uploaded a security release after this message, but the fix was not included if I read the changelog right. Could you take another look? Thanks, Chris
Le ven. 11 juil. 2025 à 23:45, Chris Hofstaedtler <zeha@debian.org> a écrit : The 20.19.2 upload happened on may 18th, so not really "after this message". I'm to upload a fixed nodejs with only selected patches, because upstream keeps changing stuff and 20.19.3 has not the level of quality that I expected. Jérémy (from Brest !)
We believe that the bug you reported is fixed in the latest version of
nodejs, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1106428@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Jérémy Lal <kapouer@melix.org> (supplier of updated nodejs package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 20 Aug 2025 19:18:41 +0200
Source: nodejs
Architecture: source
Version: 20.19.4+dfsg-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@alioth-lists.debian.net>
Changed-By: Jérémy Lal <kapouer@melix.org>
Closes: 1106428
Changes:
nodejs (20.19.4+dfsg-1) unstable; urgency=medium
.
* New upstream version 20.19.4+dfsg.
Upstream supports HTTP QUERY and fix regression with llhttp.
Closes: #1106428.
Checksums-Sha1:
a72e7f0dd87327a2f532dbe5fc931a40eb1c134c 4378 nodejs_20.19.4+dfsg-1.dsc
36d594cccc87915a298fccaa4f30843f6a7af2ec 274900 nodejs_20.19.4+dfsg.orig-ada.tar.xz
add08b35bf2b7e8ab8ee7d6a4bcfc65262303626 306328 nodejs_20.19.4+dfsg.orig-types-node.tar.xz
ece05163c32a499240fd5aa82ef62ba610e66b6c 20158144 nodejs_20.19.4+dfsg.orig.tar.xz
80f550655e623ca0683d4ef354af7a88bd01bdb6 158444 nodejs_20.19.4+dfsg-1.debian.tar.xz
006ad01b199fe47e78f54f0b50f6241bcbed3868 10727 nodejs_20.19.4+dfsg-1_source.buildinfo
Checksums-Sha256:
66ca46032cee3bb91ba63243c467dbcae3abd967e86b77de693eae87b5b3ec12 4378 nodejs_20.19.4+dfsg-1.dsc
26deff017c505b316f2498aaf293c896f4ab92b5349b367cf21fe14fa2cbd1e1 274900 nodejs_20.19.4+dfsg.orig-ada.tar.xz
956861f7acc91a3b20a6f2dd47dca731780df84352eaf6916eb8095f4c2a6521 306328 nodejs_20.19.4+dfsg.orig-types-node.tar.xz
4ac619be101a5b3702835b6ead7b6ed5a820f102bee6e99176bd751f4c88bd85 20158144 nodejs_20.19.4+dfsg.orig.tar.xz
d4197e1b371c287f67408611b7e3e32185293103293a0643136502f6491074fa 158444 nodejs_20.19.4+dfsg-1.debian.tar.xz
6fc8e6c31d22b2d52d70fafbc76d5eb6b6050757cbb0a7d4848a52bbe8dcf144 10727 nodejs_20.19.4+dfsg-1_source.buildinfo
Files:
9f4a73e3bcf5ae54123ffcace37a0912 4378 javascript optional nodejs_20.19.4+dfsg-1.dsc
fd9ff3be8b8b43905dd24c5af24aab16 274900 javascript optional nodejs_20.19.4+dfsg.orig-ada.tar.xz
4c6ab44f89a55fc91cdb0f670eabf9dc 306328 javascript optional nodejs_20.19.4+dfsg.orig-types-node.tar.xz
fd60ae0165dc03c2811c6257f4159630 20158144 javascript optional nodejs_20.19.4+dfsg.orig.tar.xz
815de0883d45f557e625476b9f9efd7b 158444 javascript optional nodejs_20.19.4+dfsg-1.debian.tar.xz
fc97e3c9dd01dcb5690f4673c135e066 10727 javascript optional nodejs_20.19.4+dfsg-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQJGBAEBCAAwFiEEA8Tnq7iA9SQwbkgVZhHAXt0583QFAmimA48SHGthcG91ZXJA
bWVsaXgub3JnAAoJEGYRwF7dOfN0XNMQAIPLOFVl5c6DswMTuYB4pc6XGUsTUYXU
HZW1BDUqUPCZPns1Vp/VIvArJZcRdarT/A5UoxVkYX21xK9NzwPrvAHS49Y1hMe+
6byEvL4TOZnnErOL+TeEoTogn6rTIdNRi6HyqW4yCrHHVHPcwwomC4m02RLImUG4
pCDkAOHhV6B2swegMgvyyMzdqNaz+Fwwr/oWx12B7QH7Y2W9YREVsi9vk29hbHNj
37EX4oKc+CQlX2VhdDSL/N5stMSZiblAh1vqeCNRIbqBDmr56zizF94cUK3+6M+M
lWzgzB/0Q8bzDGHuzh3vlhFKLSbR35EMpb5jramhen/MxAHoJnR2vcO0TP23hJVd
ykFaViOMeuiNtNQ2N5M2ki1GYx13dRALROTqJCp27agmhN7sFBhfqJtmnQYYpb4w
2MzNIdXIEOBVPUz4hxe4AzJfbwrjdwe45uUxQdndtwtWnXtJBpXXQuyLL1MTwibo
0Kbnyo7IBRTf18D/cgeyyARSTqpKhhhx4ykP9SgAwNjwuoOLzSVhaLFe6zJLgr24
yutVj3pr5WZeJyvHz1RmFt0wAmRWjqd7JtVww7VWmSlWJWprQ12NPNKXjOTUuaAA
LF9JUbryg6Kq72vgJ7XlkcX4xXcgehe+3yPoeqAgZaGYRNjC3s66mZFkyUfBserX
M6hsZQWSbPuF
=MAaT
-----END PGP SIGNATURE-----