Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: User data format: unrecognized #3736

Closed
guicaulada opened this issue Jan 24, 2024 · 3 comments · Fixed by #3759
Closed

Windows: User data format: unrecognized #3736

guicaulada opened this issue Jan 24, 2024 · 3 comments · Fixed by #3759
Labels
bug Something isn't working

Comments

@guicaulada
Copy link

When using version 5.6.3 I noticed Windows instances were not executing the User Data script and C:\UserData.log was not created when using SSM to log into the machine.

I believe this was caused by: #3717

That PR fixed another issue that I had with my Linux runners where my user data would endup too big, however it broke the Windows runners when they stopped executing the user data script.

Looking at C:\ProgramData\Amazon\EC2Launch\log\agent.log.

When using 5.6.3 I get the following log message:

2024-01-24 16:54:51 Info: Getting user data
2024-01-24 16:54:51 Info: Try parsing user data in YAML format.
2024-01-24 16:54:51 Info: Parsing failed, fall back to XML format.
2024-01-24 16:54:51 Warning: No XML or YAML user data detected. If XML or YAML user data is intended, check for typos or refer to documentation (https://docs
.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch-v2-settings.html#ec2launch-v2-example-user-data): %!w(*fmt.wrapError=&{Failed to unmarshal user data as
YAML: yaml: control characters are not allowed 0xc000115e70})
2024-01-24 16:54:51 Console: User data format: unrecognized
2024-01-24 16:54:51 Console: EC2LaunchTelemetry: IsTelemetryEnabled=true
2024-01-24 16:54:51 Console: EC2LaunchTelemetry: AgentOsArch=windows_amd64
2024-01-24 16:54:51 Console: EC2LaunchTelemetry: IsAgentScheduledPerBoot=true
2024-01-24 16:54:51 Console: EC2LaunchTelemetry: AgentCommandErrorCode=0
2024-01-24 16:54:51 Console: Message: Windows is Ready to use
2024-01-24 16:54:51 Info: Initialize user-data state.
2024-01-24 16:54:51 Info: User-data state initialized successfully.

When using 5.6.2:

2024-01-24 16:35:35 Info: Getting user data
2024-01-24 16:35:35 Info: Try parsing user data in YAML format.
2024-01-24 16:35:35 Info: Parsing failed, fall back to XML format.
2024-01-24 16:35:35 Info: Converting user data to YAML format.
2024-01-24 16:35:35 Info: Frequency is set to: once
2024-01-24 16:35:35 Info: Run as user is set to: 'admin'.
2024-01-24 16:35:35 Info: Script is set to run as an inline process.
2024-01-24 16:35:35 Info: PowerShell content detected
2024-01-24 16:35:35 Info: User-data conversion completed.
2024-01-24 16:35:35 Console: User data format: xml
2024-01-24 16:35:35 Console: EC2LaunchTelemetry: IsTelemetryEnabled=true
2024-01-24 16:35:35 Console: EC2LaunchTelemetry: AgentOsArch=windows_amd64
2024-01-24 16:35:35 Console: EC2LaunchTelemetry: IsAgentScheduledPerBoot=true
2024-01-24 16:35:35 Console: EC2LaunchTelemetry: IsUserDataScheduledPerBoot=false
2024-01-24 16:35:35 Console: EC2LaunchTelemetry: AgentCommandErrorCode=0
2024-01-24 16:35:35 Console: Message: Windows is Ready to use
2024-01-24 16:35:35 Info: Initialize user-data state.
2024-01-24 16:35:35 Info: User-data state initialized successfully.
2024-01-24 16:35:35 Info: Start script.
2024-01-24 16:35:35 Info: Frequency: once
2024-01-24 16:35:35 Info: Type: powershell
2024-01-24 16:35:35 Info: Run as: admin
2024-01-24 16:35:35 Info: Not running as a detached process.
2024-01-24 16:35:35 Info: Script file is created at: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\EC2Launch2228337985\UserScript.ps1
2024-01-24 16:35:35 Info: Error file is created at: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\EC2Launch2228337985\err.tmp
2024-01-24 16:35:35 Info: Output file is created at: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\EC2Launch2228337985\output.tmp
@guicaulada
Copy link
Author

guicaulada commented Jan 24, 2024

I got over this issue by reverting to 5.6.2 for now, using Terraform to upload all my user data, pre-install scripts, etc. to S3 and used Terraform to set the userdata_pre_install of each runner to aws s3 cp s3://mybucket/runnername - | bash or | Out-String | iex for Windows.

@pawelfraczyk
Copy link

I faced the same issue - reverting to 5.6.2 also helped.

@npalm
Copy link
Member

npalm commented Feb 12, 2024

Thx for reporting. This is indeed broken. Indeed cause by #3717

@npalm npalm added the bug Something isn't working label Feb 12, 2024
npalm added a commit that referenced this issue Feb 12, 2024
Windows user data is not support gzip. This PR avoids window user_data
scripts are gzipped.

close: #3736

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants