@linuxstation

Плохой ответ от запроса токена при аутентификации через GitLab?

Mattermost Platform Release v7.1

При попытке входа или создания пользователя через GitLab (Oauth2) в Mattermost выскакивает данная ошибка:

63be94d41e6d3121661606.png

Настройки Gitlab в Mattermost:
63be96f733ad9964712628.png

Настройки Oauth приложения Gitlab:
63be975e63459970293328.png

Mattermost Logs:
{"timestamp":"2023-01-11 13:50:14.127 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"q1usjgyg67fhm8b8uy53w5azze","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
{"timestamp":"2023-01-11 13:50:35.535 +03:00","level":"info","msg":"plugin process exited","caller":"plugin/hclog_adapter.go:61","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"pathplugins/com.github.manland.mattermost-plugin-gitlab/server/dist/plugin-linux-amd64pid588538"}
{"timestamp":"2023-01-11 13:50:35.535 +03:00","level":"error","msg":"Unable to activate plugin","caller":"app/plugin.go:162","plugin_id":"com.github.manland.mattermost-plugin-gitlab","error":"cannot use pre-registered application if Chimera URL is not set or empty. For now using pre-registered application is intended for Cloud instances only. If you are running on-prem disable the setting and use a custom application, otherwise set PluginSettings.ChimeraOAuthProxyURL or MM_PLUGINSETTINGS_CHIMERAOAUTHPROXYURL environment variable"}
{"timestamp":"2023-01-11 13:50:40.585 +03:00","level":"error","msg":"failed to get public IP address: failed to get public address: read udp4 0.0.0.0:8443: i/o timeout","caller":"app/plugin_api.go:940","plugin_id":"com.mattermost.calls","origin":"main.(*Plugin).OnActivate activate.go:124"}
{"timestamp":"2023-01-11 13:50:40.593 +03:00","level":"info","msg":"plugin process exited","caller":"plugin/hclog_adapter.go:61","plugin_id":"com.mattermost.calls","wrapped_extras":"pathplugins/com.mattermost.calls/server/dist/plugin-linux-amd64pid588542"}
{"timestamp":"2023-01-11 13:50:40.593 +03:00","level":"error","msg":"Unable to activate plugin","caller":"app/plugin.go:162","plugin_id":"com.mattermost.calls","error":"failed to get public IP address: failed to get public address: read udp4 0.0.0.0:8443: i/o timeout"}
{"timestamp":"2023-01-11 13:50:40.617 +03:00","level":"info","msg":"2023/01/11 13:50:40 LoadPluginConfiguration API failed to unmarshal: json: cannot unmarshal string into Go struct field Configuration.ADMINONLY of type bool\n","caller":"io/io.go:428","plugin_id":"bigbluebutton","source":"plugin_stderr"}
{"timestamp":"2023-01-11 13:50:47.330 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"4bpndp5sdbgmjqo3c3q967i77r","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
{"timestamp":"2023-01-11 13:51:04.800 +03:00","level":"error","msg":"Bad response from token request.","caller":"web/context.go:105","path":"/signup/gitlab/complete","request_id":"8q8kxk7hu3bxznd8d96ha17qfa","ip_addr":"192.168.25.24","user_id":"","method":"GET","err_where":"AuthorizeOAuthUser","http_code":500,"err_details":"response_body={\"error\":\"invalid_grant\",\"error_description\":\"The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.\"}, status_code=400, error="}
{"timestamp":"2023-01-11 13:52:39.989 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"zniywxabxp8px8j4qw5s9rhkme","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
{"timestamp":"2023-01-11 13:52:43.087 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"yh4jdnqhjpbt3yoyewk5cith8h","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
{"timestamp":"2023-01-11 13:52:44.606 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"jukundeb43grfe4nkjaemtm39w","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
{"timestamp":"2023-01-11 13:52:46.117 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"rruo7swiebr1bf15wr4upbjawc","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
{"timestamp":"2023-01-11 13:52:47.626 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"zwui19ewjfrqmy8ncggk6cpgoa","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
{"timestamp":"2023-01-11 13:52:49.146 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"u9oaj66ix387xn3wyzsuas4ruw","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
{"timestamp":"2023-01-11 13:52:50.653 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"z3awh4txn3g3jf3mxxx7eccwfe","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
{"timestamp":"2023-01-11 13:52:52.250 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"5z31u7g4bjg1zqfhys5w556bih","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
{"timestamp":"2023-01-11 13:52:53.695 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"ymkibytkwtfb3bo5nb37bj65ra","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
{"timestamp":"2023-01-11 13:52:55.308 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"fd8n9nr5mbyxjmshs7zu3pu64o","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
{"timestamp":"2023-01-11 13:52:56.752 +03:00","level":"error","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:105","path":"/api/v4/websocket","request_id":"f1hmgs1qfjg3im5puk4hpfysda","ip_addr":"192.168.25.24","user_id":"spo8b18yyfdid8gqdj9i1uq4yh","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}
  • Вопрос задан
  • 1161 просмотр
Пригласить эксперта
Ответы на вопрос 1
akelsey
@akelsey
Было у меня такое, проблема была в header "proxy_set_header X-Forwarded-Proto $scheme;" - т.к. было опубликовано через ингресс (nginx). Маттермост с какой то версии (вероятно с мажорной 7ой) обязательно требует "правильную" схему, и при том только при аутентификации. Потом куку прописывает и можно год заходить с "поломанной" схемой.
PS
Ну и звонки у вас работать не будут судя по логам. Вообще логи бы правильно оформлять, тегами code. Хотя бы смотреть приятнее, читабельнее.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы