Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node 12.8.0 and --h2 option leads to crash #333

Closed
1 of 6 tasks
petermuessig opened this issue Aug 11, 2019 · 9 comments
Closed
1 of 6 tasks

Node 12.8.0 and --h2 option leads to crash #333

petermuessig opened this issue Aug 11, 2019 · 9 comments
Assignees
Labels
bug Something isn't working module/ui5-server Related to the UI5 Server module

Comments

@petermuessig
Copy link

Expected Behavior

ui5 serve --h2 works without error with Node 12.8.0.

Current Behavior

When running ui5 serve --h2 with Node 12.8.0 the Node application immediately crashes when trying to access resources from the server. The error is a RangeError in some internals - not directly related to the UI5 tooling.

Steps to reproduce the issue

  1. Use Node 12.8.0
  2. Run ui5 serve --h2 on any UI5 project with any UI5 tooling version supporting h2

Context

  • UI5 Module Version (output of ui5 --version when using the CLI): 1.4.3 but also happens with 1.7.0
  • Node.js Version: 12.8.0
  • npm Version: 6.10.3
  • OS/Platform: MacOS

Affected components (if known)

Log Output / Stack Trace

URL: https://localhost:8443
internal/buffer.js:940
class FastBuffer extends Uint8Array {}
^

RangeError: Invalid typed array length: -4095
    at new Uint8Array (<anonymous>)
    at new FastBuffer (internal/buffer.js:940:1)
    at Handle.onStreamRead [as onread] (internal/stream_base_commons.js:165:17)
    at Stream.<anonymous> (/Users/d039071/Downloads/aoffline/node_modules/@ui5/cli/node_modules/handle-thing/lib/handle.js:120:12)
    at Stream.emit (events.js:208:15)
    at endReadableNT (/Users/d039071/Downloads/aoffline/node_modules/@ui5/cli/node_modules/readable-stream/lib/_stream_readable.js:1010:12)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
@petermuessig
Copy link
Author

petermuessig commented Aug 11, 2019

I opened the ticket here to document this behavior and to suggest the workaround to fallback to Node 10.x when you need H2 support of the UI5 server. With Node 10.x it works properly.

If you are using homebrew you can switch back to an older version like this:
brew unlink node && brew link node@10 --force --overwrite

When switching back to Node 12.x you need to reinstall node, a simple unlink and link doesn't work here properly as npm, npx, ... are not re-linked properly. Use the following command then:
brew unlink node@10 && brew reinstall node

I don't know yet, whether we can fix this on UI5 tooling side. Needs investigation what goes wrong here.

maybe someone from the community also has an idea on that

@sebbi08
Copy link
Contributor

sebbi08 commented Aug 12, 2019

Semms to be an issue with the handle-thing package they already got an issue for that spdy-http2/handle-thing#6

@RandomByte
Copy link
Member

This is a known issue with spdy.

Related issue: https://github.com/SAP/ui5-server/issues/77

Express will eventually support nodes native http/2 implementation in Express v5 (no eta): expressjs/express#3730

I recently looked into other alternatives while working on the proxy PoC but couldn't a valid one.

As you said, workaround is to use Node 10. You can easily switch between Node versions using nvm.

@matz3 matz3 self-assigned this Sep 18, 2019
@kristian
Copy link

kristian commented Oct 23, 2019

+1 on this. Unfortunately Express has still not addressed this issue in their latest alpha release!

expressjs/express#2761 contains a good summary of the situation.

@RandomByte
Copy link
Member

The upstream spdy/handle-thing issue has been fixed: spdy-http2/handle-thing#13

Now the current master supports HTTP/2 with all current Node.js releases. For the UI5 CLI, this dependency update will be released with v2.0.0 next week.

This only requires an in-range dependency update of handle-thing. @kristian your project should only need to update any package-lock.json to resolve this issue.

@kristian
Copy link

cheer Very nice! Thanks for the update @RandomByte!

@petermuessig
Copy link
Author

👍 👍

@RandomByte
Copy link
Member

Resolved in @ui5/server@2.0.0, part of @ui5/cli@^2

@petermuessig
Copy link
Author

👍 Works, thanks!

@RandomByte RandomByte transferred this issue from SAP/ui5-server Nov 20, 2020
@RandomByte RandomByte added bug Something isn't working module/ui5-server Related to the UI5 Server module labels Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module/ui5-server Related to the UI5 Server module
Projects
None yet
Development

No branches or pull requests

5 participants