Commit e65a26a8 authored by Ben Prescott @bprescott_↙ ☺'s avatar Ben Prescott @bprescott_↙ ☺ Committed by Marcia Ramos

Rails dbconsole requires --database from 14.2, AWS S3 changes from 14.3

parent d7d41291
......@@ -723,17 +723,31 @@ If you disabled a secondary node, either with the [replication pause task](../in
(13.2) or by using the user interface (13.1 and earlier), you must first
re-enable the node before you can continue. This is fixed in 13.4.
Run the following command, replacing `https://<secondary url>/` with the URL
for your secondary server, using either `http` or `https`, and ensuring that you
end the URL with a slash (`/`):
This can be fixed in the database.
```shell
sudo gitlab-rails dbconsole
1. Start a database console:
UPDATE geo_nodes SET enabled = true WHERE url = 'https://<secondary url>/' AND enabled = false;"
```
In [GitLab 14.2 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/341210):
```shell
sudo gitlab-rails dbconsole --database main
```
In GitLab 14.1 and earlier:
```shell
sudo gitlab-rails dbconsole
```
1. Run the following command, replacing `https://<secondary url>/` with the URL
for your secondary server. You can use either `http` or `https`, but ensure that you
end the URL with a slash (`/`):
```sql
UPDATE geo_nodes SET enabled = true WHERE url = 'https://<secondary url>/' AND enabled = false;"
```
This should update 1 row.
This should update 1 row.
### Message: ``NoMethodError: undefined method `secondary?' for nil:NilClass``
......
......@@ -165,8 +165,16 @@ and they will assist you with any issues you are having.
- How to connect to a GitLab PostgreSQL database:
In GitLab 14.2 (chart 5.2) and later:
```shell
kubectl exec -it <task-runner-pod-name> -- /srv/gitlab/bin/rails dbconsole --include-password --database main
```
In GitLab 14.1 (chart 5.1) and earlier:
```shell
kubectl exec -it <task-runner-pod-name> -- /srv/gitlab/bin/rails dbconsole -p
kubectl exec -it <task-runner-pod-name> -- /srv/gitlab/bin/rails dbconsole --include-password
```
- How to get information about Helm installation status:
......
......@@ -409,6 +409,8 @@ For Omnibus GitLab packages:
##### S3 Encrypted Buckets
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64765) in GitLab 14.3.
AWS supports these [modes for server side encryption](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html):
- Amazon S3-Managed Keys (SSE-S3)
......@@ -1377,18 +1379,30 @@ after which users must reactivate 2FA.
1. Enter the database console:
For Omnibus GitLab packages:
For Omnibus GitLab 14.1 and earlier:
```shell
sudo gitlab-rails dbconsole
```
For installations from source:
For Omnibus GitLab 14.2 and later:
```shell
sudo gitlab-rails dbconsole --database main
```
For installations from source, GitLab 14.1 and earlier:
```shell
sudo -u git -H bundle exec rails dbconsole -e production
```
For installations from source, GitLab 14.2 and later:
```shell
sudo -u git -H bundle exec rails dbconsole -e production --database main
```
1. Examine the `ci_group_variables` and `ci_variables` tables:
```sql
......@@ -1411,18 +1425,30 @@ You may need to reconfigure or restart GitLab for the changes to take effect.
1. Enter the database console:
For Omnibus GitLab packages:
For Omnibus GitLab 14.1 and earlier:
```shell
sudo gitlab-rails dbconsole
```
For installations from source:
For Omnibus GitLab 14.2 and later:
```shell
sudo gitlab-rails dbconsole --database main
```
For installations from source, GitLab 14.1 and earlier:
```shell
sudo -u git -H bundle exec rails dbconsole -e production
```
For installations from source, GitLab 14.2 and later:
```shell
sudo -u git -H bundle exec rails dbconsole -e production --database main
```
1. Clear all tokens for projects, groups, and the entire instance:
WARNING:
......@@ -1448,18 +1474,30 @@ You may need to reconfigure or restart GitLab for the changes to take effect.
1. Enter the database console:
For Omnibus GitLab packages:
For Omnibus GitLab 14.1 and earlier:
```shell
sudo gitlab-rails dbconsole
```
For installations from source:
For Omnibus GitLab 14.2 and later:
```shell
sudo gitlab-rails dbconsole --database main
```
For installations from source, GitLab 14.1 and earlier:
```shell
sudo -u git -H bundle exec rails dbconsole -e production
```
For installations from source, GitLab 14.2 and later:
```shell
sudo -u git -H bundle exec rails dbconsole -e production --database main
```
1. Clear all the tokens for pending jobs:
```sql
......@@ -1480,18 +1518,30 @@ The fix is to truncate the `web_hooks` table:
1. Enter the database console:
For Omnibus GitLab packages:
For Omnibus GitLab 14.1 and earlier:
```shell
sudo gitlab-rails dbconsole
```
For installations from source:
For Omnibus GitLab 14.2 and later:
```shell
sudo gitlab-rails dbconsole --database main
```
For installations from source, GitLab 14.1 and earlier:
```shell
sudo -u git -H bundle exec rails dbconsole -e production
```
For installations from source, GitLab 14.2 and later:
```shell
sudo -u git -H bundle exec rails dbconsole -e production --database main
```
1. Truncate the table:
```sql
......
......@@ -262,21 +262,36 @@ unable to add the `commit_message_regex_change` column.
This results in the [backport migration of EE tables](https://gitlab.com/gitlab-org/gitlab/-/blob/cf00e431024018ddd82158f8a9210f113d0f4dbc/db/migrate/20190402150158_backport_enterprise_schema.rb#L1619) not working correctly.
The backport migration assumes that certain tables in the database do not exist when running CE.
To fix this issue, manually add the missing `commit_message_negative_regex` column and restart GitLab:
To fix this issue:
```shell
# Access psql
sudo gitlab-rails dbconsole
1. Start a database console:
# Add the missing column
ALTER TABLE push_rules ADD COLUMN commit_message_negative_regex VARCHAR;
In GitLab 14.2 and later:
# Exit psql
\q
```shell
sudo gitlab-rails dbconsole --database main
```
# Restart GitLab
sudo gitlab-ctl restart
```
In GitLab 14.1 and earlier:
```shell
sudo gitlab-rails dbconsole
```
1. Manually add the missing `commit_message_negative_regex` column:
```sql
ALTER TABLE push_rules ADD COLUMN commit_message_negative_regex VARCHAR;
# Exit psql
\q
```
1. Restart GitLab:
```shell
sudo gitlab-ctl restart
```
### Error `Failed to connect to the internal GitLab API` on a separate GitLab Pages server
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment