Atlassian SSO omniauth

Summary

I cant create a new user via omnibus_atlassian_ouath2

Steps to reproduce

  • create gitlab instance
  • install omniauth_attlassian_oauth2 driver
  • create atlassian app to authenticate
  • try to register as a new user in gitlab instance via SSO

Example Project

What is the current bug behavior?

I configured the gitlab instance to use auth via omnibus atlassian SSO. If i want to log in via SSO with an existing user, its still fine. But if a non existing user try to sign in to create a new account it doesnt work. I get an 500. I share the sentry link with you

This mechanic worked in the past. Its possible that its broken since the update from the latest 14.x to 15.x version

https://sentry.io/share/issue/79c6b0b6363a42ebb1b0789ce760df12/

What is the expected correct behavior?

I expect that a non existing user signs in via atlassain SSO and a new gitlab user will be created without an error message.

Relevant logs and/or screenshots

==> /var/log/gitlab/nginx/gitlab_access.log <==
49.12.8.160 - - [17/Oct/2022:11:58:22 +0000] "POST /api/v4/jobs/request HTTP/1.1" 204 0 "" "gitlab-runner 15.4.0 (15-4-stable; go1.17.9; linux/amd64)" -

==> /var/log/gitlab/gitlab-rails/production.log <==
Processing by OmniauthCallbacksController#atlassian_oauth2 as HTML
  Parameters: {"state"=>"feea2e97cecae2ea712e7dab4594097a8deb536a9f2de5fa", "code"=>"[FILTERED]"}

==> /var/log/gitlab/postgresql/current <==
2022-10-17_11:58:22.77458 ERROR:  new row for relation "atlassian_identities" violates check constraint "atlassian_identities_refresh_token_length_constraint"
2022-10-17_11:58:22.77463 DETAIL:  Failing row contains (44, 2022-10-17 11:58:22.773338+00, 2022-10-17 11:58:22.773338+00, 2022-10-17 12:58:22+00, 6205672f6ba61b006fb65437, \x1ebbf1de7679e1aa76abcafffa3e213077c6909418b9fa3062a3aae39275c6..., \x458e54617670e4639b88f988, \x9b7fd052ba636d106758b4ee9c5266968783ddbf09994d0da852c534ffc8f6..., \x8373c8af25e80c2e24eefef4).
2022-10-17_11:58:22.77464 STATEMENT:  /*application:web,correlation_id:01GFJWY9Q94H9TPC2W31XH3JZ6,endpoint_id:OmniauthCallbacksController#atlassian_oauth2,db_config_name:main*/ INSERT INTO "atlassian_identities" ("user_id", "created_at", "updated_at", "expires_at", "extern_uid", "encrypted_token", "encrypted_token_iv", "encrypted_refresh_token", "encrypted_refresh_token_iv") VALUES (44, '2022-10-17 11:58:22.773338', '2022-10-17 11:58:22.773338', '2022-10-17 12:58:22', '6205672f6ba61b006fb65437', '\x1ebbf1de7679e1aa76abcafffa3e213077c6909418b9fa3062a3aae39275c67e42a30200c495d61f29fab49197529320e7ebf0252c03513deda21aef9d0d54727c0520e27db7fb770bcbd555f713318492bd662e33c60a0d1bed15ec0671e574fc8ab398ab36ca42b30747029c6b1b27a7b2f84cae0901fe3b3e5984903a2f728ce1961ab0533e10f15c4dbe2f98d61347da1c03740f5818666520d434ea3bb543570d7abdf64e566a70d68d8ce00ad8f396b71ff77789f70ea7db19c669ee339cef007fd52ca08748af2d8cc77310a81d5db04c30d769d3bde719920572febfce241fcd330d9953bd5ef215b4e7ec96f2004d694b3efd4ebccb0cb338f0e2bbf9787fd0539b4dec08831a7ff17133e45529fbab779ee44a4734730fbe9c89ec1b9421fd89b68421cf395f33f444affa724a4f6fe83d1931a1def9a314aceccc16d0c44aa759453c1f6a2bafd494e6aff58bfbfbbbce7f2f76595790dc4f97e4a0c3409e93db161137604b7ca6355e34f6d12a4d0e3bfcbb5a333faa1ea5a546d7723272eb1878fe0036148978b7fe26ca96dd4eff1987f1e4d9a3b6a2e61283650d3f179958d7cb7c39b2d17ddffeceb8bdcac7ecf536e330ed5cad7c70a904a12ad641d6aa760585eaa91e56c1d34dc1239f6e86b17e8513f747838a3edb5d12b17988da2b2525676052e88140ab86acb3dc42d5ed531a18cbbc5f964df643677bc9a459493cede3ffb98839655b6aef9371983554ce61ac89ba5d6123b6ec367f0099273481c116229825dd5e8bca4ecaa25f63cd0a3a40bba7ff1ddeb1951916bb15d52cad83778f742428282e01cdd4e7502e4c8f932045aa6a13d3bc1321d0ff34b745918c6c4e788f0e43cb9405666adee03ed837bf7645040727b6a4359e1e83ab041f31836807fe52f5b45b3f33b767ba1bffe360b4dc7163d6e648969b331cc42e797c7e4de8851cc07303ec1141fb8e58076cc9bdef55dfd062fca8f25a39a8226fdb2766e963ab506c08790e9932968b070417cb63b0e8105a40f9fe950cd22afa28ee8a6dbe97e501e100577193d9dd20c4ac285ce93eed96a92914140b10e2c3ed549641a296167cd26a7e0876fa5c7ba32158136bd993a582108c92c43ac5b6a48d456a88519a7a817f09ad19a9ef15c9a6a89091def37269724f16930823e74461a749626b3228a897834d720966a3b0d84cb0e6b04d5b8ca509e927d146ac3e01cac097578d3ba8217b6caa54c4bebcd9505061dccf8efeff0fc06beb58b2e95108efc093ebbc0f85abd7d8670fcee8ad9a5f54d9f96d8d350a2c5cde9aa9641293be3d84a87186c719e5bae2204fb4378d0232071c9299d8f6039560cb5e0a96653dc08e37fa0abc3dff18e28be8a04b7233854bf468808542b6d51dc9825c8b49f6d6f8f9aa0a8bc879846ab3b9687272fa7042239091911fe19cfb34ef7663b7b6888992ed9c4a8e3af5838502af2463f80399d3329a2793f1077a1c39bc79527627f709e47d8d2f646e6a6e9ad3bd3f846729698265452f7ebafbf354d0ca32354e2eaa4340bc593a315959d7f38e2dacee9b646da7e48510b285da511cc2e1e581676ff28e8e95c2f1b8bc73b8c64eee51b81070c77d1dcc2d9859f06af6ac61f051c16b96962a428a88c50bd79ccd63936affd670ce9237d87d453811bd386dcee98ffa9c850fa7e3749a0c14d2d7bd4f8aeea43e2db1e59601a1957149ba3a277187335e1bad68056a7ade3af3b9a5f1d437fee01777b371098a5eaf944b0c99fa3997da724920179527e41fa8fe0ed374e5de9d1850c4ef3789770facf83aa5842640c1b5516f964a69f084ef145f63e80a65c04b1f190b54dbd87ba9b08fd592927850bda60c8578fcc58e8182430561d5c9251d794f0794bfa6dd37aa9a2f4cb932a2d03d333a004ab93c67c4815d4466f8a49e3759aad9f86760315b95d52cd36c11033a589b7146f243bbfc4315cc1a96d789bc7e3d0919362372599c27143e47186e8bd538722c3e660759a853f1301c729ab037da4d902ba09a4c4d6019c2db10bec09650867a3411c1abcb899fc4a61495361538685c1828ecaff52b34b00498ce734e4c1f8fa9b61bf031e07d7f688ba44a7c6776b8fef3e7bbc1d7df94f662817df7b6cfc384302c5317cba4eaf789327f5d781f84669d6483d89666855273b245a2a98abe0be1a5402d75bb5a00cc90f376edf05f1dd1ec831ca9cac3edb7e6e82080c6c2afe28987d7e7374b4b95371ce090d69ca8dafa097d28f32a36a7261b954fef899f2dac213205d1ec79adbcb7f2f9e4698deddff4df5cbe06b9efaeb413243e29aa77a5d6a1741a1ea489d3524dd2f5026887483be2dfe95b47d8e36f908cf3a126cec2ac4491d7d5352d3c4369cb49affab3edf778fbf685d37c6879d04cd48683ff600fac79fff4946d1f18b869cc701ae3a850e722cd530cef1a4a91344172c1ba3c440cb220486cfc2e4d17dc01eaf4725211c5694a524fb383ad88126959ed6a53ffef64b48e947a550c5e0ac795bfd13d4486b21f5a7c77f05357afad768e92a2dd979f90fe4b712bd5b8b6839498ec3a4d2929feec9a8e63c192a6c8a8bd1ee30e423364f5b1be50771a46674902df24597e78efb6956c97b3e4ba68c6af83f11a', '\x458e54617670e4639b88f988', '\x9b7fd052ba636d106758b4ee9c5266968783ddbf09994d0da852c534ffc8f646e72fe0e82ae7961ba910d87d745dcbd1186c673a6d1be21d1c7ec76e328cad1e0af0245cba6c8efe0e1f1bb5f9cab3fa8572914c92333f5fd205cbcef36cf1b6414c860399599a25ae47b7228c4238c4ef94e73a911fe04de2757bf3b1781313ed7b3f6af57bcf188953486293dcc515d1e7ebcdae2cf8250330a77d49676256a460055a8a8a60c5eef6fd265889dffaecca4a4720ca34ffee9b1072e3196b34b7b81e112ee519d9bab496e158933d53d9ae452b2143d05a68574aab61e37956b774992d7567f536784d28ce52b1bc79a673be6b96c751d98919ed6eeaa77cd52ad6ddae0924de850cb24a2538eb7fd3ead5883c083a37a0511e4780c213e1cf278cb58040caee56651684d3cd0ae98b145833b806c761001fbd5f6ba184791e3cd383f62de8994562860a63f55aa5c96c3fde005499aa7bf8fa4f6715527a1cc00b2962b11deabf229ff19cd275f31f46b1c5125eb391c065de459743b1e80d62220d04116cee24d654a259134c239ff45dd976f1210790fdc2cad48981dcd7aaf0bcb9de722c88ee8faf3f640bb1905a9e669b26886add2d2672b2634ccde87ad0488b00e5b33b18e8ef32f9bfbf07a25898c6c00d9aaf7feabc9c1ac1837992d218591b531fee978c0af5c5bf755ee0f2ba3a6700a7abaedf8708eb1e20ab45e6782ae266df7fcd2c124d8158a8e662bd0ce5b5bda3b4283dfa09bb3a6c5a13bd1ff660b09e5e86e29dbc1caafd997d7713573241919b57c3b85336b5ff100776621afdb0a25203dd28e224f3b96e7c4f3df5daa606c0aca17d576448c99bf797b7477bf6a7e63c0cd727c1d972d70fd3d79980719dcdf24e88eecaa2f0ca14c8d9acefe66ffe69d8e65b8da649377c6f976b94cbddf4f659cd094380d5a2cdee0bfb98a61bbeba27246ee38c0b322d765c5d3ae39c0f0d5f16ba314d341670962cb1976be53eb2ee3aa779170bed7f1cff7f9dc04c1b44f86ba4f18e7dbb964802c05e0b51493796c4b5027d7f544327225ddb5c1ab920497a0b2a28b5b816a73c2c575f18104a04d560edc8cce61c1bc34a6d898852741aa8df160e53e06760b4239799301d971480b99b804950607cfa69e6fe3d3a9a2b42f4bdd7971a2468a521a0e9fa39888a6aa691440913190cc494a50fe0531c08f20ddc7fc7f8826504919d9c3b77fce7c02b38734d306ad06531a1d0c64fd1578418954b58675a20e31aa52515a794c4b159424336ff94b12091626e67abc8506c97ede01d52d10fbad600495b5b502735ae0372d3483f69c438377897048dd05fd59564e3391d185ac35803cb8c5f6e7edf13b40f039d8eec9a02aa6014406096997336d63a2676dc1764baa5ff1caeab13c0336a5354e8e8c2ddfc5b4a11e40a0eda092fca46e6fe7719d4f4e7ac2175d9fed88a94c2413f4f1ea23b38943a82e9691a2f840d5f0070a1704baa41bc8595432a8135aab8d5bf7220ba426fe0e81fd6f3548207b5f89586d392e90f89c00567e651d85d88c78bb6b74ddcef3a1dbdd42bb4dd7cc05df1cbf42b04321571f621870074800dfa4ef32bfb08dfc39300849fbed200ab8f5508036f678455bf8725bc86840aa6cd2872f78f39ec4c08170021175b85b8de2bd86d59df3e17469676b68e4d830d441ddd2b77e941d8e92322cafd9d29771b24f80311406ceb08705a4c86ee33c2b0f045e97feb2389306f690bb94de80d6125e45b29c960fc09bf57ef5a9dc3f41a414115fe8df20945476be0ddff9c6dfd4a00f2ac2e4f99b07faa4d1fede80edad28786b62c0120f67cfc7728bdb2c575534487960f88e02f1aa5c3740a2165ae98d758b3d47b835bc3b34dda9d351a993ec83def5050e785d1493932e437431085e7c83a02ad5541f0480150b5203a5a1af5de623abf56ac1114fad9e18d6a67c9282b3a4f3a91f44be1840be9daa6e1b5d0fa00ec41f91f053f7d3b218c5ef5b49d2f8ec49fdfa4aae74b450d426a9da50bef1904947cd011ff0a617afa73c3aab2aa2d8edca4895e1b8981efe7d8c9a99ac0', '\x8373c8af25e80c2e24eefef4') RETURNING "user_id"

==> /var/log/gitlab/gitlab-rails/production.log <==
Completed 500 Internal Server Error in 146ms (ActiveRecord: 15.7ms | Elasticsearch: 0.0ms | Allocations: 18305)

==> /var/log/gitlab/gitlab-rails/production_json.log <==
{"method":"GET","path":"/users/auth/atlassian_oauth2/callback","format":"html","controller":"OmniauthCallbacksController","action":"atlassian_oauth2","status":500,"time":"2022-10-17T11:58:22.778Z","params":[{"key":"state","value":"feea2e97cecae2ea712e7dab4594097a8deb536a9f2de5fa"},{"key":"code","value":"[FILTERED]"}],"correlation_id":"01GFJWY9Q94H9TPC2W31XH3JZ6","meta.caller_id":"OmniauthCallbacksController#atlassian_oauth2","meta.remote_ip":"149.224.151.179","meta.feature_category":"authentication_and_authorization","meta.client_id":"ip/149.224.151.179","remote_ip":"149.224.151.179","ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36","queue_duration_s":0.025578,"request_urgency":"default","target_duration_s":1,"redis_calls":14,"redis_duration_s":0.003347,"redis_read_bytes":2797,"redis_write_bytes":938,"redis_cache_calls":13,"redis_cache_duration_s":0.00288,"redis_cache_read_bytes":2555,"redis_cache_write_bytes":768,"redis_sessions_calls":1,"redis_sessions_duration_s":0.000467,"redis_sessions_read_bytes":242,"redis_sessions_write_bytes":170,"db_count":22,"db_write_count":9,"db_cached_count":0,"db_replica_count":0,"db_primary_count":22,"db_main_count":22,"db_main_replica_count":0,"db_replica_cached_count":0,"db_primary_cached_count":0,"db_main_cached_count":0,"db_main_replica_cached_count":0,"db_replica_wal_count":0,"db_primary_wal_count":0,"db_main_wal_count":0,"db_main_replica_wal_count":0,"db_replica_wal_cached_count":0,"db_primary_wal_cached_count":0,"db_main_wal_cached_count":0,"db_main_replica_wal_cached_count":0,"db_replica_duration_s":0.0,"db_primary_duration_s":0.022,"db_main_duration_s":0.022,"db_main_replica_duration_s":0.0,"external_http_count":3,"external_http_duration_s":0.5490785166621208,"cpu_s":0.187403,"mem_objects":32791,"mem_bytes":3502303,"mem_mallocs":8855,"mem_total_bytes":4813943,"pid":1224690,"worker_id":"puma_7","rate_limiting_gates":[],"exception.class":"ActiveRecord::StatementInvalid","exception.message":"PG::CheckViolation: ERROR:  new row for relation \"atlassian_identities\" violates check constraint \"atlassian_identities_refresh_token_length_constraint\"\nDETAIL:  Failing row contains (44, 2022-10-17 11:58:22.773338+00, 2022-10-17 11:58:22.773338+00, 2022-10-17 12:58:22+00, 6205672f6ba61b006fb65437, \\x1ebbf1de7679e1aa76abcafffa3e213077c6909418b9fa3062a3aae39275c6..., \\x458e54617670e4639b88f988, \\x9b7fd052ba636d106758b4ee9c5266968783ddbf09994d0da852c534ffc8f6..., \\x8373c8af25e80c2e24eefef4).\n","exception.backtrace":["lib/gitlab/database/load_balancing/connection_proxy.rb:120:in `block in write_using_load_balancer'","lib/gitlab/database/load_balancing/load_balancer.rb:115:in `block in read_write'","lib/gitlab/database/load_balancing/load_balancer.rb:184:in `retry_with_backoff'","lib/gitlab/database/load_balancing/load_balancer.rb:111:in `read_write'","lib/gitlab/database/load_balancing/connection_proxy.rb:119:in `write_using_load_balancer'","lib/gitlab/database/load_balancing/connection_proxy.rb:61:in `block (2 levels) in <class:ConnectionProxy>'","lib/gitlab/database/load_balancing/connection_proxy.rb:120:in `block in write_using_load_balancer'","lib/gitlab/database/load_balancing/load_balancer.rb:115:in `block in read_write'","lib/gitlab/database/load_balancing/load_balancer.rb:184:in `retry_with_backoff'","lib/gitlab/database/load_balancing/load_balancer.rb:111:in `read_write'","lib/gitlab/database/load_balancing/connection_proxy.rb:119:in `write_using_load_balancer'","lib/gitlab/database/load_balancing/connection_proxy.rb:71:in `transaction'","lib/gitlab/database/load_balancing/connection_proxy.rb:120:in `block in write_using_load_balancer'","lib/gitlab/database/load_balancing/load_balancer.rb:115:in `block in read_write'","lib/gitlab/database/load_balancing/load_balancer.rb:184:in `retry_with_backoff'","lib/gitlab/database/load_balancing/load_balancer.rb:111:in `read_write'","lib/gitlab/database/load_balancing/connection_proxy.rb:119:in `write_using_load_balancer'","lib/gitlab/database/load_balancing/connection_proxy.rb:71:in `transaction'","app/services/users/update_service.rb:35:in `execute'","app/services/users/update_service.rb:44:in `execute!'","lib/gitlab/auth/o_auth/user.rb:55:in `save'","lib/gitlab/auth/o_auth/user.rb:86:in `find_and_update!'","app/controllers/omniauth_callbacks_controller.rb:164:in `sign_in_user_flow'","app/controllers/omniauth_callbacks_controller.rb:131:in `omniauth_flow'","app/controllers/omniauth_callbacks_controller.rb:89:in `atlassian_oauth2'","app/controllers/application_controller.rb:531:in `set_current_admin'","lib/gitlab/session.rb:11:in `with_session'","app/controllers/application_controller.rb:522:in `set_session_storage'","lib/gitlab/i18n.rb:107:in `with_locale'","lib/gitlab/i18n.rb:113:in `with_user_locale'","app/controllers/application_controller.rb:516:in `set_locale'","app/controllers/application_controller.rb:510:in `set_current_context'","config/initializers_before_autoloader/100_patch_omniauth_oauth2.rb:16:in `callback_phase'","lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'","lib/gitlab/middleware/memory_report.rb:13:in `call'","lib/gitlab/middleware/speedscope.rb:13:in `call'","lib/gitlab/database/load_balancing/rack_middleware.rb:23:in `call'","lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'","lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'","lib/gitlab/metrics/web_transaction.rb:46:in `run'","lib/gitlab/metrics/rack_middleware.rb:16:in `call'","lib/gitlab/jira/middleware.rb:19:in `call'","lib/gitlab/middleware/go.rb:20:in `call'","lib/gitlab/etag_caching/middleware.rb:21:in `call'","lib/gitlab/middleware/query_analyzer.rb:11:in `block in call'","lib/gitlab/database/query_analyzer.rb:37:in `within'","lib/gitlab/middleware/query_analyzer.rb:11:in `call'","lib/gitlab/middleware/multipart.rb:173:in `call'","lib/gitlab/middleware/read_only/controller.rb:50:in `call'","lib/gitlab/middleware/read_only.rb:18:in `call'","lib/gitlab/middleware/same_site_cookies.rb:27:in `call'","lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'","lib/gitlab/middleware/basic_health_check.rb:25:in `call'","lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'","lib/gitlab/middleware/request_context.rb:21:in `call'","lib/gitlab/middleware/webhook_recursion_detection.rb:15:in `call'","config/initializers/fix_local_cache_middleware.rb:11:in `call'","lib/gitlab/middleware/compressed_json.rb:26:in `call'","lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'","lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'","lib/gitlab/metrics/requests_rack_middleware.rb:77:in `call'","lib/gitlab/middleware/release_env.rb:13:in `call'"],"exception.sql":"/*application:web,correlation_id:01GFJWY9Q94H9TPC2W31XH3JZ6,endpoint_id:OmniauthCallbacksController#atlassian_oauth2,db_config_name:main*/ INSERT INTO \"atlassian_identities\" (\"user_id\", \"created_at\", \"updated_at\", \"expires_at\", \"extern_uid\", \"encrypted_token\", \"encrypted_token_iv\", \"encrypted_refresh_token\", \"encrypted_refresh_token_iv\") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING \"user_id\"","db_duration_s":0.01571,"view_duration_s":0.0,"duration_s":0.14668}

