GitLab (6.6.5) Omnibus configuration for PostgreSQL - gitlab

ls -la /etc/gitlab/
-rwxrwxrwx 1 git git gitlab.rb
cat /etc/gitlab/gitlab.rb
# Disable the built-in Postgres
postgresql['enable'] = false
# Fill in the values for database.yml
gitlab_rails['db_adapter'] = 'postgresql'
gitlab_rails['db_encoding'] = 'unicode'
gitlab_rails['db_database'] = 'gitlab_db_name'
gitlab_rails['db_pool'] = 10
gitlab_rails['db_host'] = 'aws-RDShost.us-east-1.rds.amazonaws.com'
gitlab_rails['db_port'] = 5432
gitlab_rails['db_username'] = "gitlab_user"
gitlab_rails['db_password'] = 'mypass'
Now the problem is that 6.6.5 gitlab is not overwriting the database.rb file sitting at /var/opt/gitlab/gitlab-rails/etc/database.rb
Full error stack:
Compiling Cookbooks...
Recipe: gitlab::default
* directory[/etc/gitlab] action create
- change owner from 'git' to 'root'
- change group from 'git' to 'root'
[2015-04-16T20:32:04+00:00] WARN: Cloning resource attributes for directory[/var/opt/gitlab/gitlab-rails/etc] from prior resource (CHEF-3694)
[2015-04-16T20:32:04+00:00] WARN: Previous directory[/var/opt/gitlab/gitlab-rails/etc]: /opt/gitlab/embedded/cookbooks/gitlab/recipes/gitlab-rails.rb:36:in `block in from_file'
[2015-04-16T20:32:04+00:00] WARN: Current directory[/var/opt/gitlab/gitlab-rails/etc]: /opt/gitlab/embedded/cookbooks/gitlab/definitions/unicorn_config.rb:21:in `block in from_file'
[2015-04-16T20:32:04+00:00] WARN: Cloning resource attributes for service[unicorn] from prior resource (CHEF-3694)
[2015-04-16T20:32:04+00:00] WARN: Previous service[unicorn]: /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb:58:in `block in from_file'
[2015-04-16T20:32:04+00:00] WARN: Current service[unicorn]: /opt/gitlab/embedded/cookbooks/runit/definitions/runit_service.rb:173:in `block in from_file'
[2015-04-16T20:32:04+00:00] WARN: Cloning resource attributes for service[sidekiq] from prior resource (CHEF-3694)
[2015-04-16T20:32:04+00:00] WARN: Previous service[sidekiq]: /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb:58:in `block in from_file'
[2015-04-16T20:32:04+00:00] WARN: Current service[sidekiq]: /opt/gitlab/embedded/cookbooks/runit/definitions/runit_service.rb:173:in `block in from_file'
Recipe: gitlab::postgresql_disable
* link[/opt/gitlab/service/postgresql] action delete (up to date)
Recipe: gitlab::database_migrations
* execute[initialize database] action nothing (skipped due to action :nothing)
* execute[chown git:git /opt/gitlab/embedded/service/gitlab-rails/db/schema.rb] action run
- execute chown git:git /opt/gitlab/embedded/service/gitlab-rails/db/schema.rb
* execute[migrate database] action run
Error executing action `run` on resource 'execute[migrate database]'
Mixlib::ShellOut::ShellCommandFailed
Expected process to exit with [0], but received '1'
Begin output of /opt/gitlab/bin/gitlab-rake db:migrate
STDOUT:
STDERR: rake aborted!
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?

Related

Error in reactor loop escaped: closed stream (IOError)

