Unable to start plugin: autotranslate: Must have AWS Access Key ID
jicka opened this issue · comments
Hello again,
I am very sorry to write twice in such a short period of time. I did my best to troubleshoot the issue, but I cannot wrap my head around this. The error message doesn't describe the issue, and I don't know if you can replicate it. If it's too much work to investigate, no problem :)
When I install and start the 0.2.0 plugin, I get the following error in the logs (see full log at the bottom):
unable to start plugin: autotranslate: Must have AWS Access Key ID
I did the following steps to troubleshoot:
- Deleted the plugin in the system console
- Stopped mattermost
- Deleted the settings in config.json related to the plugin
- Started Mattermost
- Installed the plugin in system console
- Put the AWS Keys in the plugin settings
- Attempted to start the plugin
Things I looked at:
- I checked the config.json file, there is no issue with it. The AWS values are saved correctly.
- I tried on a test server (same DB and server specs, but no other plugins and different config.json), same issue.
- I looked at the code. Here is the part that seems to check for the AWS key in server/plugin.go:
func (p *Plugin) IsValid() error {
if p.AWSAccessKeyID == "" {
return fmt.Errorf("Must have AWS Access Key ID")
}
if p.AWSSecretAccessKey == "" {
return fmt.Errorf("Must have AWS Secret Access Key")
}
if p.AWSRegion == "" {
return fmt.Errorf("AWS Region")
}
return nil
}
And here is the definition in the plugin.json file:
"settings": [
{
"key": "AWSAccessKeyID",
"display_name": "AWS Access Key ID",
"type": "text",
"help_text": "The access key ID from AWS"
},
In the config.json file, the keys are not capitalized:
"autotranslate": {
"awsaccesskeyid": "XXXXXXXXXX",
"awsregion": "eu-central-1",
"awssecretaccesskey": "XXXXXXXXXXXXXXXXXXXXXXXXX"
}
Could this be it? If it is and you don't have the time, I can try making a pull request where I rename all the keys to be lower case in the repo.
I'm running MM 5.12 on a Linode server running Debian Stretch.
If you need me to do anything to help, please ask!
PS: This is the full error log:
2019-06-25T14:37:31.437+0200 debug web/handlers.go:58 POST - /api/v4/plugins/autotranslate/enable
2019-06-25T14:37:31.462+0200 debug jobs/workers.go:108 Workers received config change.
2019-06-25T14:37:31.478+0200 debug jobs/schedulers.go:185 Schedulers received config change.
2019-06-25T14:37:31.490+0200 debug jobs/schedulers.go:167 Next run time for scheduler MigrationsScheduler: <nil>
2019-06-25T14:37:31.514+0200 debug plugin/hclog_adapter.go:33 starting plugin {"plugin_id": "autotranslate", "wrapped_extras": "pathplugins/autotranslate/server/dist/plugin-linux-amd64args[plugins/autotranslate/server/dist/plugin-linux-amd64]"}
2019-06-25T14:37:31.515+0200 debug plugin/hclog_adapter.go:33 plugin started {"plugin_id": "autotranslate", "wrapped_extras": "pathplugins/autotranslate/server/dist/plugin-linux-amd64pid19793"}
2019-06-25T14:37:31.515+0200 debug plugin/hclog_adapter.go:33 waiting for RPC address {"plugin_id": "autotranslate", "wrapped_extras": "pathplugins/autotranslate/server/dist/plugin-linux-amd64"}
2019-06-25T14:37:31.569+0200 debug plugin/hclog_adapter.go:33 plugin address {"plugin_id": "autotranslate", "wrapped_extras": "address/tmp/plugin808676694networkunixtimestamp2019-06-25T14:37:31.569+0200"}
2019-06-25T14:37:31.570+0200 debug plugin/hclog_adapter.go:33 using plugin {"plugin_id": "autotranslate", "wrapped_extras": "version1"}
2019-06-25T14:37:31.609+0200 debug plugin/hclog_adapter.go:33 plugin process exited {"plugin_id": "autotranslate", "wrapped_extras": "pathplugins/autotranslate/server/dist/plugin-linux-amd64pid19793"}
2019-06-25T14:37:31.610+0200 debug plugin/hclog_adapter.go:35 plugin exited {"plugin_id": "autotranslate"}
2019-06-25T14:37:31.610+0200 error mlog/log.go:172 Unable to activate plugin {"plugin_id": "autotranslate", "error": "unable to start plugin: autotranslate: Must have AWS Access Key ID", "errorVerbose": "Must have AWS Access Key ID
unable to start plugin: autotranslate
github.com/mattermost/mattermost-server/plugin.(*Environment).Activate
\t/go/src/github.com/mattermost/mattermost-server/plugin/environment.go:230
github.com/mattermost/mattermost-server/app.(*App).SyncPluginsActiveState
\t/go/src/github.com/mattermost/mattermost-server/app/plugin.go:95
github.com/mattermost/mattermost-server/app.(*App).InitPlugins.func2
\t/go/src/github.com/mattermost/mattermost-server/app/plugin.go:172
github.com/mattermost/mattermost-server/config.(*emitter).invokeConfigListeners.func1
\t/go/src/github.com/mattermost/mattermost-server/config/emitter.go:35
sync.(*Map).Range
\t/usr/local/go/src/sync/map.go:333
github.com/mattermost/mattermost-server/config.(*emitter).invokeConfigListeners
\t/go/src/github.com/mattermost/mattermost-server/config/emitter.go:33
github.com/mattermost/mattermost-server/config.(*commonStore).set
\t/go/src/github.com/mattermost/mattermost-server/config/common.go:82
github.com/mattermost/mattermost-server/config.(*FileStore).Set
\t/go/src/github.com/mattermost/mattermost-server/config/file.go:97
github.com/mattermost/mattermost-server/app.(*Server).UpdateConfig
\t/go/src/github.com/mattermost/mattermost-server/app/config.go:53
github.com/mattermost/mattermost-server/app.(*App).UpdateConfig
\t/go/src/github.com/mattermost/mattermost-server/app/config.go:59
github.com/mattermost/mattermost-server/app.(*App).EnablePlugin
\t/go/src/github.com/mattermost/mattermost-server/app/plugin.go:245
github.com/mattermost/mattermost-server/api4.enablePlugin
\t/go/src/github.com/mattermost/mattermost-server/api4/plugin.go:191
github.com/mattermost/mattermost-server/web.Handler.ServeHTTP
\t/go/src/github.com/mattermost/mattermost-server/web/handlers.go:144
github.com/mattermost/mattermost-server/vendor/github.com/NYTimes/gziphandler.GzipHandlerWithOpts.func1.1
\t/go/src/github.com/mattermost/mattermost-server/vendor/github.com/NYTimes/gziphandler/gzip.go:336
net/http.HandlerFunc.ServeHTTP
\t/usr/local/go/src/net/http/server.go:1995
github.com/mattermost/mattermost-server/vendor/github.com/gorilla/mux.(*Router).ServeHTTP
\t/go/src/github.com/mattermost/mattermost-server/vendor/github.com/gorilla/mux/mux.go:212
net/http.serverHandler.ServeHTTP
\t/usr/local/go/src/net/http/server.go:2774
net/http.(*conn).serve
\t/usr/local/go/src/net/http/server.go:1878
runtime.goexit
\t/usr/local/go/src/runtime/asm_amd64.s:1337"}
Oh sorry about that. It was unintentionally build out of master. I'm looking at it now. I deleted the release version and will update soon. Thank you for the report!