Gitlab migration error after update docker container

After I update my docker image I get:

Recipe: gitlab::database_migrations

  • bash[migrate gitlab-rails database] action run
    [execute] rake aborted!
    PG::ConnectionBad: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket “/var/opt/gitlab/postgresql/.s.PGSQL.5432”?
    /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:48:in block (3 levels) in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:in load’
    /opt/gitlab/embedded/bin/bundle:23:in `’
    Tasks: TOP => gitlab:db:configure
    (See full trace by running task with --trace)

    ================================================================================
    Error executing action run on resource ‘bash[migrate gitlab-rails database]’

    Mixlib::ShellOut::ShellCommandFailed

    Expected process to exit with [0], but received ‘1’
    ---- Begin output of “bash” “/tmp/chef-script20200624-23-3qml3q” ----
    STDOUT: rake aborted!
    PG::ConnectionBad: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket “/var/opt/gitlab/postgresql/.s.PGSQL.5432”?
    /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:48:in block (3 levels) in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:in load’
    /opt/gitlab/embedded/bin/bundle:23:in `’
    Tasks: TOP => gitlab:db:configure
    (See full trace by running task with --trace)
    STDERR:
    ---- End output of “bash” “/tmp/chef-script20200624-23-3qml3q” ----
    Ran “bash” “/tmp/chef-script20200624-23-3qml3q” returned 1

    Resource Declaration:

    In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb

    55: bash “migrate gitlab-rails database” do
    56: code <<-EOH
    57: set -e
    58: log_file=“#{node[‘gitlab’][‘gitlab-rails’][‘log_directory’]}/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log”
    59: umask 077
    60: /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}
    61: STATUS=${PIPESTATUS[0]}
    62: chown #{account_helper.gitlab_user}:#{account_helper.gitlab_group} ${log_file}
    63: echo $STATUS > #{db_migrate_status_file}
    64: exit $STATUS
    65: EOH
    66: environment env_variables unless env_variables.empty?
    67: notifies :run, “execute[clear the gitlab-rails cache]”, :immediately
    68: dependent_services.each do |svc|
    69: notifies :restart, svc, :immediately
    70: end
    71: not_if “(test -f #{db_migrate_status_file}) && (cat #{db_migrate_status_file} | grep -Fx 0)”
    72: only_if { node[‘gitlab’][‘gitlab-rails’][‘auto_migrate’] }
    73: end

    Compiled Resource:

    Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb:55:in `from_file’

    bash(“migrate gitlab-rails database”) do
    action [:run]
    default_guard_interpreter :default
    command nil
    backup 5
    interpreter “bash”
    declared_type :bash
    cookbook_name “gitlab”
    recipe_name “database_migrations”
    code " set -e\n log_file="/var/log/gitlab/gitlab-rails/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log"\n umask 077\n /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}\n STATUS=${PIPESTATUS[0]}\n chown git:git ${log_file}\n echo $STATUS > /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-d62ee60b669\n exit $STATUS\n"
    domain nil
    user nil
    not_if “(test -f /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-d62ee60b669) && (cat /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-d62ee60b669 | grep -Fx 0)”
    only_if { #code block }
    end

    System Info:

    chef_version=14.14.29
    platform=ubuntu
    platform_version=16.04
    ruby=ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
    program_name=/opt/gitlab/embedded/bin/chef-client
    executable=/opt/gitlab/embedded/bin/chef-client

Running handlers:
There was an error running gitlab-ctl reconfigure:

bash[migrate gitlab-rails database] (gitlab::database_migrations line 55) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received ‘1’
---- Begin output of “bash” “/tmp/chef-script20200624-23-3qml3q” ----
STDOUT: rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/opt/gitlab/postgresql/.s.PGSQL.5432”?
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:48:in block (3 levels) in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:in load’
/opt/gitlab/embedded/bin/bundle:23:in `’
Tasks: TOP => gitlab:db:configure
(See full trace by running task with --trace)
STDERR:
---- End output of “bash” “/tmp/chef-script20200624-23-3qml3q” ----
Running handlers complete
Ran “bash” “/tmp/chef-script20200624-23-3qml3q” returned 1

Chef Client failed. 9 resources updated in 17 seconds
Thank you for using GitLab Docker Image!
Current version: gitlab-ce=13.1.0-ce.0

Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
And restart this container to reload settings.
To do it use docker exec:

docker exec -it gitlab vim /etc/gitlab/gitlab.rb
docker restart gitlab

For a comprehensive list of configuration options please see the Omnibus GitLab readme
README.md · master · GitLab.org / omnibus-gitlab · GitLab

If this container fails to start due to permission problems try to fix it by executing:

docker exec -it gitlab update-permissions
docker restart gitlab

What could be the problem?

Also I use:

gitlab_start() {
sudo docker run --detach
–hostname ***
–env GITLAB_OMNIBUS_CONFIG=“external_url ‘http://***/’; gitlab_rails[‘lfs_enabled’] = true; gitlab_rails[‘gitlab_shell_ssh_port’] = 2225”
–publish 445:443 --publish 85:80 --publish 2225:22
–name gitlab
–restart always
–volume /home/gitlab/data/gitlab/config:/etc/gitlab
–volume /home/gitlab/data/gitlab/logs:/var/log/gitlab
–volume /home/gitlab/data/gitlab/data:/var/opt/gitlab
gitlab/gitlab-ce:latest
}

To start container

I also get:

2020-06-24_09:28:56.61549 FATAL: database files are incompatible with server
2020-06-24_09:28:56.61550 DETAIL: The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.7.

in my /home/gitlab/data/gitlab/logs/postgresql