-
Notifications
You must be signed in to change notification settings - Fork 17
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
Hostport on config file still does not work #27
Comments
Can you send me a sample of your config file and command line (they can be fake, just want to see what flags and contents you are using.) I wrote a test and didn't see this problem. I will check in the test regardless, but want to make sure it replicates what you are doing. |
Thanks for the fast response. We used the config below, trying to use the account server as a master for another account server. In the first step we tried to reach the account server from a nats on another server.
We were not able to access the account server on HOSTA from HOSTB. After setting the command line option "-hp" with the same value the account server was reachable. Just before we realised, that when we set the host and port in the config and the server comes up, the log still shows the deafult resolver url: After switching to commandline the log showed: Hope, this will help to find the cause of the problem. |
hm, that is almost exactly my test, can you check that you have the latest version from master, we may not have updated the releases or something. |
wutkemtt let me know if you get a chance to try the latest code in master, i am curious if my test is somehow doing something different than your run. |
Hello, |
I will double check my test this week and get something reproducing
…On Sun, Jun 30, 2019, 11:47 PM wutkemtt ***@***.***> wrote:
Hello,
I tried the latest code this morning with the same result. The http
settings in the config file are completely ignored. Neither a different
host nor a different port is used when set via config file. When adding the
same values on the command line via the -hp option the setting is working.
Could it be that the complete http section is ignored within the config
file ?
Other sections like store, logging and nats are working.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27?email_source=notifications&email_token=AAZIPUPVDJWKO6XLDD5HUQTP5GSA7A5CNFSM4H3SCVZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY5E6SA#issuecomment-507137864>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZIPULHZOYJFMNAD2HGPYLP5GSA7ANCNFSM4H3SCVZQ>
.
|
Hm, i updated my test with your config file and I still see the host coming through: func TestStartWithConfigFileFlag(t *testing.T) {
file, err := ioutil.TempFile(os.TempDir(), "config")
require.NoError(t, err)
configString := `
OperatorJWTPath: "X:/some_path/NATS.jwt"
systemaccountjwtpath: "X:/some_path/SYS.jwt"
http: {
host: "HOSTA",
port: 9090,
readtimeout: 5000,
writetimeout: 5000 }
store: {
dir: "D:/nats/as_store",
readonly: false,
shard: false }
logging: {
debug: true,
pid: true,
time: true,
trace: false,
colors: true }
nats: {
servers: ["nats://HOSTA:4243","nats://HOSTB:4243"],
usercredentials: "X:/some_path/admin.creds",
ConnectTimeout: 5000,
ReconnectWait: 10000
}
`
fullPath, err := conf.ValidateFilePath(file.Name())
require.NoError(t, err)
err = ioutil.WriteFile(fullPath, []byte(configString), 0644)
require.NoError(t, err)
flags := Flags{
ConfigFile: fullPath,
}
server := NewAccountServer()
err = server.InitializeFromFlags(flags)
require.NoError(t, err)
require.Equal(t, "D:/nats/as_store", server.config.Store.Dir)
require.Equal(t, 5000, server.config.HTTP.ReadTimeout)
require.Equal(t, "HOSTA", server.config.HTTP.Host)
require.Equal(t, 9090, server.config.HTTP.Port)
} Does anything jump out to you, maybe i have a typo I am missing? |
bah, i see the issue, the flags are defaulting to localhost:9090 and that has precedent. Testing a fix. |
Should be fixed, confirmed with test and manually. |
If you can't confirm fix, please feel free to reopen. |
I can confirm the fix is working. Host and port are taken from config now and the server is reachable as expected. Thanks. |
The host and port setting in config file is still ignored. The standard host and port will be used.
When using the commandline parameter -hp everything works as expected.
The text was updated successfully, but these errors were encountered: