Gitlab standalone installation failed - gitlab

I'm using
Ubuntu 18.04 server
Trying to install Gitlab standalone using this blog and official one too
I am getting the below error:-
Running handlers:
There was an error running gitlab-ctl reconfigure:
bash[migrate gitlab-rails database] (gitlab::database_migrations line 49) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20180927-7185-157g8fm" ----
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:51:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:db:configure
(See full trace by running task with --trace)
STDERR:
---- End output of "bash" "/tmp/chef-script20180927-7185-157g8fm" ----
Ran "bash" "/tmp/chef-script20180927-7185-157g8fm" returned 1
Running handlers complete
Chef Client failed. 4 resources updated in 01 minutes 21 seconds
I thought I was messing up with the URL.
$grep "external" /etc/gitlab/gitlab.rb | head -n 3
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
external_url 'http://192.168.4.215'
I tried varius options for external_url like
IP address
domain name
Let me know what is going wrong.

I had the same problem and found a workaround here:
gitlab.com/gitlab-org/omnibus-gitlab/issues/3744
Doing the following steps solved the problem:
sudo systemctl disable gitlab-runsvdir
sudo systemctl enable gitlab-runsvdir
sudo gitlab-ctl restart

Related

Database migration issue in gitlab after upgrading gitlab

Recently i have upgraded gitlab after which few database migrations are not yet migrated and are showing status as down.
We have tried sudo gitlab-rake db:migrate but still some migration are failing.
== 20200213224220 AddSprints: migrating =======================================
-- create_table(:sprints, {:id=>:bigserial})
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::ReadOnlySqlTransaction: ERROR: cannot execute CREATE TABLE in a read-only transaction
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20200213224220_add_sprints.rb:7:in `change'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Caused by:
ActiveRecord::StatementInvalid: PG::ReadOnlySqlTransaction: ERROR: cannot execute CREATE TABLE in a read-only transaction
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20200213224220_add_sprints.rb:7:in `change'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
try
sudo touch /opt/gitlab/embedded/service/gitlab-rails/db/migrate/*
or
sudo chmod -R 777 /opt/gitlab/embedded/service/gitlab-rails/
and run migration again.

How to fix Gitlab CE 14.1.6 upgrade failed

I wanted to update my GitLab CE installed on a EC2 instance following the recommendation. I went from 13.0.x to 13.9.2 -> 13.12.12 -> 14.0.11 -> 14.1.6 as the documentation recommend.
Every time I check if the server was responding. I just had to restart the process when I jump to 14.X.
But when I went to 14.1.6 I got an error on the update :
[...]
System Info:
------------
chef_version=15.17.4
platform=ubuntu
platform_version=20.04
ruby=ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client
Recipe: gitlab::gitlab-rails
* execute[clear the gitlab-rails cache] action run
- execute /opt/gitlab/bin/gitlab-rake cache:clear
Recipe: gitaly::enable
* runit_service[gitaly] action restart (up to date)
* runit_service[gitaly] action hup
- send hup to runit_service[gitaly]
Running handlers:
There was an error running gitlab-ctl reconfigure:
rails_migration[gitlab-rails] (gitlab::database_migrations line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: bash[migrate gitlab-rails database] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/resources/rails_migration.rb line 16) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20211028-68712-eysjor" ----
STDOUT: rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active': {:job_class_name=>"CopyColumnUsingBackgroundMigrationJob", :table_name=>"events", :column_name=>"id", :job_arguments=>[["id"], ["id_convert_to_bigint"]]}
Finalize it manualy by running
sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,events,id,'[["id"]\, ["id_convert_to_bigint"]]']
For more information, check the documentation
https://docs.gitlab.com/ee/user/admin_area/monitoring/background_migrations.html#database-migrations-failing-because-of-batched-background-migration-not-finished
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:1109:in `ensure_batched_background_migration_is_finished'
/opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20210622045705_finalize_events_bigint_conversion.rb:11:in `up'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:31:in `ddl_transaction'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:61:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Caused by:
Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active': {:job_class_name=>"CopyColumnUsingBackgroundMigrationJob", :table_name=>"events", :column_name=>"id", :job_arguments=>[["id"], ["id_convert_to_bigint"]]}
Finalize it manualy by running
sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,events,id,'[["id"]\, ["id_convert_to_bigint"]]']
For more information, check the documentation
https://docs.gitlab.com/ee/user/admin_area/monitoring/background_migrations.html#database-migrations-failing-because-of-batched-background-migration-not-finished
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:1109:in `ensure_batched_background_migration_is_finished'
/opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20210622045705_finalize_events_bigint_conversion.rb:11:in `up'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:31:in `ddl_transaction'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:61:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
== 20210611082822 AddPagesFileEntriesToPlanLimits: migrating ==================
-- add_column(:plan_limits, :pages_file_entries, :integer, {:default=>200000, :null=>false})
-> 0.0021s
== 20210611082822 AddPagesFileEntriesToPlanLimits: migrated (0.0022s) =========
== 20210622045705 FinalizeEventsBigintConversion: migrating ===================
STDERR:
---- End output of "bash" "/tmp/chef-script20211028-68712-eysjor" ----
Ran "bash" "/tmp/chef-script20211028-68712-eysjor" returned 1
Running handlers complete
Chef Infra Client failed. 27 resources updated in 51 seconds
===
There was an error running gitlab-ctl reconfigure. Please check the output above for more
details.
===
dpkg: error processing package gitlab-ce (--configure):
installed gitlab-ce package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
gitlab-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)
So as the output told me I tried :
sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,events,id,'[["id"]\, ["id_convert_to_bigint"]]']
and got
rake aborted!
JSON::ParserError: unexpected character () at line 1, column 1 [parse.c:714]
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/json.rb:87:in `rescue in adapter_load'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/json.rb:82:in `adapter_load'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/json.rb:25:in `parse'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/background_migrations.rake:17:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Caused by:
Oj::ParseError: unexpected character () at line 1, column 1 [parse.c:714]
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/json.rb:85:in `load'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/json.rb:85:in `adapter_load'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/json.rb:25:in `parse'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/background_migrations.rake:17:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:background_migrations:finalize
(See full trace by running task with --trace)
Any idea ?
After upgrading from 13 to 14.0 gitlab will commence several database migrations in the background (see yourgitlabserver.example.com/admin/background_migrations).
You have to wait for these to complete before advancing any further.
If you already did, there are several ways to fix this (see documentation).
I had the same error in this situation. To find out what's going on I've added following code into the
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/background_migrations.rake:17
puts "JSON: '#{args[:job_arguments]}'"
to have the code looks like this:
puts "JSON: '#{args[:job_arguments]}'"
Gitlab::Database::BackgroundMigration::BatchedMigrationRunner.finalize(
args[:job_class_name],
args[:table_name],
args[:column_name],
Gitlab::Json.parse(args[:job_arguments])
)
And I noticed that command args[:job_arguments] returns invalid JSON string.
So finally for me (zsh) worked to execute the following command:
sudo gitlab-rake 'gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,events,id,[["id"]\, ["id_convert_to_bigint"]]]'
The difference is in single quotes.

cron.yaml key not found "cron" upon deployment of simple hello world app

I am trying to deploy an elasticbeanstalk worker environement for my laravel application using the eb cli bit facing same issue as this question (apologies I was not able to upvote or comment).
I followed step by step instructions to use the laravel-aws-dusterio package. Upon creating a new worker environment (eb create -t worker), I run into this deployment error:
2020-07-12 12:36:31 ERROR [Instance: i-xxxxxxx] Command failed on instance. An unexpected error has occurred [ErrorCode: 0000000001].
2020-07-12 12:36:31 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-07-12 12:37:34 ERROR Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.
Upon checking the logs I found the following:
init: initializing aws-sqsd 3.0.1 (2020-03-30)
init: Failed of parsing file 'cron.yaml', because: key not found: "cron" (AWS::EB::SQSD::ScheduleParser::ScheduleFileError)
at /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/lib/aws-sqsd/schedule_parser.rb:99:in `rescue in v1_parser'
...
caused by: key not found: "cron" (KeyError)
The cron.yaml file is place into the main/root folder of the project and is the following:
version: 1
cron:
- name: "schedule"
url: "/worker/schedule"
schedule: "* * * * *"
If I remove the cron.yaml the deployment is successful, however the worker will not receive the jobs posted from the sqs daemon. The web application is working correctly being able to queue jobs.
I can ssh into the ec2 instance but not sure what I could do to troubleshoot.
I am really struggling to fix this issue. Thanks for your help.
EDIT
Trying to isolate the problem, I created a simple hello world application with a cron.yaml file as well.
This is the content of index.php
index.php
<?php echo("hello world"); ?>
This is the content of cron.yaml
version: 1
cron:
- name: "schedule"
url: "/worker/schedule"
schedule: "* * * * *"
Step1: deploy application
eb create testworker-dev
the application is create successfully
eb create -t worker
the application is deployed but get same error as before parsing the cron.yaml
init: initializing aws-sqsd 3.0.1 (2020-03-30)
2020-07-12T23:34:04Z init: Failed of parsing file 'cron.yaml', because: key not found: "cron" (AWS::EB::SQSD::ScheduleParser::ScheduleFileError)
at /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/lib/aws-sqsd/schedule_parser.rb:99:in `rescue in v1_parser'
...
caused by: key not found: "cron" (KeyError)
at /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/lib/aws-sqsd/schedule_parser.rb:82:in `fetch'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/lib/aws-sqsd/schedule_parser.rb:82:in `v1_parser'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/lib/aws-sqsd/schedule_parser.rb:59:in `load_schedule'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/lib/aws-sqsd/schedule_parser.rb:131:in `load_schedule'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/lib/aws-sqsd/cron.rb:26:in `initialize'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/lib/aws-sqsd/daemon.rb:47:in `new'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/lib/aws-sqsd/daemon.rb:47:in `initialize'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/bin/aws-sqsd:34:in `new'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/bin/aws-sqsd:34:in `start'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/bin/aws-sqsd:83:in `launch'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.6.0/gems/aws-sqsd-3.0.1/bin/aws-sqsd:111:in `<top (required)>'
from /opt/elasticbeanstalk/lib/ruby/bin/aws-sqsd:23:in `load'
from /opt/elasticbeanstalk/lib/ruby/bin/aws-sqsd:23:in `<main>'
So the issue appear to be not in the application code itself. The aws-sqs is throwing an error when parsing the cron.yaml.

Rails: Permission denied - bind(2) for "127.0.0.1" port 3000 (Errno::EACCES)

I follow a tutorial on how to get started with rails, but end up with different outcome than the video. Here is the message I get back when using the command rails s:
C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `initialize': Permission denied - bind(2) for "127.0.0.1" port 3000 (Errno::EACCES)
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `new'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `add_tcp_listener'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:263:in `block in add_tcp_listener'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:262:in `each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:262:in `add_tcp_listener'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:105:in `block in parse'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:88:in `each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:88:in `parse'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/runner.rb:144:in `load_and_bind'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/single.rb:87:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/launcher.rb:172:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/rack/handler/puma.rb:64:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:296:in `start'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/server.rb:79:in `start'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
EDIT:
I am on Windows, and have tried running the command prompt as admin. Same result.
EDIT SOLVED:
technet.microsoft.com/en-us/library/ms345310(v=sql.100).aspx and restart your pc - Chetan Mehta
For ubuntu :
Try running sudo rails s
Make sure you have sudo permissions
If the port is busy, you can try running server on a different port. i.e.:
rails s -p 3001
If you are using window then instead of sudo try running your command prompt as administrator

Accessing jenkins JAR upon startup

I am building a cookbook in Chef to create an automated service in Jenkins. I am installing the latest Jenkins LTS on CentOS, but I am constantly being denied access to the jarfile. Does anyone have a solution to override this?
Here is my output:
* remote_file[/var/lib/jenkins/plugins/jenkins-cli.jar] action create[2016-07-31T16:35:43+00:00] ERROR: Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, retry 1/5
[2016-07-31T16:35:48+00:00] ERROR: Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, retry 2/5
[2016-07-31T16:35:53+00:00] ERROR: Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, retry 3/5
[2016-07-31T16:35:58+00:00] ERROR: Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, retry 4/5
[2016-07-31T16:36:03+00:00] ERROR: Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, retry 5/5
[2016-07-31T16:36:08+00:00] WARN: remote_file[/var/lib/jenkins/plugins/jenkins-cli.jar] cannot be downloaded from http://localhost:8080/jnlpJars/jenkins-cli.jar: Connection refused - Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, giving up
================================================================================
Error executing action `create` on resource 'remote_file[/var/lib/jenkins/plugins/jenkins-cli.jar]'
================================================================================
Errno::ECONNREFUSED
-------------------
Connection refused - Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, giving up
Cookbook Trace:
---------------
/tmp/kitchen/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:41:in `run_action'
Resource Declaration:
---------------------
# In /tmp/kitchen/cache/cookbooks/fanatics_pipeline/recipes/jenkins_plugins.rb
44: remote_file "#{node['plugins_dir']}/jenkins-cli.jar" do
45: source node['cli_jar']
46: action :create
47: mode '0755'
48: notifies :restart, "service[#{node['repo']['name']}]", :delayed
49: end
50: end
Compiled Resource:
------------------
# Declared in /tmp/kitchen/cache/cookbooks/fanatics_pipeline/recipes/jenkins_plugins.rb:44:in `block in from_file'
remote_file("/var/lib/jenkins/plugins/jenkins-cli.jar") do
provider Chef::Provider::RemoteFile
action [:create]
retries 0
retry_delay 2
default_guard_interpreter :default
source ["http://localhost:8080/jnlpJars/jenkins-cli.jar"]
use_etag true
use_last_modified true
declared_type :remote_file
cookbook_name "fanatics_pipeline"
recipe_name "jenkins_plugins"
mode "0755"
atomic_update true
path "/var/lib/jenkins/plugins/jenkins-cli.jar"
end
Platform:
---------
x86_64-linux
Recipe: fanatics_pipeline::jenkins_install
* service[jenkins] action restart
- restart service service[jenkins]
* service[jenkins] action reload
- reload service service[jenkins]
Running handlers:
[2016-07-31T16:36:15+00:00] ERROR: Running exception handlers
Running handlers complete
[2016-07-31T16:36:15+00:00] ERROR: Exception handlers complete
Chef Client failed. 24 resources updated in 04 minutes 10 seconds
[2016-07-31T16:36:15+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2016-07-31T16:36:15+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-07-31T16:36:15+00:00] ERROR: remote_file[/var/lib/jenkins/plugins/jenkins-cli.jar] (fanatics_pipeline::jenkins_plugins line 44) had an error: Errno::ECONNREFUSED: Connection refused - Connection refused connecting to http://localhost:8080/jnlpJars/jenkins-cli.jar, giving up
[2016-07-31T16:36:17+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Assuming that Jenkins takes just a bit longer to start, you could increase the number of retries that Chef undertakes to retrieve the file:
remote_file "#{node['plugins_dir']}/jenkins-cli.jar" do
source node['cli_jar']
retries 60
action :create
mode '0755'
notifies :restart, "service[#{node['repo']['name']}]", :delayed
end
This will try for 60 times.
You need to make sure Jenkins is started before trying to download the JAR. Also make sure there isn't a firewall or something else blocking the port.

Resources