ipfs-desktop icon indicating copy to clipboard operation
ipfs-desktop copied to clipboard

Potential hang on "IPFS is Starting"

Open jessicaschilling opened this issue 4 years ago • 3 comments

Per @UnKnoWn-Consortium, two conditions exist that can result in Desktop hanging on "IPFS is Starting" - original issue is https://github.com/ipfs-shipyard/ipfs-desktop/issues/1723 for background:

  1. Promise returned by checkIfAddrIsDaemon function at config.js does not resolve when the target address is occupied by another service that may or may not be responding to the test POST request; and
  2. Selecting an alternative port via the prompt presented by the app does not alter the api file inside the .ipfs folder

jessicaschilling avatar Jan 25 '21 19:01 jessicaschilling

(1)

It should be mitigated by fix from https://github.com/ipfs-shipyard/ipfs-desktop/pull/1750 where I added 3s timeout for POST request used for port testing.

  • Thank you @UnKnoWn-Consortium, info from https://github.com/ipfs-shipyard/ipfs-desktop/issues/1723#issuecomment-766165256 saved us a lot of time :raised_hands:
  • It sounds like some Windows firewall thingy swallowing request without any reply – indeed we should have had a lower timeout in the first place.

(2)

Still unclear to me:

  • .ipfs/api is created when ipfs daemon process starts and is removed when it stops
  • .ipfs/api can also be created manually by the user to point IPFS Desktop at go-ipfs running manually under different user, in Docker, etc.
  • @UnKnoWn-Consortium did you create .ipfs/api manually?
    • If not, perhaps your ipfs daemon process was killed before it had a chance of doing cleanup (OS crash, power outrage, etc?)
    • Try stopping the daemon, removing .ipfs/api and starting it again.

lidel avatar Jan 25 '21 23:01 lidel

@lidel

Regarding (1), You are welcome. Glad it helps.

Regarding (2), Oh yeah. I think I may have killed the daemon process manually a few times to test and investigate the issue. Aha mystery solved. On the other hand, I am wondering, will it disrupt the lifecycle of the .ipfs folder or the daemon if a cleanup script that runs when the app starts up is added?

UnKnoWn-Consortium avatar Jan 26 '21 02:01 UnKnoWn-Consortium

I am wondering, will it disrupt the lifecycle of the .ipfs folder or the daemon if a cleanup script that runs when the app starts up is added?

I believe that would work, as long the script implements heuristic described in https://github.com/ipfs-shipyard/go-ipfs-desktop/issues/3#issuecomment-771789008. We want to do cleanup only when multiaddr in $IPFS_PATH/api is truly down. If someone submits PR I'll be happy to review.

lidel avatar Feb 23 '21 16:02 lidel