I have to open the MR, as in write the code myself?
Hi @grantyoung. We need this capability in order to add a base access security group to all our Gitlab instances. This is a standard operating procedure as we use this security group to allow access to our scanner to scan all our instances.
@grantyoung it works when I set the following variables in each environment's var.yml file:
ansible_command_timeout: 3600 ansible_aws_ssm_timeout: 1200
@grantyoung Yes I did upgrade to 3.9. Here is the output when I run the commands you provided:
Time sudo gitlab-rails runner 'env_settings = ApplicationSetting.last.attributes.select{|k,v| !k.include?("encrypted")}; env_settings["current_license_plan"]= defined?(License) ? License.current&.plan : nil; puts env_settings["current_license_plan"].inspect; puts env_settings.keys.size' nil 672 real 1m6.967s user 0m0.019s sys 0m0.042s
So it appears that it's able to reach it and return the values however it takes 1 minute & 7 seconds. Is that the reason, that it is above the time out limit?
Hi @grantyoung, I tried to upgrade Gitlab-community right now but ran into the license issue again. Do I have to set some ansible variable as well to avoid the issue? I should clarify that although this is our community edition, we are still running the gitlab enterprise (without any licenses) in the servers in order to take advantage of the upgraded features. Might this be a factor in the issue?
TASK [post_configure : Get and save Environment Settings and License plan via GitLab Rails] ******************************************************************
[ERROR]: Task failed: EXEC command 'printf '%s\n' 'NuRQmIHmavEMvCoOfOFzmFLsLr';
echo | sudo -H -S -n -u root /bin/sh -c 'echo BECOME-SUCCESS-diuoagnwaxlnzkuxjedlbggnjahewafm ; /usr/bin/python3.9 /home/centos/.ansible/tmp/ansible-tmp-1771344496.0495565-3496-23498072594809/AnsiballZ_command.py';
printf '\n%s\n%s\n' "$?" 'VHzJroAUbEwCoKRYcnhzFqsigm';
' timeout on host: i-09edb8e87e301d9dc
Origin: /gitlab-environment-toolkit/ansible/roles/post_configure/tasks/main.yml:59:7
57 - name: Get and save Environment Settings and License details
58 block:
59 - name: Get and save Environment Settings and License plan via GitLab Rails
^ column 7
fatal: [localhost -> gitlab-community-dev-gitlab-rails-2]: UNREACHABLE! => {"changed": false, "msg": "Task failed: EXEC command 'printf '%s\\n' 'NuRQmIHmavEMvCoOfOFzmFLsLr';\necho | sudo -H -S -n -u root /bin/sh -c 'echo BECOME-SUCCESS-diuoagnwaxlnzkuxjedlbggnjahewafm ; /usr/bin/python3.9 /home/centos/.ansible/tmp/ansible-tmp-1771344496.0495565-3496-23498072594809/AnsiballZ_command.py';\nprintf '\\n%s\\n%s\\n' \"$?\" 'VHzJroAUbEwCoKRYcnhzFqsigm';\n' timeout on host: i-09edb8e87e301d9dc", "unreachable": true}
Hi Grant, thank you for looking over this and getting it fixed. And no, this has been an ongoing issue for a few versions now. I've worked around by excluding certain trivial tasks however this was not ideal. Glad to hear it will be fixed.
Yes this has worked fine for us before.
@grantyoung This Error occurred again except it only happens on our community edition, not our licensed edition. Does this have to do with the fact that our community edition does not contain a license?
[ERROR]: Task failed: EXEC command 'printf '%s\n' 'IVphEoOQgUtoMFFtdKIBBbNmTC';
echo | sudo -H -S -n -u root /bin/sh -c 'echo BECOME-SUCCESS-rzcqbrtbopjclqrkuqzzqdiphqgyemin ; /usr/bin/python3.9 /home/centos/.ansible/tmp/ansible-tmp-1769102209.2155304-13312-153566639302210/AnsiballZ_command.py';
printf '\n%s\n%s\n' "$?" 'yxsrnHvdfDrOXscPVyaOEilRqh';
' timeout on host: i-09edb8e87e301d9dc
Origin: /gitlab-environment-toolkit/ansible/roles/post_configure/tasks/main.yml:54:7
52 - name: Get and save Environment Settings and License details
53 block:
54 - name: Get and save Environment Settings and License plan via GitLab Rails
^ column 7
fatal: [localhost -> gitlab-community-dev-gitlab-rails-2]: UNREACHABLE! => changed=false
msg: |-
Task failed: EXEC command 'printf '%s\n' 'IVphEoOQgUtoMFFtdKIBBbNmTC';
echo | sudo -H -S -n -u root /bin/sh -c 'echo BECOME-SUCCESS-rzcqbrtbopjclqrkuqzzqdiphqgyemin ; /usr/bin/python3.9 /home/centos/.ansible/tmp/ansible-tmp-1769102209.2155304-13312-153566639302210/AnsiballZ_command.py';
printf '\n%s\n%s\n' "$?" 'yxsrnHvdfDrOXscPVyaOEilRqh';
' timeout on host: i-09edb8e87e301d9dc
unreachable: true
Yes, it does keep occurring. It is occurring on our gitlab-community edition. I will verify that the error occurs again.
@grantyoung I edited the vars.yml to include the updated gitlab_rails_local_health_check_url but now it throws the following different error:
[ERROR]: Task failed: EXEC command 'printf '%s\n' 'nXdawwzLjElVeeHtpKCwuCdpfA';
echo | sudo -H -S -n -u root /bin/sh -c 'echo BECOME-SUCCESS-gkwvwxnfrnsxggpnjakampgvdagdlmzn ; /usr/bin/python3.9 /home/centos/.ansible/tmp/ansible-tmp-1769019759.2281353-8529-272433329736701/AnsiballZ_command.py';
printf '\n%s\n%s\n' "$?" 'KVhazvWzYFXjCJgcNFLaxwIIiK';
' timeout on host: i-09edb8e87e301d9dc
Origin: /gitlab-environment-toolkit/ansible/roles/post_configure/tasks/main.yml:54:7
52 - name: Get and save Environment Settings and License details
53 block:
54 - name: Get and save Environment Settings and License plan via GitLab Rails
^ column 7
fatal: [localhost -> gitlab-community-dev-gitlab-rails-2]: UNREACHABLE! => changed=false
msg: |-
Task failed: EXEC command 'printf '%s\n' 'nXdawwzLjElVeeHtpKCwuCdpfA';
echo | sudo -H -S -n -u root /bin/sh -c 'echo BECOME-SUCCESS-gkwvwxnfrnsxggpnjakampgvdagdlmzn ; /usr/bin/python3.9 /home/centos/.ansible/tmp/ansible-tmp-1769019759.2281353-8529-272433329736701/AnsiballZ_command.py';
printf '\n%s\n%s\n' "$?" 'KVhazvWzYFXjCJgcNFLaxwIIiK';
' timeout on host: i-09edb8e87e301d9dc
unreachable: true
By the way, I am running this is against our community edition, so we don't have any licenses uploaded to it.
@grantyoung Alright thank you for letting me know. I will test and let you know.