Skip to content

Check if Gitaly is using NFS shares

Closes #103

Checks if Gitaly is using NFS shares.

To test

  1. Setup a local NFS share (let's call it /mnt/nfs-test) - alternatively you can fake it with Kenneth's instructions here !92 (comment 2479663810)

  2. Add any of the configurations in the test results section to your /etc/gitlab/gitlab.rb file.

  3. Test with spot

Test results

PASS for gitaly['configuration']:

gitaly['configuration'] = {
  socket_path: '/var/opt/gitlab/gitaly/gitaly.socket',
  runtime_dir: '/var/opt/gitlab/gitaly/run',
  listen_addr: 'localhost:8075',
  prometheus_listen_addr: 'localhost:9236',
  tls_listen_addr: 'localhost:9075',
  storage: [
    {
      name: 'default',
      path: '/mnt/nfs_mount',
    },
  ],
}
# The expected value should be 1 (we want the check to return a message since it failed)
❯ spot -p all_playbook.yml -e GITLAB_VERSION:170000 -n "20250501_351243 - run check" --dbg | grep "Run the check and store result" | grep message | wc -l
       1

PASS for commented gitaly['configuration']:

#gitaly['configuration'] = {
#  socket_path: '/var/opt/gitlab/gitaly/gitaly.socket',
#  runtime_dir: '/var/opt/gitlab/gitaly/run',
#  listen_addr: 'localhost:8075',
#  prometheus_listen_addr: 'localhost:9236',
#  tls_listen_addr: 'localhost:9075',
#  storage: [
#    {
#      name: 'default',
#      path: '/mnt/nfs_mount',
#    },
#  ],
#}
# The expected value should be 0 (no message is returned since the check passed)
❯ spot -p all_playbook.yml -e GITLAB_VERSION:170000 -n "20250501_351243 - run check" --dbg | grep "Run the check and store result" | grep message | wc -l
       0

PASS for git_data_dirs:

git_data_dirs({
  "default" => {
  "path" => "/mnt/nfs_mount"
  }
})
# The expected value should be 1 (we want the check to return a message since it failed)
❯ spot -p all_playbook.yml -e GITLAB_VERSION:170000 -n "20250501_351243 - run check" --dbg | grep "Run the check and store result" | grep message | wc -l
       1

PASS for commented git_data_dirs:

#git_data_dirs({
#  "default" => {
#  "path" => "/mnt/nfs_mount"
#  }
#})
# The expected value should be 0 (no message is returned since the check passed)
❯ spot -p all_playbook.yml -e GITLAB_VERSION:170000 -n "20250501_351243 - run check" --dbg | grep "Run the check and store result" | grep message | wc -l
       0

Author checklist

  • After opening the MR:
    • Set it to the current milestone
    • Ask the Maintainer from the Reviewer roulette suggestion for review

Reviewer checklist

  • I followed the verification steps and confirm the functionality of the new check
    • I executed the check as presented in this MR by running the generated playbook with spot
    • In case of unexpected/odd behavior here, verify the generated playbook to account for potential YAML parsing issues
  • This check does only perform read operations
  • This check does not output more than necessary on stdout for the check to function
  • The message explains what it means when this check does not pass
  • The workaround_url provides actionable information/steps for affected users
    • Consider if a Knowledge Base article should exist to serve as the ideal workaround URL
  • This check is not using the Rails console/runner, or has Maintainer approval for doing so
  • If this is a breaking change check:
    • It has the corresponding xx_breaking_changes tag (xx being the major release version for the change)
    • The workaround_url goes to the entry on the https://docs.gitlab.com/update/deprecations/ page
    • The ref_url goes to the deprecation issue linked from that entry
    • The title is the same as that entry
    • The version_started is equal to the announcement_milestone of the deprecation
    • The version_fixed is equal to the removal_milestone of the deprecation

✍️ Notes from Review

Click to expand
date && jq '.' /tmp/check_all_20250501_351243.json                                                              ~/detecting 15:49:25
Mon May  5 15:49:37 EDT 2025
{
  "ref_url": "https://gitlab.com/gitlab-org/gitlab/-/issues/351243",
  "title": "Check if Git repository storage is on NFS",
  "host": "34.75.15.238",
  "workaround_url": "https://docs.gitlab.com/update/deprecations/#nfs-for-git-repository-storage",
  "version_started": "15.6.0",
  "version_fixed": null,
  "message": "Git repository storage is configured to use NFS, which is deprecated and will be removed."
}
Edited by Anton Smith

Merge request reports

Loading