Open ryota38 opened 4 years ago
Getting the same error. It's nice that this plugin is promoted by mattermost.com (https://mattermost.com/blog/the-mattermost-teams-10-favorite-productivity-hacks-remote-work/), but it just does not work because of this issue... btw. I'm using mattermost shipped with gitlab.
@ryota38 @brammeleman it works for us in the community server. what is your config for that settings?
the ListenAddress
is a port number only like "ListenAddress": ":8065",
The config.json
shows:
{
"ServiceSettings": {
"SiteURL": "",
"WebsocketURL": "",
"LicenseFileLocation": "",
"ListenAddress": ":8065",
"ConnectionSecurity": "",
"TLSCertFile": "",
"TLSKeyFile": "",
...
Looks like a port is assumed, but the variable name is ListenAddress:
siteURLPort := *config.ServiceSettings.ListenAddress
In combination with:
URL: fmt.Sprintf("http://localhost%v/plugins/%v/api/complete?token=%s", siteURLPort, manifest.Id, p.configuration.Token),
This results in the following error:
"level":"error","ts":1587719469.7949903,"caller":"mlog/log.go:174","msg":"Action integration error","path":"/api/v4/actions/dialogs/submit","request_id":"874cnh1k4bnibykxsg3uo3xrfy","ip_addr":"80.101.23.250","user_id":"8hfyyi6zi3dwprt4b6jfjesmpw","method":"POST","err_where":"DoActionRequest","http_code":400,"err_details":"err=Post http://localhost127.0.0.1:8065/plugins/com.cpanato.rent-a-carlos/api/dialog?token=7G6egUxxvWzAPRCukQcSMjGHrMjSci9H: lookup localhost127.0.0.1 on 127.0.0.1:53: no such host"}
So it looks like the value of siteURLPort
is set to 127.0.0.1:8065
Thank you for your response.
In my config.json, ListenAddress is "127.0.0.1:8065".
My mattermost server is setuped with bitnami installer (by other person), I feel maybe some trick in bitnami installer process.
P.S. I'm not familiar with GO, so I just patched hosts file... It's working well.
I can see this message in server log: lookup localhost127.0.0.1 on xxx: no such host
This code seems to be using the server address thinking it's just a port number.
sever/actions.go
SiteURLPort := *config.ServiceSettings.ListenAddress
URL: fmt.Sprintf("http://localhost%v/plugins/%v/api/complete?token=%s", siteURLPort, manifest.Id, p.configuration.Token