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

Connection refused when workers use IPv6 but IPv4 is used to connect #12114

Open
brickhousewindow opened this issue Oct 27, 2023 · 1 comment
Labels
🐛 bug Something isn't working Low priority Created by Linear-GitHub Sync self-hosting Stale

Comments

@brickhousewindow
Copy link

brickhousewindow commented Oct 27, 2023

Issue Summary

The application is returning the error message: "Internal Server Error". Inside the error log the following message is found:

Error: connect ECONNREFUSED 127.0.0.1:45317
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 45317
}

The worker is listening on IPv6 exclusively:

LISTEN 0 128 [::1]:45317 [::]:* users:(("node",pid=1204690,fd=23))

The process tree:

CGroup: /system.slice/cal.service
           ├─1204580 /usr/bin/node /usr/bin/yarn start
           ├─1204587 /usr/bin/node /opt/calcom/.yarn/releases/yarn-3.4.1.cjs start
           ├─1204598 /usr/bin/node /opt/cal.com-3.4.4/node_modules/turbo/bin/turbo run start --scope=@calcom/web
           ├─1204605 /opt/cal.com-3.4.4/node_modules/turbo-linux-64/bin/turbo run start --scope=@calcom/web
           ├─1204606 /opt/cal.com-3.4.4/node_modules/turbo-linux-64/bin/turbo --skip-infer run start --scope=@calcom/web --
           ├─1204632 /opt/cal.com-3.4.4/node_modules/turbo-linux-64/bin/go-turbo {"api_client_config":{"token":null,"team_id":null,"team_slug":null,"api_url":"https://vercel.com/api","use_preflight":false,"timeout":20},"package_manager":"berry","cli_args":{"api":null,"color":false,"cpu_profile":null,"cwd":null,"heap":null,"login":null,"no_color":false,"preflight":false,"remote_cache_timeout":null,"team":null,"token":null,"trace":null,"verbosity":0,"test_run":false,"command":{"Run":{"cache_dir":null,"cache_workers":10,"concurrency":null,"continue_execution":false,"dry_run":null,"single_package":false,"filter":[],"force":null,"framework_inference":true,"global_deps":[],"graph":null,"env_mode":"Infer","ignore":[],"include_dependencies":false,"no_cache":false,"no_daemon":false,"no_deps":false,"output_logs":null,"only":false,"parallel":false,"pkg_inference_root":"","profile":null,"remote_only":false,"scope":["@calcom/web"],"since":null,"summarize":null,"log_prefix":null,"tasks":["start"],"pass_through_args":[],"experimental_space_id":null}}}}
           ├─1204657 /usr/bin/node /opt/calcom/.yarn/releases/yarn-3.4.1.cjs run start
           ├─1204668 /usr/bin/node /opt/cal.com-3.4.4/node_modules/next/dist/bin/next start
           ├─1204679 /usr/bin/node /opt/cal.com-3.4.4/node_modules/next/dist/compiled/jest-worker/processChild.js
           └─1204690 /usr/bin/node /opt/cal.com-3.4.4/node_modules/next/dist/compiled/jest-worker/processChild.js

Netcat connection test:

[root@localhost calcom]# nc -zv4 127.0.0.1 44643
nc: connect to 127.0.0.1 port 44643 (tcp) failed: Connection refused

[root@localhost calcom]# nc -zv6 ::1 44643
Connection to ::1 44643 port [tcp/*] succeeded!

Steps to Reproduce

  1. Setup application according to the documentation inside the README
  2. run yarn build
  3. apply fix from this issue: Error: Could not find a production build in the '/home/ubuntu/cal.com/apps/web/.next', works on yarn dev #4948 (comment)
  4. run yarn start
  5. visit website

Actual Results

error is shown inside browser. Also the error message above is being logged.

Expected Results

The website works. Also the application is aware whether to use IPv6 or IPv4 exclusively internally.

Technical details

  • Nodejs version 18.18.2
  • cal.com version 3.4.4
  • yarn version 3.4.1
  • operation system: PRETTY_NAME="AlmaLinux 8.8 (Sapphire Caracal)"
  • environment production

Might be related to this nodejs issue: nodejs/node#40537. In which case it would be expected that the master process is aware which protocol is being used by the workers. Or it should be able to set the protocol.

Evidence

  • error message is being logged
@maige-app maige-app bot added the 🐛 bug Something isn't working label Oct 27, 2023
@github-actions
Copy link
Contributor

Thank you for opening your first issue, one of our team members will review it as soon as it possible. ❤️🎉

@PeerRich PeerRich added Low priority Created by Linear-GitHub Sync self-hosting labels Oct 27, 2023
@github-actions github-actions bot added the Stale label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working Low priority Created by Linear-GitHub Sync self-hosting Stale
Projects
None yet
Development

No branches or pull requests

2 participants