Failed GitLab project clone from git-lfs unidentified developer security issues during fresh install
Overview
After installing git/git-lfs from brew for macOS(brew install git git-lfs) like the GDK docs mention: If you try a fresh install of the GDK and haven't run git-lfs before, macOS will fail to run it because the binary is from an unidentified developer. I didn't have an option to run anyway and had to go to System preferences -> Security & Privacy -> Allow git-lfs.
macOS cannot verify the developer of “git-lfs”. Are you sure you want to open it?
But when I tried to resume the install, I ran into a separate error because it didn't clone the gitlab-org/gitlab project completely. The clone failed because of the git-lfs security issue.
LoadError: cannot load such file -- /Users/eric/Documents/gitlab/gdk/gitlab/spec/support/helpers/repo_helpers
Took me a bit to figure out what happened but I fixed this by going into gdk/gitlab, then running git reset --hard origin/master. After I could run the install again and get to the next step.
For reference, I didn't notice the note after the first install failed because I just tried to allow git-lfs and retry the install command which pushed this way above the fold in the scroll.
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
Install attempt 1
This run gets stuck when macOS doesn't want to run the unidentified developer git-lfs binary.
$ gdk install gitlab_repo=git@gitlab.com:gitlab-org/gitlab.git shallow_clone=true
Cloning into 'gitlab'...
fatal: the remote end hung up unexpectedly
error: git-lfs filter-process died of signal 9
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
make: *** [gitlab/.git] Error 128
(❌) Error: Failed to install.
-------------------------------------------------------
You can try the following that may be of assistance:
- Run 'gdk doctor'.
- Visit the troubleshooting documentation:
https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/master/doc/troubleshooting.md.
- Visit https://gitlab.com/gitlab-org/gitlab-development-kit/-/issues to
see if there are known issues.
-------------------------------------------------------
Install attempt 2: Trying to resume the install
Errors because it didn't clone the gitlab-org/gitlab project completely. The clone failed because of the git-lfs security issue.
$ gdk install gitlab_repo=git@gitlab.com:gitlab-org/gitlab.git shallow_clone=true
------------------------------------------------------------
Generating gitlab-org/gitlab Rails translations
------------------------------------------------------------
WARNING: This version of GitLab depends on gitlab-shell 13.4.0, but you're running Unknown. Please update gitlab-shell.
rake aborted!
LoadError: cannot load such file -- /Users/eric/Documents/gitlab/gdk/gitlab/spec/support/helpers/repo_helpers
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:49:in `require_relative'
/Users/eric/Documents/gitlab/gdk/gitlab/spec/factories/commits.rb:3:in `<main>'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:318:in `block in load'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:318:in `load'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/factory_bot-5.1.0/lib/factory_bot/find_definitions.rb:20:in `block (2 levels) in find_definitions'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/factory_bot-5.1.0/lib/factory_bot/find_definitions.rb:19:in `each'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/factory_bot-5.1.0/lib/factory_bot/find_definitions.rb:19:in `block in find_definitions'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/factory_bot-5.1.0/lib/factory_bot/find_definitions.rb:15:in `each'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/factory_bot-5.1.0/lib/factory_bot/find_definitions.rb:15:in `find_definitions'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/factory_bot-5.1.0/lib/factory_bot/reload.rb:6:in `reload'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/factory_bot_rails-5.1.0/lib/factory_bot_rails/reloader.rb:25:in `block in build_reloader'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/file_update_checker.rb:83:in `execute'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/factory_bot_rails-5.1.0/lib/factory_bot_rails/reloader.rb:35:in `block in register_reloader'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:428:in `instance_exec'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:428:in `block in make_lambda'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:605:in `block (2 levels) in default_terminator'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:604:in `catch'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:604:in `block in default_terminator'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:201:in `block in halting'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:513:in `block in invoke_before'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:513:in `each'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:513:in `invoke_before'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb:134:in `run_callbacks'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/reloader.rb:88:in `prepare!'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/railties-6.0.3.1/lib/rails/application/finisher.rb:113:in `block in <module:Finisher>'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/railties-6.0.3.1/lib/rails/initializable.rb:32:in `instance_exec'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/railties-6.0.3.1/lib/rails/initializable.rb:32:in `run'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/railties-6.0.3.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/railties-6.0.3.1/lib/rails/initializable.rb:60:in `run_initializers'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/railties-6.0.3.1/lib/rails/application.rb:363:in `initialize!'
/Users/eric/Documents/gitlab/gdk/gitlab/config/environment.rb:5:in `<main>'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/railties-6.0.3.1/lib/rails/application.rb:339:in `require_environment!'
/Users/eric/.rvm/gems/ruby-2.6.6/gems/railties-6.0.3.1/lib/rails/application.rb:523:in `block in run_tasks_blocks'
/Users/eric/Documents/gitlab/gdk/gitlab/lib/tasks/gettext.rake:27:in `block (2 levels) in <main>'
/Users/eric/.rvm/rubies/ruby-2.6.6/bin/bundle:23:in `load'
/Users/eric/.rvm/rubies/ruby-2.6.6/bin/bundle:23:in `<main>'
/Users/eric/.rvm/gems/ruby-2.6.6/bin/ruby_executable_hooks:24:in `eval'
/Users/eric/.rvm/gems/ruby-2.6.6/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => gettext:po_to_json => environment
(See full trace by running task with --trace)
make: *** [.gettext] Error 1
(❌) Error: Failed to install.
-------------------------------------------------------
You can try the following that may be of assistance:
- Run 'gdk doctor'.
- Visit the troubleshooting documentation:
https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/master/doc/troubleshooting.md.
- Visit https://gitlab.com/gitlab-org/gitlab-development-kit/-/issues to
see if there are known issues.
-------------------------------------------------------
Proposal (optional)
Detect when the GitLab project clone isn't complete and resume the install if it failed before.
Environment (optional)
- Operating System: macOS
10.15.3 - Homebrew
2.4.9 - The contents of your
gdk.yml: N/A - Ruby version:
2.6.6 - GDK version:
b3c07c2A(git rev-parse --short HEAD)