LiveRamp / reslang

A language for describing resource-oriented APIs & turning them into Swagger or resource diagrams. Oriented around the concepts we want to expose in the APIs.
Apache License 2.0
23 stars 7 forks source link

Network connection error (?) #62

Closed j-q-arnold closed 4 years ago

j-q-arnold commented 4 years ago

Running reslang got the following error. Still opened a browser window, but this seems wrong.

$ ./reslang ~/code/api-specs/segment-delivery --open
Success - swagger copied to clipboard
{
  ssr: undefined,
  watch: undefined,
  templateFileName: undefined,
  templateOptions: {},
  redocOptions: {}
}

events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use :::8080
    at Server.setupListenHandle [as _listen2] (net.js:1314:16)
    at listenInCluster (net.js:1362:12)
    at Server.listen (net.js:1448:7)
    at /Users/jaarno/code/reslang/node_modules/redoc-cli/index.js:152:16
    at Generator.next (<anonymous>)
    at fulfilled (/Users/jaarno/code/reslang/node_modules/redoc-cli/index.js:6:58)
Emitted 'error' event on Server instance at:
    at emitErrorNT (net.js:1341:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'EADDRINUSE',
  errno: -48,
  syscall: 'listen',
  address: '::',
  port: 8080
}
(node:16893) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:16893) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:16893) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
forestgagnon commented 4 years ago

EADDRINUSE suggests you already have some program listening on port 8080

anything from lsof -i :8080?

j-q-arnold commented 4 years ago

I guess my point is more that reslang should deal with the issue itself. If it is trying to start a webserver, the user doesn't really need an error message if the webserver is already running.

$ lsof -i :8080
COMMAND   PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
node    11216 jaarno   21u  IPv6 0x15f31074f7ea0bf9      0t0  TCP *:http-alt (LISTEN)
liveandrew commented 4 years ago

reslang needs to start up a redoc server, so some sort of error is needed.

feel free to submit a patch for a more graceful error, or alternatively suggest a different outcome you'd like to see

liveandrew commented 4 years ago

now prints out the error: "Cannot start Redoc server on port 8080 - please check you don't have another server running" if the redoc server has a problem