-
Notifications
You must be signed in to change notification settings - Fork 865
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
IPFS has errored, because 8080 is already in use #912
Comments
Hello @PaulCombal! Thanks for reporting this. Perhaps we could ask the user which ports they'd like to use if those are not available. IPFS uses some different ports for different endpoints (such as 8080 for the gateway and 5001 for the API). Would you, as an user, prefer to be asked which ports to pick or let us pick a random port? @lidel what do you think about this? |
I guess your tool is designed to be used by non-developers, who have no idea what a port is. I think the best idea would be to try other ports until one is found, without prompting the user. For power users, maybe leaving the option to override the port with an environment variable or a config file would be a great idea though. For example Skype, again, would never ask you which port you want to listen to before starting, it just finds a way. |
I agree with @PaulCombal:
@olizilla thoughts? I assume on Mac you never seen any user friendly apps asking which port to use :) |
FYI, you can specify the |
But, should this only be done the first time it is run? Or every time if there is a port being used already? I think there are pros and cons of each approach. For beginners/non-developers, it'd be nice if they'd never need to care. For more advanced users, it'd be bad to be changing the ports without their consent. What do you all think? |
Isn't this why we should let them override the port to use in a config file / environment variable? At least that's the way I imagine things |
Hmm... the problem is: for us to use a random port, we have to change the config so IPFS knows it should start in a random port. Although, how would we distinguish the following two scenarios:
How do we know that the user wants us to override the port or not? Perhaps we could add a checkbox (checked by default) on the settings page. Just because it always envolves changing the settings. |
I imagined those scenarios: The override settings is not set:
The override setting is set to port X:
In both cases if no port can be used or the X port is already taken, then an error message should show. EDIT:
Using a config file / environment variable. I do not believe having a GUI to choose the port is necessary, but if you do, the save button should save changes to the said config file. |
The easiest way to go, in my opinion, is to set new installations configurations for port 0 so it is set randomly. What do you think @lidel @olizilla? I can't figure out a way to use a random port only when the defaults aren't available. That would require us to revert the options on shut down and somehow know that the user has changed the configuration. Perhaps the best is to bootstrap with a random port and then let the user do whatever they want. Most likely, only a few people will notice they're not running on the default port. Although I feel it would kind of break the connection with IPFS Companion as it searches the default API ports to connect to a node. |
It would be pretty bad if we default to random port by default (UX regression for users who did not have any issues before 😭). I think it should be possible to do a quick check of port availability during the startup, just like we check for We would do the check only when remote API endpoint is not set (lack of There are existing libs that help with this, for example with get-port: const getPort = require('get-port')
const defaultPort = 8080
const availablePort = await getPort({ port: defaultPort }))
// Will use 8080 if available, otherwise fall back to a random port The question is, what happens next, when I see two options:
Thoughts? |
Option B seems Ok to me. I believe adding a "Don't ask me again" checkbox is very important in this case. |
I think the option B with a 'Dont ask me again' as @PaulCombal suggested would be the better option. Although I didn't want to bother users about this. |
I just downloaded the AppImage from the Readme, and it won't connect to IPFS because, as described in the log, my port 8080 is already in use.
This port is very common and is even used by Skype, so maybe you could use another port if 8080 is taken?
Thank you
The text was updated successfully, but these errors were encountered: