• Bug#1106428: node-body-parser: FTBFS: Error: expected 201 "Created", go

    From Santiago Vila@21:1/5 to All on Sat May 24 18:50:01 2025
    Package: src:node-body-parser
    Version: 1.20.3+~1.19.5-3
    Severity: serious
    Tags: ftbfs trixie sid

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joachim Schwarm@21:1/5 to All on Thu May 29 13:10:01 2025
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Santiago Vila@21:1/5 to All on Thu Jun 5 02:40:01 2025
    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: htt
  • From Santiago Vila@21:1/5 to All on Thu Jun 5 12:00:01 2025
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?SsOpcsOpbXkgTGFs?=@21:1/5 to All on Thu Jun 5 12:20:01 2025
    Le jeu. 5 juin 2025 à 11:53, Santiago Vila <sanvila@debian.org> a écrit :

    Good news from the github issue:

    "I'm gonna include 65c8380 in the v20 release"

    https://github.com/nodejs/node/issues/51562#issuecomment-2943090159


    I'm waiting a few hours to see if someone steps up, and will upload a
    patched nodejs with that commit.

    <div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Le jeu. 5 juin 2025 à 11:53, Santiago Vila &lt;<a href="mailto:sanvila@debian.org">sanvila@debian.org</a>&gt; a écrit :<br></
    <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Good news from the github issue:<br>

    &quot;I&#39;m gonna include 65c8380 in the v20 release&quot;<br>

    <a href="https://github.com/nodejs/node/issues/51562#issuecomment-2943090159" rel="noreferrer" target="_blank">https://github.com/nodejs/node/issues/51562#issuecomment-2943090159</a></blockquote><div><br></div><div>I&#39;m waiting a few hours to see if
    someone steps up, and will upload a patched nodejs with that commit.</div><div><br></div><div><br></div></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)