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

Proxy tool. SSL_CERT_FILE is causing an unexpected error occurred [Error: internal error] #1745

Open
sampayo opened this issue Feb 9, 2024 · 3 comments

Comments

@sampayo
Copy link

sampayo commented Feb 9, 2024

What is the location of your example repository?

none

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

~2024.1.0

What version of Remix are you using?

2.5.1

Steps to Reproduce

I am using a proxy tool to debug api calls from the server. that was working until I update to version ~2024.1.0 and now it's throwing an exception [Error: internal error]. it's failing when I set SSL_CERT_FILE to a .pem file.

steps to reproduce:

  1. create any project:

npm create @shopify/hydrogen@latest -- --template multipass

  1. npm install

  2. with the follow proxy environments run rpm run dev:

CARGO_HTTP_CAINFO="/route/proxyman-ca.pem"
CGI_HTTP_PROXY="http://127.0.0.1:9090"
CURL_CA_BUNDLE="/route/proxyman-ca.pem"
GIT_SSL_CAINFO="/route/proxyman-ca.pem"
GLOBAL_AGENT_HTTP_PROXY="http://127.0.0.1:9090"
HTTPS_PROXY="http://127.0.0.1:9090"
HTTP_PROXY="http://127.0.0.1:9090"
NODE_EXTRA_CA_CERTS="/route/proxyman-ca.pem"
NODE_TLS_REJECT_UNAUTHORIZED="0"
PERL_LWP_SSL_CA_FILE="/route/proxyman-ca.pem"
PROXYMAN_INJECTION_ACTIVE=true
REQUESTS_CA_BUNDLE="/route/proxyman-ca.pem"
SPACESHIP_PROXY="http://127.0.0.1:9090"
SPACESHIP_PROXY_SSL_VERIFY_NONE=1
SSL_CERT_FILE="/route/proxyman-ca.pem"
http_proxy="http://127.0.0.1:9090"
https_proxy="http://127.0.0.1:9090"
npm_config_https_proxy="http://127.0.0.1:9090"
npm_config_proxy="http://127.0.0.1:9090"
npm_config_scripts_prepend_node_path=false

Expected Behavior

it should be working and proxy all the calls to my proxy tools

Actual Behavior

throw and error (and it)

Error: internal error
const {collections} = await storefront.query(FEATURED_COLLECTION_QUERY);
                                       ^
    at loader (/tmp/test-hyd/app/routes/_index.jsx:18:42)
    at loader (/tmp/test-hyd/node_modules/@remix-run/server-runtime/dist/esm/data.js:48:22)
    at commonRoute.loader (/tmp/test-hyd/node_modules/@remix-run/server-runtime/dist/esm/routes.js:50:15)
    at handler (/tmp/test-hyd/node_modules/@remix-run/router/router.ts:3960:7)
    at runHandler (/tmp/test-hyd/node_modules/@remix-run/router/router.ts:4020:22)
    at callLoaderOrAction (/tmp/test-hyd/node_modules/@remix-run/router/router.ts:3299:9)
    at map (/tmp/test-hyd/node_modules/@remix-run/router/router.ts:3298:24)
@frandiox
Copy link
Contributor

frandiox commented Feb 19, 2024

Can you try with npm run dev -- --legacy-runtime and see if it works there?

I think this is something that works in Node.js by default but not in our new runtime, which is closer to Oxygen production 🤔

@sampayo
Copy link
Author

sampayo commented Feb 19, 2024

Can you try with npm run dev -- --legacy-runtime and see if it works there?

I think this is something that works in Node.js by default but not in our new runtime, which is closer to Oxygen production 🤔

yep. it works in the legacy runtime. I wonder if when the legacy is drepacted (and remove) would be a way to proxy the traffic from the workers

@frandiox
Copy link
Contributor

We are adding a new flag to bypass the network filter in the worker runtime. This should probably work for your use case: #1882

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

2 participants