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

Reading some fields of FetchEvent.client causes a crash in Viceroy in js-compute >= 3.0 #753

Open
harmony7 opened this issue Apr 10, 2024 · 0 comments

Comments

@harmony7
Copy link
Contributor

FetchEvent.client is of type ClientInfo, which contains information about the currently connected client.

One thing to note is, these crashes do not occur when deployed to Fastly Compute.

Reading some of these fields in Viceroy (including fiddle) causes crashes, starting with js-compute@3.x (the problem does not happen in js-compute@2.x): 'tlsJA3MD5', 'tlsCipherOpensslName', 'tlsProtocol', 'tlsClientCertificate', 'tlsClientHello'.

The error I get is something like this:

Error while running request handler: tls_cipher_openssl_name_get: A `None` error. This status code is used to indicate when an optional value did not exist, as opposed to an empty value.

NOTE: In Fiddle the error looks like this:

tls_cipher_openssl_name_get: Generic error value. This means that some unexpected error occurred during a hostcall.

This means that simply trying to perform a console.log(event.client) in local development will cause a crash.

However, these crashes do not occur when deployed to a Fastly service. The reason for this I'm speculating may be because these fields always have values on Fastly.

I noticed this because a library I had written back in js-compute@2 started crashing in a debug logging statement after switching to js-compute@3, but only on local dev.

I have a repro here: https://fiddle.fastly.dev/fiddle/adac0871

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant