Skip to content
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

Sia hostd on windows can't start after port change #617

Closed
npelov opened this issue Feb 27, 2025 · 12 comments
Closed

Sia hostd on windows can't start after port change #617

npelov opened this issue Feb 27, 2025 · 12 comments
Labels
bug Something isn't working

Comments

@npelov
Copy link

npelov commented Feb 27, 2025

Current Behavior

I had to change the port of sia hostd in the gui program. and I couldn't start the daemon. Restoring the port didn't help either

Expected Behavior

should be able to start the daemon after changing the port or at least see what the error is

Steps to Reproduce

  1. stop the daemon
  2. chagne the port
  3. start the daemon - failed
  4. restored the original port
  5. started the daemon - failed again

Version

desktop v0.19.0 daemon v2.0.4

What operating system did the problem occur on (e.g. Ubuntu 22.04, macOS 12.0, Windows 11)?

Windows 10

Anything else?

Image

@npelov npelov added the bug Something isn't working label Feb 27, 2025
@alexfreska
Copy link
Member

alexfreska commented Feb 27, 2025

Hi @npelov,

  1. could check your log file (accessible by clicking the data directory button in the advanced configuration section) and see if it gives any indication as to why it can't start?
  2. could you completely shutdown the desktop app and then check the task manager and see if there are still any "hostd" processes running?

@npelov
Copy link
Author

npelov commented Feb 27, 2025

completely restart desktop app didn't help
I changed data directory to D:\siacoin (I can see the log, hostd.db and consensus there. I couldn't find anything in long so I tried to rename the log to hostd.log.1 in order to have a log file with only the error message, but log file was not recreated. I did that in linux/docker and it worked. My guess is it doesn't get to running hostd part.

@npelov
Copy link
Author

npelov commented Feb 27, 2025

I found something in
C:\Users\npelov\AppData\Roaming\hostd\data\hostd.log
but I think it's outdated (see below - timestamp is old)

{"level":"warn","ts":1736007964.2671428,"logger":"api","caller":"api/endpoints.go:38","msg":"failed to update dynamic DNS","error":"failed to split netaddress host and port: missing port in address"}

I can see this in C:\Users\npelov\AppData\Roaming\hostd\data\config.yaml
directory: D:\siacoin
(sorry. can't post all because I'm afraid to leak secrets)

re-create/restore old log doesn't help - nothing new is written to the log

@alexfreska
Copy link
Member

@npelov ok I will release a new version that better exposes the underlying error so that we have a bit more information.

@npelov
Copy link
Author

npelov commented Feb 27, 2025

@alexfreska I'm guessing you can't repeat what happened to me :( that's hard to debug.

@alexfreska
Copy link
Member

@npelov could you share your hostd.yml config file without your recovery phrase or anything else sensitive? I would like to see if it includes any yaml fields that have been changed.

@npelov
Copy link
Author

npelov commented Feb 27, 2025

btw I moved this node to linux (docker, both hosts were v2.0.4). I got an error about the gatewayAddress:
failed to load config file: failed to decode config file: yaml: unmarshal errors:
line 12: field gatewayAddress not found in type config.Consensus

I searched for hostd.yml and config.yml because I wasn't sure where the config is.
This is the windows config (config.yaml in appdata roaming hostd dir):

syncer:
  address: ':9981'
  bootstrap: true
rhp4:
  listenAddresses:
    - protocol: tcp
      address: ':9984'
name: opesho
directory: D:\siacoin
autoOpenWebUI: true
http:
  address: ':9980'
consensus:
  network: mainnet
  indexBatchSize: 1000
  gatewayAddress: ':9981'
rhp2:
  address: ':9985'
rhp3:
  tcp: ':9986'
log:
  stdout:
    level: info
    enabled: true
    format: human
  file:
    enabled: true
    level: info
    format: json
  level: warn

P.S. I haven't uninstalled the windows program. Let me know if you want me to install another release to help debug the error

@alexfreska
Copy link
Member

alexfreska commented Feb 27, 2025

@npelov hey I also found the incorrect config field gatewayAddress address, it should be syncer.address. I am pretty certain this is causing your startup issue and its a bug in the desktop app. I've got a fix queued up: SiaFoundation/desktop#118 thank you so much for your patience and help in debugging!

@npelov
Copy link
Author

npelov commented Feb 27, 2025

@alexfreska indeed. removed it and the daemon started. Maybe you can fix the update from pre-2.0 version to remove that? I haven't touched the config file. Whatever is there is written by the gui program .
There was an auto-update of the gui program. but it worked for a while after the update. maybe hostd wasn't restarted ... don't know what happened.

@alexfreska
Copy link
Member

@npelov the issue should be gone in 0.20.0, are you successfully running the new version?

@npelov
Copy link
Author

npelov commented Feb 28, 2025

I don't know. The whole thing started because I wanted to move it to linux. Now it's moved and I can't test. Also the issue showed on upgrade from pre-v2. I manually removed gatewayAddress and it is now working. maybe you can test the upgrade.
you should fix the error level thing - it reports everything as error, and then info in the message. can't you parse output from daemon and set the correct error level? I mean it's not like super urgent but nice to have.

Image

@n8maninger
Copy link
Member

Closing this as completed for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants