diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /doc/administration/troubleshooting | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) | |
download | gitlab-ce-a7b3560714b4d9cc4ab32dffcd1f74a284b93580.tar.gz |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'doc/administration/troubleshooting')
-rw-r--r-- | doc/administration/troubleshooting/diagnostics_tools.md | 4 | ||||
-rw-r--r-- | doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md | 60 | ||||
-rw-r--r-- | doc/administration/troubleshooting/group_saml_scim.md | 5 | ||||
-rw-r--r-- | doc/administration/troubleshooting/img/AzureAD-scim_provisioning.png | bin | 0 -> 539414 bytes | |||
-rw-r--r-- | doc/administration/troubleshooting/postgresql.md | 9 |
5 files changed, 72 insertions, 6 deletions
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 id:2537 root/discard>> +project = _ +# => #<Project id:2537 root/discard>> +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 id:2537 root/discard>> +project.irb +# Notice new context +irb(#<Project>)> 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://<username>:<password>@your.es.host:<port>" + +# 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 Binary files differnew file mode 100644 index 00000000000..b8edcfa31c2 --- /dev/null +++ b/doc/administration/troubleshooting/img/AzureAD-scim_provisioning.png 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 |