Skip to content

ERR_TLS_RENEGOTIATE, ERR_HTTP2_SETTINGS_CANCEL are not defined #21440

Description

@ChALkeR

While taking a look at #21435 / #21421, I did a quick and dirty check which errors are being instantiated and /lib and checked what happened.

  1. ERR_MISSING_DYNAMIC_INTSTANTIATE_HOOK seems to be used in loader, but never defined.

    ERR_MISSING_DYNAMIC_INTSTANTIATE_HOOK,
    ERR_UNKNOWN_MODULE_FORMAT
    } = require('internal/errors').codes;
    if (typeof this._dynamicInstantiate !== 'function')
    throw new ERR_MISSING_DYNAMIC_INTSTANTIATE_HOOK();
    Not defined in lib/internal/errors.js.

  2. ERR_TLS_RENEGOTIATE seems to be used in tls, but never defined.

    node/lib/_tls_wrap.js

    Lines 47 to 52 in b56f65e

    ERR_TLS_RENEGOTIATE,
    ERR_TLS_RENEGOTIATION_DISABLED,
    ERR_TLS_REQUIRED_SERVER_NAME,
    ERR_TLS_SESSION_ATTACK,
    ERR_TLS_SNI_FROM_SERVER
    } = require('internal/errors').codes;

    node/lib/_tls_wrap.js

    Lines 572 to 574 in b56f65e

    if (callback) {
    process.nextTick(callback, new ERR_TLS_RENEGOTIATE());
    }
    Not defined in lib/internal/errors.js.

  3. ERR_HTTP2_SETTINGS_CANCEL seems to be used in http2, but never defined.

    ERR_HTTP2_SETTINGS_CANCEL,
    ERR_HTTP2_SOCKET_BOUND,
    ERR_HTTP2_STATUS_101,
    ERR_HTTP2_STATUS_INVALID,
    ERR_HTTP2_STREAM_CANCEL,
    ERR_HTTP2_STREAM_ERROR,
    ERR_HTTP2_STREAM_SELF_DEPENDENCY,
    ERR_HTTP2_TRAILERS_ALREADY_SENT,
    ERR_HTTP2_TRAILERS_NOT_READY,
    ERR_HTTP2_UNSUPPORTED_PROTOCOL,
    ERR_INVALID_ARG_TYPE,
    ERR_INVALID_CALLBACK,
    ERR_INVALID_CHAR,
    ERR_INVALID_OPT_VALUE,
    ERR_OUT_OF_RANGE,
    ERR_SOCKET_CLOSED
    }
    } = require('internal/errors');
    if (typeof cb === 'function')
    cb(new ERR_HTTP2_SETTINGS_CANCEL());
    Not defined in lib/internal/errors.js.

This probably affects all 10.x versions, but was not backported to earlier branches as is a semver-major.

Blame points at 1d2fd8b / #19137.

/cc @targos

This also probably needs a testcase when fixed, I do not have one atm.

Activity

  1. added
    errorsIssues and PRs related to JavaScript errors originating in Node.js core.
    tlsIssues and PRs related to the tls subsystem.
    http2Issues and PRs related to the http2 subsystem.
    on Jun 21, 2018
  2. changed the title [-]ERR_MISSING_DYNAMIC_INTSTANTIATE_HOOK is not defined[/-] [+]ERR_MISSING_DYNAMIC_INTSTANTIATE_HOOK, ERR_TLS_RENEGOTIATE, ERR_HTTP2_SETTINGS_CANCEL are not defined[/+] on Jun 21, 2018
  3. BridgeAR commented on Jun 21, 2018

    @BridgeAR
    Member

    @ChALkeR the blame is wrong. The typo was introduced in 921fb84. Because of the typo the error did not seem to be used anymore so I removed that in 6e1c25c.

  4. ChALkeR commented on Jun 21, 2018

    @ChALkeR
    MemberAuthor

    @BridgeAR I am looking only at JS side, not docs.

    At 1d2fd8b, there is no ERR_MISSING_DY***, ERR_TLS_RENEGOTIATE or ERR_HTTP2_SETTINGS_CANCEL defined, but those are directly used as properties (for the first time).

    I could be wrong with interpreting blame output, and those might have been removed earlier.

  5. BridgeAR commented on Jun 21, 2018

    @BridgeAR
    Member

    Oh, I only looked at the first entry before the edits.

  6. ChALkeR commented on Jun 21, 2018

    @ChALkeR
    MemberAuthor

    This is the list of errors that seem to be missing documentation:

    ERR_HTTP2_ERROR
    ERR_UNKNOWN_BUILTIN_MODULE
    ERR_HTTP2_SETTINGS_CANCEL
    ERR_MISSING_DYNAMIC_INTSTANTIATE_HOOK
    ERR_TLS_RENEGOTIATE
    

    Those are the three mentioned above (that also miss implementation), plus:

    1. ERR_HTTP2_ERROR (used in lib/internal/http2/util.js).
    2. ERR_UNKNOWN_BUILTIN_MODULE (used in lib/internal/bootstrap/loaders.js).
  7. BridgeAR commented on Jun 21, 2018

    @BridgeAR
    Member
    1. Was never properly ported: f67aa56 (the error code was not created at all).
  8. BridgeAR commented on Jun 21, 2018

    @BridgeAR
    Member
    1. Was never properly implemented: bbaea12
  9. BridgeAR commented on Jun 21, 2018

    @BridgeAR
    Member

    ERR_UNKNOWN_BUILTIN_MODULE is a false positive. It is actually added to the error directly instead of using internal/errors.

  10. BridgeAR commented on Jun 21, 2018

    @BridgeAR
    Member

    ERR_HTTP2_ERROR is a false positive as well.

  11. ChALkeR commented on Jun 21, 2018

    @ChALkeR
    MemberAuthor

    @BridgeAR #21440 (comment) is specifically about documentation — I saw how those are created and it's ok that they are not present in internal/errors, but they should be documented nevertheless if the user might experience those. I do not think that those are false positives.

  12. ChALkeR commented on Jun 21, 2018

    @ChALkeR
    MemberAuthor

    Based on f67aa56, this might also affect v9.x branch.

  13. BridgeAR commented on Jun 21, 2018

    @BridgeAR
    Member

    Oh, true. They were falsely removed in 1cdb41f.

  14. 40 remaining items

  15. ChALkeR commented on Jul 23, 2018

    @ChALkeR
    MemberAuthor

    I believe this was fixed in #21493 and #21564.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to Node.js documentation.errorsIssues and PRs related to JavaScript errors originating in Node.js core.esmIssues and PRs related to the ECMAScript Modules implementation.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.http2Issues and PRs related to the http2 subsystem.tlsIssues and PRs related to the tls subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions