question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm run develop results in address already in use 127.0.0.1:xxxx

See original GitHub issue

This happens with the starter as well as customized apps.

Checking via netstat -a on Windows the ports in question all seem to be open and available, and although I am using the standard dev port 8000, I get the following error:

⠋  gatsby-source-wordpress  pull updates since last build
Error: listen EADDRINUSE: address already in use 127.0.0.1:63955
    at Server.setupListenHandle [as _listen2] (net.js:1318:16)
    at listenInCluster (net.js:1366:12)
    at GetAddrInfoReqWrap.doListen (net.js:1503:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:8)
Emitted 'error' event on Server instance at:
    at emitErrorNT (net.js:1345:8)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {  
  code: 'EADDRINUSE',
  errno: -4091,
  syscall: 'listen',
  address: '127.0.0.1',
  port: 63955
}

This happens with any other manually entered port as well. A fresh install may work for a bit but eventually fails as well. I have predominantly noticed this after changing Wordpress data and restarting the process, but can’t confirm that it only happens after changing data.

I am using a docker setup, but the problem persists when using Local by Flywheel

version: "3.8"

services:
  db:
    image: mariadb:10.5.8
    restart: always
    volumes:
      - db-data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
    ports:
      - 3306:3306

  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    ports:
      - "3000:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
    volumes:
      - wordpress:/var/www/html

  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080

volumes:
  db-data:
  wordpress:

Gatsby config:

  plugins: [
    {
      resolve: "gatsby-source-wordpress-experimental",
      options: {
        url: "http://localhost:3000/graphql",
      },
     // removed the other plugins for brevity
  ],

And versions (again edited for brevity):

"dependencies": {
    "gatsby": "^2.31.1",
    "gatsby-source-wordpress-experimental": "^7.0.3",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
  },

I don’t know where the process gets this port from 127.0.0.1:63955, since I either don’t specify it or stick to something shorter (e.g. -p 4000). I’ve also noticed that once the develop script is done and the dev url is shown, the process starts over as if it has trouble persisting the changes.

If I am forgetting anything please let me know and I will edit the post promptly. I have found similar posts but they always showed that the specified port was in use.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:28 (9 by maintainers)

github_iconTop GitHub Comments

7reactions
jackonawalkcommented, May 25, 2021

Hi there, it looks like several users are impacted by this bug, we’re prioritizing it and hope to have a fix in the next month. Completely unrelated, but in the meantime we’re working on a significant rewrite of CMS Preview 🎉

3reactions
kelleyco2commented, May 31, 2021

I think I may have narrowed down what’s causing this. I believe it’s due to the WP plugin trying to source nodes before the dev server is ready 🤔 or at/near the moment that a code change is saved. I was able to reproduce by adding code to make it trigger node sourcing immediately when it started watching for changes. Can anyone who’s running into this issue try this canary release and let me know if it fixes the problem? gatsby-source-wordpress@5.7.0-alpha-wordpress.0+fe81b6e978

Thanks!

@TylerBarnes This worked for me!! Thank you so much. This was causing quite the headache!

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm run develop results in address already in use 127.0.0.1 ...
This happens with the starter as well as customized apps. Checking via netstat -a on Windows the ports in question all seem to...
Read more >
NodeJS debug Starting inspector on 127.0.0.1:42457 failed
I get a Starting inspector on 127.0.0.1:42457 failed: address already in use error I have tried changing the port in both situations and...
Read more >
scimgateway - npm
Start using scimgateway in your project by running `npm i scimgateway`. There is 1 other project in the npm registry using scimgateway.
Read more >
The definitive Node.js handbook - Medium
A Node.js app is run by a single process, without creating a new thread for ... npm registry hosts almost 500,000 open source...
Read more >
connect econnrefused 127.0.0.1:3306 vscode - You.com
I'm using vscode on ubuntu,while trying to run mysql on vscode it show ... Currently when I try connecting to MYSQL database from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found