terraform-aws-github-runner icon indicating copy to clipboard operation
terraform-aws-github-runner copied to clipboard

Lambda scale-up doesn't run instances

Open yury-atrashkevich-scn opened this issue 3 years ago • 8 comments

Hello, I have set up the solution following the guide from github, but every time when I sent an event from github to webhook lambda I see the following error in scale-up lambda:

2022-08-01 10:49:16.397 INFO [scale-up:51dc8414-71eb-5ef1-86c3-df75c008ae6d index.js:114235 scaleUp] Received event {"runnerType":"Repo","runnerOwner":"Upstreamworks/UWF","event":"workflow_job","id":"7609333551"}
--
  | 2022-08-01T13:49:16.781+03:00 | 2022-08-01 10:49:16.780 WARN [scale-runners:51dc8414-71eb-5ef1-86c3-df75c008ae6d index.js:113659 Runtime.handler] Ignoring error: Not Found {"runnerType":"Repo","runnerO

I use latest version of terraform-aws-github-runner module and in the S3 I see github actions runner package with right name: actions-runner-windows.zip I carefully reviewed all issues and discussions related to this topic, but nothing helped. Does anyone know what else I can do?

yury-atrashkevich-scn avatar Aug 01 '22 11:08 yury-atrashkevich-scn

There is a log_level option you can tweak to get more logs, which should help you identify the issue.

See the description in the main README.md here: https://github.com/philips-labs/terraform-aws-github-runner#input_log_level

jokreliable avatar Aug 03 '22 20:08 jokreliable

@jokreliable Thanks for your reply.

Yes, I've tried to use it as well, but there is no specific messages in logs. I see just the following message when log_level is DEBUG:

2022-08-04 12:14:00.501  DEBUG [gh-auth:bfe97500-32b5-5da4-86b9-2e658881b6e5 index.js:113616  createAuth] GHES API URL:  {
    "runnerType": "Repo",
    "runnerOwner": "Upstreamworks/UWF",
    "event": "workflow_job",
    "id": "7671811681"
} 
2022-08-04 12:14:00.611  WARN [scale-runners:bfe97500-32b5-5da4-86b9-2e658881b6e5 index.js:113659  Runtime.handler] Ignoring error: Not Found {
    "runnerType": "Repo",
    "runnerOwner": "Upstreamworks/UWF",
    "event": "workflow_job",
    "id": "7671811681"
} 

What does this issue mean? Ignoring error: Not Found May be someone else had similar problems?

yury-atrashkevich-scn avatar Aug 04 '22 12:08 yury-atrashkevich-scn

I would verify that your GHES URL is correct on the terraform side, and that your secrets are valid/matching between GHES and terraform. (with GHES, if the auth fails, you don't get a auth failure, but a "repo not found")

jokreliable avatar Aug 04 '22 20:08 jokreliable

@jokreliable this is a bit weird, because I don't use GHES, my repos are in cloud github repository.

yury-atrashkevich-scn avatar Aug 05 '22 08:08 yury-atrashkevich-scn

Did you install the app in the given repo, and grant the permission as described in the readme.

npalm avatar Aug 15 '22 20:08 npalm

I'm running into the same issue. The repo is a public forked repo. The app is installed into the repo. Seeing the following logs in CloudWatch:

2022-08-19 11:53:05.757  DEBUG [gh-auth:305482c1-d0ef-55dd-a99f-d9b8ab3cabf5 index.js:111759  createAuth] GHES API URL:  
{
    "runnerType": "Repo",
    "runnerOwner": "trawler/k0s",
    "event": "check_run",
    "id": "7914695405"
}
2022-08-19 11:53:05.760  WARN [scale-runners:305482c1-d0ef-55dd-a99f-d9b8ab3cabf5 index.js:111802  Runtime.handler] Ignoring error: error:0909006C:PEM routines:get_name:no start line 
{
    "runnerType": "Repo",
    "runnerOwner": "trawler/k0s",
    "event": "check_run",
    "id": "7914695405"
}

App Persmissions are as follows: Screenshot 2022-08-19 at 17 18 10

Any tips on how to debug this next?

trawler avatar Aug 19 '22 15:08 trawler

Ok, found the issue - the problem was with the content of TF_VAR_github_app_key_base64 - I used the wrong value, which explains why logs are complaining about an empty PEM file.

trawler avatar Aug 20 '22 09:08 trawler

Shall we close this issue, and maybe reaise a new one to see if we can add a better error in the logging. Seems the mistake happens more often.

npalm avatar Sep 16 '22 12:09 npalm

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 17 '22 02:10 github-actions[bot]