==> /var/log/gitlab/gitlab-rails/production.log <==
Sending event f2de4528e39e46a595521c157a2b409a to Sentry

ActiveRecord::StatementInvalid (PG::CheckViolation: ERROR:  new row for relation "atlassian_identities" violates check constraint "atlassian_identities_refresh_token_length_constraint"
DETAIL:  Failing row contains (44, 2022-10-17 11:58:22.773338+00, 2022-10-17 11:58:22.773338+00, 2022-10-17 12:58:22+00, 6205672f6ba61b006fb65437, \x1ebbf1de7679e1aa76abcafffa3e213077c6909418b9fa3062a3aae39275c6..., \x458e54617670e4639b88f988, \x9b7fd052ba636d106758b4ee9c5266968783ddbf09994d0da852c534ffc8f6..., \x8373c8af25e80c2e24eefef4).
):

lib/gitlab/database/load_balancing/connection_proxy.rb:120:in `block in write_using_load_balancer'
lib/gitlab/database/load_balancing/load_balancer.rb:115:in `block in read_write'
lib/gitlab/database/load_balancing/load_balancer.rb:184:in `retry_with_backoff'
lib/gitlab/database/load_balancing/load_balancer.rb:111:in `read_write'
lib/gitlab/database/load_balancing/connection_proxy.rb:119:in `write_using_load_balancer'
lib/gitlab/database/load_balancing/connection_proxy.rb:61:in `block (2 levels) in <class:ConnectionProxy>'
lib/gitlab/database/load_balancing/connection_proxy.rb:120:in `block in write_using_load_balancer'
lib/gitlab/database/load_balancing/load_balancer.rb:115:in `block in read_write'
lib/gitlab/database/load_balancing/load_balancer.rb:184:in `retry_with_backoff'
lib/gitlab/database/load_balancing/load_balancer.rb:111:in `read_write'
lib/gitlab/database/load_balancing/connection_proxy.rb:119:in `write_using_load_balancer'
lib/gitlab/database/load_balancing/connection_proxy.rb:71:in `transaction'
lib/gitlab/database/load_balancing/connection_proxy.rb:120:in `block in write_using_load_balancer'
lib/gitlab/database/load_balancing/load_balancer.rb:115:in `block in read_write'
lib/gitlab/database/load_balancing/load_balancer.rb:184:in `retry_with_backoff'
lib/gitlab/database/load_balancing/load_balancer.rb:111:in `read_write'
lib/gitlab/database/load_balancing/connection_proxy.rb:119:in `write_using_load_balancer'
lib/gitlab/database/load_balancing/connection_proxy.rb:71:in `transaction'
app/services/users/update_service.rb:35:in `execute'
app/services/users/update_service.rb:44:in `execute!'
lib/gitlab/auth/o_auth/user.rb:55:in `save'
lib/gitlab/auth/o_auth/user.rb:86:in `find_and_update!'
app/controllers/omniauth_callbacks_controller.rb:164:in `sign_in_user_flow'
app/controllers/omniauth_callbacks_controller.rb:131:in `omniauth_flow'
app/controllers/omniauth_callbacks_controller.rb:89:in `atlassian_oauth2'
app/controllers/application_controller.rb:531:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:522:in `set_session_storage'
lib/gitlab/i18n.rb:107:in `with_locale'
lib/gitlab/i18n.rb:113:in `with_user_locale'
app/controllers/application_controller.rb:516:in `set_locale'
app/controllers/application_controller.rb:510:in `set_current_context'
config/initializers_before_autoloader/100_patch_omniauth_oauth2.rb:16:in `callback_phase'
lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'
lib/gitlab/middleware/memory_report.rb:13:in `call'
lib/gitlab/middleware/speedscope.rb:13:in `call'
lib/gitlab/database/load_balancing/rack_middleware.rb:23:in `call'
lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'
lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'
lib/gitlab/metrics/web_transaction.rb:46:in `run'
lib/gitlab/metrics/rack_middleware.rb:16:in `call'
lib/gitlab/jira/middleware.rb:19:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:21:in `call'
lib/gitlab/middleware/query_analyzer.rb:11:in `block in call'
lib/gitlab/database/query_analyzer.rb:37:in `within'
lib/gitlab/middleware/query_analyzer.rb:11:in `call'
lib/gitlab/middleware/multipart.rb:173:in `call'
lib/gitlab/middleware/read_only/controller.rb:50:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
lib/gitlab/middleware/request_context.rb:21:in `call'
lib/gitlab/middleware/webhook_recursion_detection.rb:15:in `call'
config/initializers/fix_local_cache_middleware.rb:11:in `call'
lib/gitlab/middleware/compressed_json.rb:26:in `call'
lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'
lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:77:in `call'
lib/gitlab/middleware/release_env.rb:13:in `call'

Results of GitLab environment info

Expand for output related to GitLab environment info

System information
System:		Ubuntu 20.04
Current User:	git
Using RVM:	no
Ruby Version:	2.7.5p203
Gem Version:	3.1.6
Bundler Version:2.3.15
Rake Version:	13.0.6
Redis Version:	6.2.7
Sidekiq Version:6.4.2
Go Version:	unknown

GitLab information
Version:	15.4.2
Revision:	ef309cf1466
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	12.10
URL:		https://git.digital-masters.de
HTTP Clone URL:	https://git.digital-masters.de/some-group/some-project.git
SSH Clone URL:	git@git.digital-masters.de:some-group/some-project.git
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: atlassian_oauth2, bitbucket

GitLab Shell
Version:	14.10.0
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell

Results of GitLab application Check

Expand for output related to the GitLab application check

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 14.10.0 ? ... OK (14.10.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes (cluster/worker) ... 1/1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units) Projects have namespace: ... 2/1 ... yes 9/2 ... yes 20/7 ... yes 17/8 ... yes 9/9 ... yes 43/10 ... yes 43/11 ... yes 43/12 ... yes 19/13 ... yes 19/15 ... yes 19/16 ... yes 17/17 ... yes 20/18 ... yes 20/19 ... yes 17/20 ... yes 60/21 ... yes 20/22 ... yes 20/23 ... yes 17/25 ... yes 20/26 ... yes 73/27 ... yes 17/28 ... yes 17/29 ... yes 17/34 ... yes 17/35 ... yes 20/36 ... yes 20/37 ... yes 20/38 ... yes 20/39 ... yes 73/40 ... yes Redis version >= 6.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.5) Git user has default SSH configuration? ... yes Active users: ... 23 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

https://sentry.io/share/issue/79c6b0b6363a42ebb1b0789ce760df12/

Edited by Robert Braatz