Skip to content

Changing default env directory for gitaly breaks downgrades

In !2825 (merged), we changed env_dir of gitaly to /opt/gitlab/etc/gitaly/env from /opt/gitlab/etc/gitaly/.

  1. As part of reconfigure, we clean up the directory which contains environment variables to make sure that it don't contain any files that are not specified in gitaly['env'].
  2. In 11.5, this environment variable directory for gitaly was /opt/gitlab/etc/gitaly. In 11.6, we changed it to /opt/gitlab/etc/gitaly/env.
  3. So, reconfigure after installing 11.6 created an env directory inside /opt/gitlab/etc/gitaly, since it is now the default location for env variables
  4. Then we rolled back to 11.5.3. Now, according to reconfigure, the env directory is now /opt/gitlab/etc/gitaly and anything inside it, other than the list of env variables should be removed.
  5. However, that includes the env directory, that 11.6 reconfigure created. So, reconfigure attempts to remove that too. This fails because we expect a file and env is a directory.