GitHub imports with users tied to organizations return "something went wrong on our end"
Summary
Users attempting to import from GitHub that are members of 'Organizations' are getting an error and are being prevented from using the search filter when comparing multiple organizations to import from:
This is a result of the github_organizations_box.vue Vue component trying to render this.statusImportGithubGroupPath
.
Applicable projects do still appear in the table, but for large customers with dozens of projects, they need to manually sort through each page of returned projects to find the applicable project to import.
Steps to reproduce
- Configure a GitHub personal access token (PAT) via this link.
- Have the personal account either be a member of an existing 'Organization', or create one yourself tied to the personal account.
- Attempt to import a new project via CI/CD and select to Connect repositories from GitHub.
- When prompted, provide the PAT to load the Import repositories from GitHub page.
- Confirm a red banner indicating
Something went wrong on our end
is presented. - Developer console (F12) should indicate the request is failing to:
https://gitlab.com/import/github_group/status.json
.
A Kibana and Sentry report will be generated. For example:
"json": {
"controller": "Import::GithubGroupsController",
...
"path": "/import/github_group/status.json",
"exception.message": "Sawyer method \"login\" access is forbidden. Convert to a hash to access the attribute.",
...
"exception.backtrace": [
"config/initializers/sawyer_patch.rb:10:in `block (3 levels) in attr_accessor'",
"app/serializers/base_serializer.rb:16:in `represent'",
"app/controllers/import/github_groups_controller.rb:23:in `serialized_provider_groups'",
"app/controllers/import/github_groups_controller.rb:15:in `block (2 levels) in status'",
"app/controllers/import/github_groups_controller.rb:13:in `status'",
"ee/lib/gitlab/ip_address_state.rb:10:in `with'",
"ee/app/controllers/ee/application_controller.rb:45:in `set_current_ip_address'",
"app/controllers/application_controller.rb:468:in `set_current_admin'",
"lib/gitlab/session.rb:11:in `with_session'",
"app/controllers/application_controller.rb:459:in `set_session_storage'",
"lib/gitlab/i18n.rb:114:in `with_locale'",
"lib/gitlab/i18n.rb:120:in `with_user_locale'",
"app/controllers/application_controller.rb:450:in `set_locale'",
"app/controllers/application_controller.rb:443:in `set_current_context'",
"ee/lib/omni_auth/strategies/group_saml.rb:41:in `other_phase'",
"lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'",
"lib/gitlab/middleware/sidekiq_shard_awareness_validation.rb:20:in `block in call'",
"lib/gitlab/sidekiq_sharding/validator.rb:42:in `enabled'",
"lib/gitlab/middleware/sidekiq_shard_awareness_validation.rb:20: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/etag_caching/middleware.rb:21: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/middleware/go.rb:20:in `call'",
"lib/gitlab/middleware/query_analyzer.rb:11:in `block in call'",
"lib/gitlab/database/query_analyzer.rb:40:in `within'",
"lib/gitlab/middleware/query_analyzer.rb:11:in `call'",
"lib/gitlab/middleware/organizations/current.rb:20: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/unauthenticated_session_expiry.rb:18:in `call'",
"lib/gitlab/middleware/same_site_cookies.rb:27:in `call'",
"lib/gitlab/middleware/path_traversal_check.rb:14: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:15: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:44: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:79:in `call'",
"lib/gitlab/middleware/release_env.rb:13:in `call'"
],
"meta.caller_id": "Import::GithubGroupsController#status",
...
"exception.class": "Sawyer::Error",
}
Sentry list: https://new-sentry.gitlab.net/organizations/gitlab/issues/813624/events/?project=3
Example Project
N/A - This requires you to have content on GitHub.
What is the current bug behavior?
The callout for a user's GitHub organizations fails, resulting in the search component not working.
What is the expected correct behavior?
A user's organizations should be accessible and searchable, especially for users with potentially hundreds of projects to import from.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Possible fixes
TBD