peterldowns / localias

custom local domain aliases for local dev servers
MIT License
605 stars 3 forks source link

Getting Error: error: a localias daemon or server is already running #18

Closed tanvirraj closed 10 months ago

tanvirraj commented 11 months ago

i'm trying to run localias, but everytime i'm getting this error i install the app in mac osx 12, then run this 2 commands but failed

localias set pg.web 8081 localias run

Screenshot 2023-11-23 at 10 36 25 PM
peterldowns commented 11 months ago

Interesting, is it possible that you have an instance already running? To figure this out, can you share what the following commands tell you?

localias daemon status
ps aux | grep -i localias

If there is another instance running already, that would explain the problem, and you can just kill it and then try running localias run. If there is not another instance running already, I'm not sure what to do and I'll have to think harder.

peterldowns commented 11 months ago

One other possibility is that you already have a proxy server like Charles, Caddy, or Puma that is bound to ports 443/80. This was previously reported and may be the cause of the issue. The same solution would apply here — kill that proxy and try localias run again.

I'll leave this issue open until I've updated the README to make a note of this since it seems to be a common problem.

tanvirraj commented 10 months ago

@peterldowns Thanks for you time, and sorry for delay. i face some wired behavior, every time i run ps aux | grep localias it shows dynamic process. not sure if i missing something

Screenshot 2023-12-29 at 2 18 33 PM
hslatman commented 10 months ago

@tanvirraj that's the grep process, matching itself. You don't have the actual localias binary running in those runs.

peterldowns commented 10 months ago

@tanvirraj — what @hslatman is correct. if you're only seeing the grep process, then you don't have an instance of localias running. Most likely the problem is what I wrote above:

One other possibility is that you already have a proxy server like Charles, Caddy, or Puma that is bound to ports 443/80. This https://github.com/peterldowns/localias/issues/16 and may be the cause of the issue. The same solution would apply here — kill that proxy and try localias run again.

One other thing I didn't mention is that you can try showing which processes are listening to which ports by using lsof:

❯ lsof -Pn | grep '*:443'
localias  62825   pd    7u     IPv6 0xa3c836944101b8c3           0t0                 TCP *:443 (LISTEN)
localias  62825   pd    9u     IPv6 0xa3c836990e200103           0t0                 UDP *:443
❯ lsof -Pn | grep '*:80'
localias  62825   pd    8u     IPv6 0xa3c83694410180c3           0t0                 TCP *:80 (LISTEN)

Please let me know if this helps. If you're still unable to start localias and you're certain that no other proxies are running / bound to ports 80/443, then there is something unexpectedly wrong and I'll have to come up with some other theory.

peterldowns commented 10 months ago

I added docs clarification in #19, this should be resolved now. Please re-open if the suggestions above didn't work!