codex icon indicating copy to clipboard operation
codex copied to clipboard

Getting ERROR: [Errno 98] Address already in use across npm and brew

Open seIIers opened this issue 1 year ago • 7 comments

What version of Codex is running?

0.20.0

Which model were you using?

n/a

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64 (Ubuntu 22.04.5)

What steps can reproduce the bug?

  1. Remove previous version npm uninstall -g @openai/codex & rm -rf ~/.codex

  2. Reinstall npm install -g @openai/codex@latest

  3. codex login fails with:

ERROR: [Errno 98] Address already in use
Error logging in: login_with_chatgpt subprocess failed:
  1. Uninstall codex & remove config

  2. Install with linuxbrew brew install codex

  3. codex fails with:

>_ Welcome to Codex, OpenAI's command-line coding agent

> Sign in with ChatGPT to use Codex as part of your paid plan
  or connect an API key for usage-based billing

> 1. Sign in with ChatGPT
     Usage included with Plus, Pro, and Team plans
  2. Provide your own API key
     Pay for what you use

  Press Enter to continue

ERROR: [Errno 98] Address already in use
  1. and codex login
ERROR: [Errno 98] Address already in use
Error logging in: login_with_chatgpt subprocess failed:

What is the expected behavior?

To be prompted to login with a link or browser open

What do you see instead?

ERROR: [Errno 98] Address already in use
Error logging in: login_with_chatgpt subprocess failed:

Additional information

Debugging

  1. ss -tulnp does not display anything in use for the OAuth required port 1455. Why is this hardcoded?
  2. lsof -i :1455 -P -n returns nothing
  3. navigating to http://localhost:1455 errors with ERR_CONNECTION_REFUSED obviously
  4. netstat -ano | findstr :1455 returns nothing
  5. No docker containers using 1455

seIIers avatar Aug 11 '25 23:08 seIIers

version 0.22.0 replaces the web server implementation, so this issue no longer arises. Could you try npm -g i @openai/codex@latest?

seratch avatar Aug 18 '25 08:08 seratch

I have updated to latest and I still get this error Address in use (os error 98). I am using codex in VsCode at the same time

journeytosilius avatar Aug 29 '25 17:08 journeytosilius

version 0.22.0 replaces the web server implementation, so this issue no longer arises. Could you try npm -g i @openai/codex@latest?

I no longer get this issue in the latest version of Codex and have since switched to native. Thanks!

seIIers avatar Aug 29 '25 17:08 seIIers

I have updated to latest and I still get this error Address in use (os error 98). I am using codex in VsCode at the same time

What version? Have you tried native? npm -g i @openai/codex@native has been working fine for me.

edit: should also mention I upgraded my WSL2 instance to Ubuntu 24.04 since attempting to get Codex working with my subscription.

seIIers avatar Aug 29 '25 17:08 seIIers

I tried, but it requires a Git repo or so it seems. What I want is to use the CLI giving it permissions to use my actual computer. For repo use I'm using codex on Vscode

journeytosilius avatar Aug 29 '25 17:08 journeytosilius

Same Issue

JohnDotOwl avatar Sep 03 '25 01:09 JohnDotOwl

Duplicate of #2671

gpeal avatar Sep 04 '25 05:09 gpeal