You cannot mask services defined in /etc/systemd/system. It relies on creating a symlink there with the same name as the file which defines the service.
From the big book of unhelpful error messages
# /bin/systemctl mask gitlab-runner.service Failed to execute operation: Invalid argument # systemctl status gitlab-runner.service ● gitlab-runner.service - GitLab Runner Loaded: loaded (/etc/systemd/system/gitlab-runner.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2019-07-16 13:15:18 BST; 1h 54min ago Main PID: 3208 (gitlab-runner) CGroup: /system.slice/gitlab-runner.service └─3208 /usr/lib/gitlab-runner/gitlab-runner run --working-directory /home/gitlab-r...
The man page contents:
mask NAME... Mask one or more unit files, as specified on the command line. This will link these units to /dev/null, making it impossible to start them. This is a stronger version of disable, since it prohibits all kinds of activation of the unit, including enablement and manual activation. Use this option with care. This honors the --runtime option to only mask temporarily until the next reboot of the system. The --now option can be used to ensure that the units are also stopped.