I am trying to setup logstash in my system, below are the steps I followed
Downloaded the zip file logstash-7.12.0-windows-x86_64.zip from the official website Download Logstash free
Unzipped and executed this command bin/logstash.bat -f logstash-sample.conf --log.level debug
Logstash started the API successfully, but it got shutdown and showing the below error
Error in reactor loop escaped: closed stream (IOError)
logstash-sample.conf file
input { stdin { } }
output {
elasticsearch { hosts => ["localhost:9200"] }
stdout { codec => rubydebug }
}
see the log
[2022-07-21T10:10:24,558][INFO ][logstash.runner ] Logstash shut down.
[2022-07-21T10:10:24,576][DEBUG][logstash.agent ] Error in reactor loop escaped: closed stream (IOError)
[2022-07-21T10:10:24,579][DEBUG][logstash.agent ] 2022-07-21 10:10:24 +0530: Listen loop error: #<IOError: closed stream>
org/jruby/RubyIO.java:3552:in `select'
C:/Development_Avecto/dev_tools/logstash-7.12.0/vendor/bundle/jruby/2.5.0/gems/puma-4.3.7-java/lib/puma/server.rb:383:in `handle_servers'
C:/Development_Avecto/dev_tools/logstash-7.12.0/vendor/bundle/jruby/2.5.0/gems/puma-4.3.7-java/lib/puma/server.rb:356:in `block in run'
[2022-07-21T10:10:24,580][DEBUG][logstash.agent ] ["org/jruby/RubyIO.java:3067:in `read'", "org/jruby/RubyIO.java:3049:in `read'", "C:/Development_Avecto/dev_tools/logstash-7.12.0/vendor/bundle/jruby/2.5.0/gems/puma-4.3.7-java/lib/puma/reactor.rb:160:in `block in run_internal'", "org/jruby/ext/thread/Mutex.java:164:in `synchronize'", "C:/Development_Avecto/dev_tools/logstash-7.12.0/vendor/bundle/jruby/2.5.0/gems/puma-4.3.7-java/lib/puma/reactor.rb:159:in `block in run_internal'", "org/jruby/RubyArray.java:1809:in `each'", "C:/Development_Avecto/dev_tools/logstash-7.12.0/vendor/bundle/jruby/2.5.0/gems/puma-4.3.7-java/lib/puma/reactor.rb:157:in `run_internal'", "C:/Development_Avecto/dev_tools/logstash-7.12.0/vendor/bundle/jruby/2.5.0/gems/puma-4.3.7-java/lib/puma/reactor.rb:313:in `block in run_in_thread'"]
[2022-07-21T10:10:24,568][FATAL][org.logstash.Logstash ] Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby-complete-9.2.13.0.jar:?]
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby-complete-9.2.13.0.jar:?]
at C_3a_.Development_Avecto.dev_tools.logstash_minus_7_dot_12_dot_0.lib.bootstrap.environment.<main>(C:\Development_Avecto\dev_tools\logstash-7.12.0\lib\bootstrap\environment.rb:89) ~[?:?]
[2022-07-21T10:10:24,581][DEBUG][logstash.agent ] 2022-07-21 10:10:24 +0530: Listen loop error: #<IOError: closed stream>
org/jruby/RubyIO.java:3552:in `select'
C:/Development_Avecto/dev_tools/logstash-7.12.0/vendor/bundle/jruby/2.5.0/gems/puma-4.3.7-java/lib/puma/server.rb:383:in `handle_servers'
C:/Development_Avecto/dev_tools/logstash-7.12.0/vendor/bundle/jruby/2.5.0/gems/puma-4.3.7-java/lib/puma/server.rb:356:in `block in run'
[2022-07-21T10:10:24,584][DEBUG][logstash.agent ] 2022-07-21 10:10:24 +0530: Listen loop error: #<IOError: closed stream>
org/jruby/RubyIO.java:3552:in `select'
C:/Development_Avecto/dev_tools/logstash-7.12.0/vendor/bundle/jruby/2.5.0/gems/puma-4.3.7-java/lib/puma/server.rb:383:in `handle_servers'
C:/Development_Avecto/dev_tools/logstash-7.12.0/vendor/bundle/jruby/2.5.0/gems/puma-4.3.7-java/lib/puma/server.rb:356:in `block in run'
This error usually occurs when the conf file specified is not a valid file or path. Check the entire log to see if there is an error "No configuration found in the configured sources". If the file is under the logstash conf folder then execute the following command from the root folder in windows
bin\logstash -f config\logstash-sample.conf

GitLab upgrade from 9.5.10 to 10.8.7 unsuccessful

After installing the package for 10.8.7, which is the next supported upgrade path per https://docs.gitlab.com/ee/update/#upgrade-paths, gitlab-ctl reconfigure fails with:
================================================================================
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb
================================================================================
NoMethodError
-------------
undefined method `[]' for nil:NilClass
Cookbook Trace:
---------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/secrets_helper.rb:81:in `write_to_gitlab_secrets'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitlab.rb:186:in `generate_secrets'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitlab.rb:259:in `generate_config'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/config.rb:26:in `from_file'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:26:in `from_file'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb:20:in `from_file'
Relevant File Content:
----------------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/secrets_helper.rb:
74: },
75: 'registry' => {
76: 'http_secret' => Gitlab['registry']['http_secret'],
77: 'internal_certificate' => Gitlab['registry']['internal_certificate'],
78: 'internal_key' => Gitlab['registry']['internal_key']
79: },
80: 'letsencrypt' => {
81>> 'auto_enabled' => Gitlab['letsencrypt']['auto_enabled']
82: },
83: 'mattermost' => {
84: 'email_invite_salt' => Gitlab['mattermost']['email_invite_salt'],
85: 'file_public_link_salt' => Gitlab['mattermost']['file_public_link_salt'],
86: 'sql_at_rest_encrypt_key' => Gitlab['mattermost']['sql_at_rest_encrypt_key']
87: },
88: 'postgresql' => {
89: 'internal_certificate' => Gitlab['postgresql']['internal_certificate'],
90: 'internal_key' => Gitlab['postgresql']['internal_key']
Seeing the error, I attempted to add the following to /etc/gitlab/gitlab-secrets.json:
"letsencrypt": {
"auto_enabled": false
},
Now I see a warning along with the error:
Ignoring section letsencrypt in /etc/gitlab/gitlab-secrets.json, does not exist in gitlab.rb
So I added the following to /etc/gitlab/gitlab.rb:
letsencrypt['auto_enabled'] = false
But now I get a different error when running gitlab-ctl reconfigure:
*ERROR*: Encountered unsupported config key 'letsencrypt' in /etc/gitlab/gitlab.rb.
================================================================================
ERROR: Encountered unsupported config key 'letsencrypt' in /etc/gitlab/gitlab.rb.
================================================================================
================================================================================
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb
================================================================================
NoMethodError
-------------
undefined method `[]=' for nil:NilClass
Cookbook Trace:
---------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:100:in `block in from_file'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/config_mash.rb:28:in `auto_vivify'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:100:in `from_file'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitlab.rb:125:in `block in from_file'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/config_mash.rb:28:in `auto_vivify'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitlab.rb:125:in `from_file'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/config.rb:23:in `from_file'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:26:in `from_file'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb:20:in `from_file'
Relevant File Content:
----------------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:
93: def ee_attribute(name, **config)
94: config = { ee: true }.merge(config)
95: attribute(name, **config)
96: end
97:
98: def from_file(_file_path)
99: # Allow auto mash creation during from_file call
100>> Gitlab::ConfigMash.auto_vivify { super }
101: end
102:
103: def method_missing(method_name, *arguments) # rubocop:disable Style/MethodMissing
104: # Give better message for NilClass errors
105: # If there are no arguments passed, this is a 'GET' call, and if
106: # there is no matching key in the configuration, then it has not been set (not even to nil)
107: # and we will output a nicer error above the exception
108: if arguments.length.zero? && !configuration.key?(method_name)
109: breaktxt = '=' * 80
Additionally, I get the following errors if I try to run gitlab-rake cache:clear:
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/elastic.rake:61: warning: already initialized constant INDEXABLE_CLASSES
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/tasks/gitlab/elastic.rake:61: warning: previous definition of INDEXABLE_CLASSES was here
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab.rb:31: warning: already initialized constant Gitlab::VERSION
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/2_app.rb:6: warning: previous definition of VERSION was here
WARNING: Unable to check/update clone_url_prefix for Geo: undefined method `connected?' for Gitlab::Geo:Module
Did you mean? concern
rake aborted!
NameError: uninitialized constant API::Entities::ProjectPushRule
/opt/gitlab/embedded/service/gitlab-rails/lib/api/project_push_rule.rb:28:in `block (2 levels) in <class:ProjectPushRule>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/project_push_rule.rb:27:in `block in <class:ProjectPushRule>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/project_push_rule.rb:10:in `<class:ProjectPushRule>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/project_push_rule.rb:2:in `<module:API>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/project_push_rule.rb:1:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/v3/project_git_hook.rb:23:in `block (2 levels) in <class:ProjectGitHook>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/v3/project_git_hook.rb:22:in `block in <class:ProjectGitHook>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/v3/project_git_hook.rb:13:in `<class:ProjectGitHook>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/v3/project_git_hook.rb:3:in `<module:V3>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/v3/project_git_hook.rb:2:in `<module:API>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/v3/project_git_hook.rb:1:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/api.rb:66:in `block in <class:API>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/api.rb:25:in `<class:API>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/api.rb:2:in `<module:API>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/api.rb:1:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/rack_attack.rb:12:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:11:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => cache:clear => cache:clear:redis => environment
(See full trace by running task with --trace)
In my case, I was able to successfully upgrade to 10.8.7 by selecting an arbitrary intermediate version (in my case, 10.5.8). Not sure why directly upgrading as per the upgrade path did not work. I will continue my journey to GitLab 14 now!

Installing TMUX in Microsoft Windows Server 2016 Standard Edition and issues with MSYS2

I have a Microsoft Windows Server 2016 Standard Edition VM in which I need to schedule a job which should run every 3 or 5 minutes. This job actually will check for the files in Windows server location Source: ex: D:\Feeds and move the files to Linux Server Destination: /data/feeds/
I have installed the Git bash and scheduled a bash script to run as loop which does the job, but it's getting failed in between with the below error
0 [main] sh 54094 dofork: child -1 - CreateProcessW failed for 'C:\Program Files\Git\usr\bin\sh.exe', errno 13
feed.sh: fork: Permission denied
feed.sh: line 6: /usr/bin/ls: Permission denied
I have to again the start the feed.sh script to move the files from Source (Windows server) to Destination (Linux SFTP server).
In order to fix this, I tried installing TMUX to schedule the script in tmux, for which I tried installing MSYS2 packages, I have installed the same but still vi, sftp commands are not working. I have tried updating the packages but getting the below timeout error.
# pacman -S git
resolving dependencies...
looking for conflicting packages...
Packages (31) expat-2.2.9-1 heimdal-7.7.0-1 openssh-8.3p1-1 perl-Authen-SASL-2.16-2 perl-Convert-BinHex-1.125-1 perl-Encode-Locale-1.05-1 perl-Error-0.17029-1
perl-File-Listing-6.04-2 perl-HTML-Parser-3.72-4 perl-HTML-Tagset-3.20-2 perl-HTTP-Cookies-6.08-1 perl-HTTP-Daemon-6.10-1 perl-HTTP-Date-6.05-1
perl-HTTP-Message-6.25-1 perl-HTTP-Negotiate-6.01-2 perl-IO-Socket-SSL-2.068-1 perl-IO-Stringy-2.113-1 perl-LWP-MediaTypes-6.04-1 perl-MIME-tools-5.509-1
perl-MailTools-2.21-1 perl-Net-HTTP-6.19-1 perl-Net-SMTP-SSL-1.04-1 perl-Net-SSLeay-1.88-1 perl-TermReadKey-2.38-1 perl-TimeDate-2.33-1 perl-Try-Tiny-0.30-1
perl-URI-1.76-1 perl-WWW-RobotRules-6.02-2 perl-libwww-6.46-1 vim-8.2.0869-1 git-2.27.0-1
Total Download Size: 16.68 MiB
Total Installed Size: 94.47 MiB
:: Proceed with installation? [Y/n] y
:: Retrieving packages...
error: failed retrieving file 'expat-2.2.9-1-x86_64.pkg.tar.xz' from repo.msys2.org : Connection timed out after 10016 milliseconds
error: failed retrieving file 'expat-2.2.9-1-x86_64.pkg.tar.xz' from sourceforge.net : Connection timed out after 10002 milliseconds
Debug output:
# pacman -Syuv --debug
debug: pacman v5.2.1 - libalpm v12.0.1
debug: config: attempting to read file /etc/pacman.conf
debug: config: new section 'options'
debug: config: HoldPkg: pacman
debug: config: arch: x86_64
debug: config: SigLevel: Required
debug: config: SigLevel: DatabaseOptional
debug: config: LocalFileSigLevel: Optional
debug: config: new section 'mingw32'
debug: config file /etc/pacman.conf, line 72: including /etc/pacman.d/mirrorlist.mingw32
debug: config: new section 'mingw64'
debug: config file /etc/pacman.conf, line 75: including /etc/pacman.d/mirrorlist.mingw64
debug: config: new section 'msys'
debug: config file /etc/pacman.conf, line 78: including /etc/pacman.d/mirrorlist.msys
debug: config: finished parsing /etc/pacman.conf
debug: setup_libalpm called
debug: option 'logfile' = /var/log/pacman.log
debug: option 'gpgdir' = /etc/pacman.d/gnupg/
debug: option 'hookdir' = /etc/pacman.d/hooks/
debug: option 'cachedir' = /var/cache/pacman/pkg/
debug: registering sync database 'mingw32'
debug: database path for tree mingw32 set to /var/lib/pacman/sync/mingw32.db
debug: GPGME version: 1.13.1-unknown
debug: GPGME engine info: file=/usr/bin/gpg, home=/etc/pacman.d/gnupg/
debug: checking signature for /var/lib/pacman/sync/mingw32.db
debug: 1 signatures returned
debug: fingerprint: AD351C50AE085775EB59333B5F92EFC1A47D45A1
debug: summary: valid
debug: summary: green
debug: status: Success
debug: timestamp: 1593429151
debug: exp_timestamp: 0
debug: validity: full; reason: Success
debug: key: AD351C50AE085775EB59333B5F92EFC1A47D45A1, Alexey Pavlov (Alexpux) <alexpux#gmail.com>, owner_trust unknown, disabled 0
debug: signature is valid
debug: signature is fully trusted
debug: setting usage of 15 for mingw32 repository
debug: adding new server URL to database 'mingw32': http://repo.msys2.org/mingw/i686
debug: adding new server URL to database 'mingw32': https://sourceforge.net/projects/msys2/files/REPOS/MINGW/i686
debug: registering sync database 'mingw64'
debug: database path for tree mingw64 set to /var/lib/pacman/sync/mingw64.db
debug: checking signature for /var/lib/pacman/sync/mingw64.db
debug: 1 signatures returned
debug: fingerprint: AD351C50AE085775EB59333B5F92EFC1A47D45A1
debug: summary: valid
debug: summary: green
debug: status: Success
debug: timestamp: 1593425462
debug: exp_timestamp: 0
debug: validity: full; reason: Success
debug: key: AD351C50AE085775EB59333B5F92EFC1A47D45A1, Alexey Pavlov (Alexpux) <alexpux#gmail.com>, owner_trust unknown, disabled 0
debug: signature is valid
debug: signature is fully trusted
debug: setting usage of 15 for mingw64 repository
debug: adding new server URL to database 'mingw64': http://repo.msys2.org/mingw/x86_64
debug: adding new server URL to database 'mingw64': https://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64
Root : /
Conf File : /etc/pacman.conf
DB Path : /var/lib/pacman/
Cache Dirs: /var/cache/pacman/pkg/
Hook Dirs : /usr/share/libalpm/hooks/ /etc/pacman.d/hooks/
Lock File : /var/lib/pacman/db.lck
Log File : /var/log/pacman.log
GPG Dir : /etc/pacman.d/gnupg/
Targets : None
:: Synchronizing package databases...
debug: url: http://repo.msys2.org/mingw/i686/mingw32.db
debug: maxsize: 26214400
debug: using time condition: 1593429151
debug: opened tempfile for download: /var/lib/pacman/sync/mingw32.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'mingw32.db' from repo.msys2.org : Connection timed out after 10018 milliseconds
debug: url: https://sourceforge.net/projects/msys2/files/REPOS/MINGW/i686/mingw32.db
debug: maxsize: 26214400
debug: using time condition: 1593429151
debug: opened tempfile for download: /var/lib/pacman/sync/mingw32.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'mingw32.db' from sourceforge.net : Connection timed out after 10000 milliseconds
Is there any other way to schedule the bash script in powershell?

Gitlab Enterprise Edition HTTPS

I'm setting up gitlab-ee with out a liscense. I want to to have https but its giving me this error
Recipe: letsencrypt::http_authorization
* letsencrypt_certificate[gitlab.example.com] action create
* acme_certificate[staging] action create
* file[gitlab.example.com SSL key] action create_if_missing (up to date)
================================================================================
Error executing action `create` on resource 'acme_certificate[staging]'
================================================================================
Acme::Client::Error::Malformed
------------------------------
Method not allowed
Cookbook Trace:
---------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/acme/resources/certificate.rb:77:in `block in class_from_file'
Resource Declaration:
---------------------
suppressed sensitive resource output
Compiled Resource:
------------------
suppressed sensitive resource output
System Info:
------------
chef_version=14.13.11
platform=ubuntu
platform_version=18.04
ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client
================================================================================
Error executing action `create` on resource 'letsencrypt_certificate[gitlab.example.com]'
================================================================================
Acme::Client::Error::Malformed
------------------------------
acme_certificate[staging] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/resources/certificate.rb line 25) had an error: Acme::Client::Error::Malformed: Method not allowed
Cookbook Trace:
---------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/acme/resources/certificate.rb:77:in `block in class_from_file'
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/recipes/http_authorization.rb
5: letsencrypt_certificate site do
6: crt node['gitlab']['nginx']['ssl_certificate']
7: key node['gitlab']['nginx']['ssl_certificate_key']
8: notifies :run, "execute[reload nginx]", :immediate
9: notifies :run, 'ruby_block[display_le_message]'
10: only_if { omnibus_helper.service_up?('nginx') }
11: end
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/recipes/http_authorization.rb:5:in `from_file'
letsencrypt_certificate("gitlab.example.com") do
action [:create]
default_guard_interpreter :default
declared_type :letsencrypt_certificate
cookbook_name "letsencrypt"
recipe_name "http_authorization"
crt "/etc/gitlab/ssl/gitlab.example.com.crt"
key "/etc/gitlab/ssl/gitlab.example.com.key"
alt_names []
cn "gitlab.example.com"
only_if { #code block }
end
System Info:
------------
chef_version=14.13.11
platform=ubuntu
platform_version=18.04
ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [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:
letsencrypt_certificate[gitlab.example.com] (letsencrypt::http_authorization line 5) had an error: Acme::Client::Error::Malformed: acme_certificate[staging] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/resources/certificate.rb line 25) had an error: Acme::Client::Error::Malformed: Method not allowed
I dont see why its making it fail the creation of certifications. Its creating them and storing them in /etc/gitlab/sslanyone able to help?
Just for posterity, to complete #Rafael Pardini's answer, the mentioned solution boils down to simply commenting the acme_certificate 'staging' block (from do to end) inside the /opt/gitlab/embedded/cookbooks/letsencrypt/resources/certificate.rb file.

Internal Server Error 500 while accessing $GITLAB/admin/runners

I have restored Gitlab from a backup, now every time I try to access the runners webpage, I get a Internal Server error.
I have tried uninstalling all configured gitlab-runners and accessing it, the problem persists. Here is a trace from the gitlab-rails/production.log:
Started GET "/admin/runners" for 127.0.0.1 at 2019-01-16 07:17:12 -0500
Processing by Admin::RunnersController#index as HTML
Completed 500 Internal Server Error in 66ms (ActiveRecord: 5.7ms)
ActionView::Template::Error ():
37:
38: .col-sm-6
39: .bs-callout
40: = render partial: 'ci/runner/how_to_setup_runner',
41: locals: { registration_token: Gitlab::CurrentSettings.runners_registration_token,
42: type: 'shared',
43: reset_token_url: reset_registration_token_admin_application_settings_path }
lib/gitlab/crypto_helper.rb:27:in `aes256_gcm_decrypt'
app/models/concerns/token_authenticatable_strategies/encrypted.rb:55:in `get_token'
app/models/concerns/token_authenticatable_strategies/base.rb:33:in `ensure_token!'
app/models/concerns/token_authenticatable.rb:43:in `block in add_authentication_token_field'
app/models/application_setting.rb:409:in `runners_registration_token'
lib/gitlab/current_settings.rb:19:in `method_missing'
app/views/admin/runners/index.html.haml:40:in `_app_views_admin_runners_index_html_haml___977288809002382166_69944849285200'
app/controllers/application_controller.rb:116:in `render'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:420:in `set_locale'
lib/gitlab/middleware/multipart.rb:103:in `call'
lib/gitlab/request_profiler/middleware.rb:16:in `call'
lib/gitlab/middleware/go.rb:19:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/correlation_id.rb:16:in `block in call'
lib/gitlab/correlation_id.rb:15:in `use_id'
lib/gitlab/middleware/correlation_id.rb:15:in `call'
lib/gitlab/middleware/read_only/controller.rb:40:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/request_context.rb:20:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:29:in `call'
lib/gitlab/middleware/release_env.rb:13:in `call'
Started GET "/-/metrics" for 127.0.0.1 at 2019-01-16 07:17:24 -0500
Processing by MetricsController#index as HTML
Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
I could resolve the issue by following official gitlab documentation:
gitlab-rails dbconsole
-- Clear project tokens
UPDATE projects SET runners_token = null, runners_token_encrypted = null;
-- Clear group tokens
UPDATE namespaces SET runners_token = null, runners_token_encrypted = null;
-- Clear instance tokens
UPDATE application_settings SET runners_registration_token_encrypted = null;
-- Clear runner tokens
UPDATE ci_runners SET token = null, token_encrypted = null;
https://docs.gitlab.com/ee/raketasks/backup_restore.html#reset-runner-registration-tokens
Edit:
After clearing existing pipeline jobs (see above), I could still not open the ci settings page for some migrated projects where I had set environment variables. In this case try to remove them:
gitlab-rails dbconsole
SELECT * FROM ci_variables;
DELETE FROM ci_variables WHERE project_id='XX';
Hope that helps.
You did a restore, but probably did not restore the secrets store (/etc/gitlab/gitlab-secrets.json or $GITLAB_HOME/config/secrets.json). Same issue as gitlab 500 errors in the admin area
You can reset it like this from the rails console on the gitlab server:
root#gitlab:/# gitlab-rails console
-------------------------------------------------------------------------------------
GitLab: 11.5.1 (c90ae59)
GitLab Shell: 8.4.1
postgresql: 9.6.8
-------------------------------------------------------------------------------------
Both Deployment and its :status machine have defined a different default for "status". Use only one or the other for defining defaults to avoid unexpected behaviors.
Loading production environment (Rails 4.2.10)
irb(main):001:0> ApplicationSetting.current.reset_runners_registration_token!
=> true
i've solved this,maybe it is usefal
a. Reset CI/CD variables
gitlab-rails dbconsole
SELECT * FROM public."ci_group_variables";
SELECT * FROM public."ci_variables";
DELETE FROM ci_group_variables;
DELETE FROM ci_variables;
b. Reset runner registration tokens
gitlab-rails dbconsole
-- Clear project tokens
UPDATE projects SET runners_token = null, runners_token_encrypted = null;
-- Clear group tokens
UPDATE namespaces SET runners_token = null, runners_token_encrypted = null;
-- Clear instance tokens
UPDATE application_settings SET runners_registration_token_encrypted = null;
UPDATE application_settings SET encrypted_ci_jwt_signing_key = null;
-- Clear runner tokens
UPDATE ci_runners SET token = null, token_encrypted = null;
c. Reset pending pipeline jobs
sudo gitlab-rails dbconsole
-- Clear build tokens
UPDATE ci_builds SET token = null, token_encrypted = null;
d. Fix project integrations
gitlab-rails dbconsole
-- truncate web_hooks table
TRUNCATE web_hooks CASCADE;
from gitlab

Resources