Hugo server can't select any port v0.38

Using Hugo v0.38

hugo server --bind=xx.yy.zz.ww --baseURL=http://xx.yy.zz.ww:1313

this fails with “port 1313 already in use, attempting to use an available port”. However, it does not actually bind to another address: “bind: cannot assign requested address”

I do not have any other Hugo instances running, and I do not have anything else listening on port 1313.

Further, if I specify --port=1314 (or any other port) it also fails with the same “already in use” message.

I’m using this syntax:

hugo server --navigateToChanged --buildDrafts --watch --verbose --source="/path/to/my/project/" --config="/path/to/my/project/config.toml" --baseURL="http://mydomain.com" --port=1314 --enableGitInfo

Does specifying the port on the baseurl even work? (CLI help does not mention it) Also, are you quoting the strings after each switch?

base url with and without port both fail with the same error, both quoted and unquoted

I’m on the same version (says .39 but I think that’s just because I compiled it right away after the release). I’m not getting that, FYI. You sure they are not bound?

~ ❯❯❯ hugo env
Hugo Static Site Generator v0.39-DEV-4F639D6B darwin/amd64 BuildDate: 2018-04-02T22:30:36+0900
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.10.1"

Definitely not bound. netstat -an | grep :1313 shows nothing.

Okay, I’m an idiot. I was trying to bind to the Elastic IP of my EC2 instance, instead of 0.0.0.0.

this works just fine now:

hugo server --bind=0.0.0.0 --baseURL=http://xx.yy.zz.ww --port=1313

1 Like