- Newest
- Most votes
- Most comments
Hi Arjun!
Looks like you're using GitHub Actions to deploy your pipeline, I recommend watching GitHub actions logs in debug mode when the stage runs, and check that it indeed works. Resource: https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging
Alternatively, it could be an issue with using a t2.micro sized instance, as they are the smallest GP instance in EC2, it's very possible that service registration is failing or getting killed before complication.
I have tweaked the pipeline code and got some other error. Can someone help me in fixing it. Here is the code:
name: "Deploying a CI/CD for Windows Service using GitHub Actions"
on:
workflow_dispatch:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: cmd
steps:
- name: Checkout code repository
uses: actions/checkout@v3
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.0.5
- name: Restore Packages
run: nuget restore WindowsServiceDemo.sln
- name: Build solution
run: msbuild WindowsServiceDemo.sln /p:Configuration=Release /p:DeployOnBuild=true
- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Upload the .exe to S3 bucket
run: aws s3 cp D:\a\WindowsServiceDemo\WindowsServiceDemo\WindowsServiceDemo\bin\Release\WindowsServiceDemo.exe s3://dotnet-cicd-bucket/
deploy:
needs: build
runs-on: [ self-hosted, Windows, X64 ]
defaults:
run:
shell: cmd
steps:
- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Download the zip file from S3 to EC2 folder
shell: powershell
run: C:\"Program Files"\Amazon\AWSCLIV2\aws s3 cp s3://dotnet-cicd-bucket/WindowsServiceDemo.exe "C:\actions-runner\_work"
- name: Install a service using Powershell
shell: powershell
run: |
Set-Location C:\Windows\System32
Set-Location C:\Windows\Microsoft.NET\Framework\v4.0.30319
& "C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" "C:\actions-runner\_work\WindowsServiceDemo.exe"
and here is the error:
Affected parameters are: logtoconsole = logfile = C:\actions-runner_work\WindowsServiceDemo.InstallLog assemblypath = C:\actions-runner_work\WindowsServiceDemo.exe Installing service Service1... Creating EventLog source Service1 in log Application...
An exception occurred during the Install phase. System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security, State.
The Rollback phase of the installation is beginning. See the contents of the log file for the C:\actions-runner_work\WindowsServiceDemo.exe assembly's progress. The file is located at C:\actions-runner_work\WindowsServiceDemo.InstallLog. Rolling back assembly 'C:\actions-runner_work\WindowsServiceDemo.exe'. Affected parameters are: logtoconsole = logfile = C:\actions-runner_work\WindowsServiceDemo.InstallLog assemblypath = C:\actions-runner_work\WindowsServiceDemo.exe Restoring event log to previous state for source Service1. An exception occurred during the Rollback phase of the System.Diagnostics.EventLogInstaller installer. System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security, State. An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback will continue. However, the machine might not fully revert to its initial state after the rollback is complete.
The Rollback phase completed successfully.
The transacted install has completed. The installation failed, and the rollback has been performed. Error: Process completed with exit code 1.
Relevant content
- asked 2 years ago
- asked 4 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 5 months ago
Hi Brian Chew, the instance size is not an issue as I have tried the same with
t2.large
but the same issue persists.