From a7b3560714b4d9cc4ab32dffcd1f74a284b93580 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 18 Feb 2022 09:45:46 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-8-stable-ee --- .../troubleshooting/diagnostics_tools.md | 4 ++ .../troubleshooting/gitlab_rails_cheat_sheet.md | 60 +++++++++++++++++++-- .../troubleshooting/group_saml_scim.md | 5 +- .../img/AzureAD-scim_provisioning.png | Bin 0 -> 539414 bytes doc/administration/troubleshooting/postgresql.md | 9 ++++ 5 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 doc/administration/troubleshooting/img/AzureAD-scim_provisioning.png (limited to 'doc/administration/troubleshooting') diff --git a/doc/administration/troubleshooting/diagnostics_tools.md b/doc/administration/troubleshooting/diagnostics_tools.md index 53d4810b920..d510df5976c 100644 --- a/doc/administration/troubleshooting/diagnostics_tools.md +++ b/doc/administration/troubleshooting/diagnostics_tools.md @@ -23,3 +23,7 @@ running on. [strace-parser](https://gitlab.com/wchandler/strace-parser) is a small tool to analyze and summarize raw `strace` data. + +## kubesos + +The [`kubesos`](https://gitlab.com/gitlab-com/support/toolbox/kubesos/) utiltity retrieves GitLab cluster configuration and logs from GitLab Cloud Native chart deployments. diff --git a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md index 33a81c12811..265c5278fd6 100644 --- a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md +++ b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @@ -78,6 +78,43 @@ Notify.test_email(e, "Test email for #{n}", 'Test email').deliver_now Notify.test_email(u.email, "Test email for #{u.name}", 'Test email').deliver_now ``` +## Limiting output + +Adding a semicolon(`;`) and a follow-up statement at the end of a statement prevents the default implicit return output. This is useful if you are already explicitly printing details and potentially have a lot of return output: + +```ruby +puts ActiveRecord::Base.descendants; :ok +Project.select(&:pages_deployed?).each {|p| puts p.pages_url }; true +``` + +## Get or store the result of last operation + +Underscore(`_`) represents the implicit return of the previous statement. You can use this to quickly assign a variable from the output of the previous command: + +```ruby +Project.last +# => #> +project = _ +# => #> +project.id +# => 2537 +``` + +## Open object in irb + +Sometimes it is easier to navigate through a method if you are within the context of the object. You can shim into the namespace of `Object` to let you open `irb` within the context of any object: + +```ruby +Object.define_method(:irb) { binding.irb } + +project = Project.last +# => #> +project.irb +# Notice new context +irb(#)> web_url +# => "https://gitlab-example/root/discard" +``` + ## Query the database using an ActiveRecord Model ```ruby @@ -818,7 +855,7 @@ conflicting_permanent_redirects = RedirectRoute.matching_path_and_descendants(pa conflicting_permanent_redirects.destroy_all ``` -## Merge Requests +## Merge requests ### Close a merge request properly (if merged but still marked as open) @@ -1287,7 +1324,7 @@ has more information about Service Ping. ### Generate or get the cached Service Ping ```ruby -Gitlab::UsageData.to_json +Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values, cached: true) ``` ### Generate a fresh new Service Ping @@ -1295,7 +1332,7 @@ Gitlab::UsageData.to_json This also refreshes the cached Service Ping displayed in the Admin Area ```ruby -Gitlab::UsageData.to_json(force_refresh: true) +Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values) ``` ### Generate and print @@ -1332,7 +1369,7 @@ cluster = Clusters::Cluster.find_by(name: 'cluster_name') Delete cluster without associated resources: ```ruby -# Find users with the Administrator role +# Find users with the administrator access user = User.find_by(username: 'admin_user') # Find the cluster with the ID @@ -1377,3 +1414,18 @@ Gitlab::CurrentSettings.elasticsearch_url Gitlab::CurrentSettings.elasticsearch_indexing ``` + +#### Changing the Elasticsearch password + +```ruby +es_url = Gitlab::CurrentSettings.current_application_settings + +# Confirm the current ElasticSearch URL +es_url.elasticsearch_url + +# Set the ElasticSearch URL +es_url.elasticsearch_url = "http://:@your.es.host:" + +# Save the change +es_url.save! +``` diff --git a/doc/administration/troubleshooting/group_saml_scim.md b/doc/administration/troubleshooting/group_saml_scim.md index 8ec6b35ec39..a30ade058f6 100644 --- a/doc/administration/troubleshooting/group_saml_scim.md +++ b/doc/administration/troubleshooting/group_saml_scim.md @@ -1,6 +1,6 @@ --- stage: Manage -group: Authentication & Authorization +group: Authentication and Authorization info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments type: reference --- @@ -40,7 +40,8 @@ User claims and attributes: SCIM mapping: -![Azure AD SCIM](img/AzureAD-scim_attribute_mapping.png) +![Azure AD SCIM Provisioning](img/AzureAD-scim_provisioning.png) +![Azure AD SCIM Attribute Mapping](img/AzureAD-scim_attribute_mapping.png) Group Sync: diff --git a/doc/administration/troubleshooting/img/AzureAD-scim_provisioning.png b/doc/administration/troubleshooting/img/AzureAD-scim_provisioning.png new file mode 100644 index 00000000000..b8edcfa31c2 Binary files /dev/null and b/doc/administration/troubleshooting/img/AzureAD-scim_provisioning.png differ diff --git a/doc/administration/troubleshooting/postgresql.md b/doc/administration/troubleshooting/postgresql.md index e4d1696ea93..47fd424b1fd 100644 --- a/doc/administration/troubleshooting/postgresql.md +++ b/doc/administration/troubleshooting/postgresql.md @@ -98,6 +98,15 @@ This section is for links to information elsewhere in the GitLab documentation. - [Common Geo errors](../geo/replication/troubleshooting.md#fixing-common-errors). +- Mismatch in `pg_dump` and `psql` versions: + + ```plaintext + Dumping PostgreSQL database gitlabhq_production ... pg_dump: error: server version: 13.3; pg_dump version: 14.2 + pg_dump: error: aborting because of server version mismatch + ``` + + To fix this, see [Backup and restore a non-packaged PostgreSQL database](https://docs.gitlab.com/omnibus/settings/database.html#backup-and-restore-a-non-packaged-postgresql-database). + ## Support topics ### Database deadlocks -- cgit v1.2.1