By using AWS re:Post, you agree to the Terms of Use

CodeBuild build failed with no log generated

1

Hi,

I have a CodeBuild project which was failing and no log seems to be output from "Build logs". However in "Phase details" tab, It was shown that the failure comes from "Build" phase. Since there is no log available. It seems kind of strange that the log does not get generated. Am I missing something here? It was not mentioned in CodeBuild FAQ either. Appreciate the helps provided.

Thank you.

1 Answer
1

You have the option to enable logging to Cloudwatch and / or S3. Check if you have these enabled. Nothing shows up in Build logs tab if Cloudwatch logs are disabled

profile picture
answered 24 days ago
  • Hi Syd,

    Thanks for the answer. I have however checked CloudWatch logs. Is there any other permissions which could be missing here?

  • You need to ensure that the Service Role used by CodeBuild has permissions to send logs to Cloudwatch. Codebuild can do it for you if you select the check box. BTW didnt understand what you meant by checked Cloudwatch logs. Does it mean you checked logs but didnt find any entry, or nothing useful in Cloudwatch logs even though it's enabled? Just wanted to mention that if CodeBuild is set to configure sent to Cloudwatch, those logs are visible in Codebuild - Buildlogs tab itself for the subsequent run.

  • In project settings, Under Logs section. I checked and configure 'Group name' and 'Stream name'

    CloudWatch logs - optional Checking this option will upload build output logs to CloudWatch.

    Service role permission was checked as well. "Allow AWS CodeBuild to modify this service role so it can be used with this build project"

    And when I refer to the policy. This part is defined:-

            "Sid": "",
            "Effect": "Allow",
            "Action": [
                "logs:PutLogEvents",
                "logs:CreateLogStream",
                "logs:CreateLogGroup"
            ],
            "Resource": "*"
    

    What puzzled me is, it was working before and stop working since 4 days ago. I compared the latest run to the successful run but nothing changes on configuration part.

  • I'm not sure if this is relevant. Under "Phase details" on "FINALIZING" phase whilst shown as 'Succeeded' inside context there is an error below

    RequestError: send request failed caused by: Post "https://logs.us-east-2.amazonaws.com/": net/http: TLS handshake timeout
    

    I am not sure what this means.

  • Policy is correct. The TLS error is related to Cloudwatch logs endpoint. It could be a transient error unless you see it on every build. In which case it's difficult to identify the cause is with the limited info available. Is the test build showing a status of Successful despite the context text in FINALIZING phase? It would mean apart from the logging aspect the build completes.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions