You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If runner_tags is empty, the amazonec2-tags has a leading comma that causes the API request to AWS to fail with the error message mentioned in the title. See JSON request below for the error.
If runner_tags is empty, output has leading comma since the sed command doesn't remove it in gitlab-runner.tftpl:
"amazonec2-tags=,__PARENT_TAG__",
If runner_tags is not empty, or the leading comma is manually removed by going into the agent EC2 instance and editing /etc/gitlab-runners/config.toml, the error no longer shows up:
# module var.runner_tags
runner_tags = {
"testing" = "new runner who dis"
}
# output from user_data with tags
"amazonec2-tags=testing,new runner who dis,__PARENT_TAG__",
Manual edit that works for us after agents were provisioned and running:
# before
"amazonec2-tags=,gitlab-runner-parent-id,runner-123123",
# after
"amazonec2-tags=gitlab-runner-parent-id,runner-123123",
To Reproduce
Steps to reproduce the behavior:
Apply a module with empty runner_tags
Wait for amazon to provision the runner
See error in CloudTrail logs
Expected behavior
The API requests are successful and the runner is registered, and does not show any errors in CloudTrail or CloudWatch logs about being able to provision the runners.
Additional context
The weird and difficult part about this issue, is that this only showed up 3-4 weeks after we switched to Spot Fleets.
We switched to Spot Fleets around 2023-07-12, and today was the first time we encountered this specific error.
We even destroyed and applied fresh modules with no other changes, and this error kept showing up.
## Description
In rare cases the `amazonec2-tags` may contain empty elements which show
up as `,__PARENT_TAG__` which is not a valid value for AWS API to create
an instance.
The problem is that `runner_tags` must be removed if it is empty.
Otherwise the empty element is inserted into the final string which
results in a preceding `,`.
Closes#933
## Verification
Verified manually with
- no tags --> `__PARENT_TAG__`
- with tags --> `tag1,value1,__PARENT_TAG`
Describe the bug
If
runner_tags
is empty, theamazonec2-tags
has a leading comma that causes the API request to AWS to fail with the error message mentioned in the title. See JSON request below for the error.If
runner_tags
is empty, output has leading comma since the sed command doesn't remove it ingitlab-runner.tftpl
:If
runner_tags
is not empty, or the leading comma is manually removed by going into the agent EC2 instance and editing/etc/gitlab-runners/config.toml
, the error no longer shows up:Manual edit that works for us after agents were provisioned and running:
To Reproduce
Steps to reproduce the behavior:
runner_tags
Expected behavior
The API requests are successful and the runner is registered, and does not show any errors in CloudTrail or CloudWatch logs about being able to provision the runners.
Additional context
The weird and difficult part about this issue, is that this only showed up 3-4 weeks after we switched to Spot Fleets.
Redacted request JSON to AWS
The text was updated successfully, but these errors were encountered: