mattermost-plugin-github icon indicating copy to clipboard operation
mattermost-plugin-github copied to clipboard

Failure to connect to Github account with Gitlab omnibus install

Open karlduderstadt opened this issue 4 years ago • 3 comments

I upgraded to mattermost team edition 5.19.1 based on previous feedback :) and configured everything as described in the instructions. However, I am unable to complete the connection process after running /github connect and following the instructions. I believe there is a configuration/permission issue in the gitlab omnibus installation. I am now using mattermost packaged with Gitlab 12.8.5. At first I received an error saying I did not have permission to edit the root.html file:

{"level":"error","ts":1583878625.1969664,"caller":"web/static.go:26","msg":"Failed to update assets subpath from config","error":"failed to update root.html with subpath /: open /opt/gitlab/embedded/service/mattermost/client/root.html: permission denied","errorVerbose":"open /opt/gitlab/embedded/service/mattermost/client/root.html: permission denied\nfailed to update root.html with subpath /\ngithub.com/mattermost/mattermost-server/v5/utils.UpdateAssetsSubpath\n\tgithub.com/mattermost/mattermost-server/v5@/utils/subpath.go:117\ngithub.com/mattermost/mattermost-server/v5/utils.UpdateAssetsSubpathFromConfig\n\tgithub.com/mattermost/mattermost-server/v5@/utils/subpath.go:162\ngithub.com/mattermost/mattermost-server/v5/web.(*Web).InitStatic\n\tgithub.com/mattermost/mattermost-server/v5@/web/static.go:25\ngithub.com/mattermost/mattermost-server/v5/web.New\n\tgithub.com/mattermost/mattermost-server/v5@/web/web.go:39\ngithub.com/mattermost/mattermost-server/v5/cmd/mattermost/commands.runServer\n\tgithub.com/mattermost/mattermost-server/v5@/cmd/mattermost/commands/server.go:77\ngithub.com/mattermost/mattermost-server/v5/cmd/mattermost/commands.serverCmdF\n\tgithub.com/mattermost/mattermost-server/v5@/cmd/mattermost/commands/server.go:53\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/[email protected]/command.go:826\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/[email protected]/command.go:914\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/[email protected]/command.go:864\ngithub.com/mattermost/mattermost-server/v5/cmd/mattermost/commands.Run\n\tgithub.com/mattermost/mattermost-server/v5@/cmd/mattermost/commands/root.go:15\nmain.main\n\tgithub.com/mattermost/mattermost-server/v5@/cmd/mattermost/main.go:30\nruntime.main\n\truntime/proc.go:203\nruntime.goexit\n\truntime/asm_amd64.s:1357"}

Then I found this post https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4548

After following these instructions (for a separate domain) I still can't connect (it just get a timeout after a long while) and I am getting the following error in the mattermost log:

{"level":"error","ts":1583879642.866345,"caller":"config/file.go:241","msg":"failed to reload file on change","path":"/var/opt/gitlab/mattermost/config.json","error":"failed to unmarshal config with env overrides: parsing error at line 1, character 1: unexpected end of JSON input","errorVerbose":"parsing error at line 1, character 1: unexpected end of JSON input\nfailed to unmarshal config with env overrides\ngithub.com/mattermost/mattermost-server/v5/config.(*commonStore).load\n\tgithub.com/mattermost/mattermost-server/v5@/config/common.go:106\ngithub.com/mattermost/mattermost-server/v5/config.(*FileStore).Load\n\tgithub.com/mattermost/mattermost-server/v5@/config/file.go:168\ngithub.com/mattermost/mattermost-server/v5/config.(*FileStore).startWatcher.func1\n\tgithub.com/mattermost/mattermost-server/v5@/config/file.go:240\nruntime.goexit\n\truntime/asm_amd64.s:1357"}

Please let me know if there is some way I can fix this in the CLI. Otherwise, I guess I will have to unpackage mattermost from gitlab or migrate to a fresh installation to fix the problem. Maybe there is something that can be done on the gitlab side. I assume many people will encounter this problem.

In case I have to migrate can you please point me to instructions to perform the migration?

karlduderstadt avatar Mar 11 '20 07:03 karlduderstadt

@karlduderstadt Does your Mattermost server start correctly? Could you please post a sanitised version of /var/opt/gitlab/mattermost/config.json here?

hanzei avatar Apr 03 '20 17:04 hanzei

This error is also given with an empty config file. When disk is full or there is a temporary disk-problem, Mattermost still rewrites the config file, so this happens. What I did was make a copy of the template and then go through each option in the system console, to check if correct.

VincentSC avatar Apr 30 '20 09:04 VincentSC