actions / actions/actions-runner-controller

Actions webhookserver error validating request body {"error": "mime: no media type"}

Open
#2,472 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs triage
Dominant language
Go
Stars
6.5k
Forks
1.5k
Avg merge
2d 2h
Merged PRs (30d)
27

Description

Checks
Controller Version

0.27.1

Helm Chart Version

0.22.1

CertManager Version

1.9.1

Deployment Method

Helm

cert-manager installation
  • Yes
  • Yes
Checks
  • This isn't a question or user support case (For Q&A and community support, go to Discussions. It might also be a good idea to contract with any of contributors and maintainers if your business is so critical and therefore you need priority support
  • I've read releasenotes before submitting this issue and I'm sure it's not due to any recently-introduced backward-incompatible changes
  • My actions-runner-controller version (v0.x.y) does support the feature
  • I've already upgraded ARC (including the CRDs, see charts/actions-runner-controller/docs/UPGRADING.md for details) to the latest and it didn't fix the issue
  • I've migrated to the workflow job webhook event (if you using webhook driven scaling)
Resource Definitions
Name:         prod-1-sandbox
Namespace:    runners
Labels:       app.kubernetes.io/managed-by=Helm
Annotations:  meta.helm.sh/release-name: runners
              meta.helm.sh/release-namespace: runners
API Version:  actions.summerwind.dev/v1alpha1
Kind:         RunnerSet
Metadata:
  Creation Timestamp:  2023-04-01T12:24:22Z
  Generation:          1
  Managed Fields:
    API Version:  actions.summerwind.dev/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:meta.helm.sh/release-name:
          f:meta.helm.sh/release-namespace:
        f:labels:
          .:
          f:app.kubernetes.io/managed-by:
      f:spec:
        .:
        f:dockerdWithinRunnerContainer:
        f:ephemeral:
        f:organization:
        f:replicas:
        f:selector:
          .:
          f:matchLabels:
            .:
            f:app:
        f:serviceName:
        f:template:
          .:
          f:metadata:
            .:
            f:labels:
              .:
              f:app:
          f:spec:
            .:
            f:containers:
            f:securityContext:
              .:
              f:fsGroup:
            f:volumes:
    Manager:      helm
    Operation:    Update
    Time:         2023-04-01T12:24:22Z
    API Version:  actions.summerwind.dev/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:status:
        .:
        f:availableReplicas:
        f:desiredReplicas:
        f:readyReplicas:
        f:replicas:
        f:updatedReplicas:
    Manager:         manager
    Operation:       Update
    Subresource:     status
    Time:            2023-04-01T13:02:57Z
  Resource Version:  39471951
  UID:               f1997923-966c-4385-83ef-8a794b3e378c
Spec:
  Dockerd Within Runner Container:  true
  Ephemeral:                        true
  Organization:                     sandbox
  Replicas:                         2
  Selector:
    Match Labels:
      App:       prod-1-sandbox
  Service Name:  prod-1-sandbox
  Template:
    Metadata:
      Labels:
        App:  prod-1-sandbox
    Spec:
      Containers:
        Env:
          Name:   RUNNER_GRACEFUL_STOP_TIMEOUT
          Value:  120
        Image:    <>/gha-runner:0.0.57
        Name:     runner
        Resources:
          Limits:
            kvm:  1
          Requests:
            Cpu:     500m
            Memory:  2G
        Volume Mounts:
          Mount Path:  /etc/var
          Name:        cert
          Read Only:   true
      Security Context:
        Fs Group:  1000
      Volumes:
        Name:  cert
        Secret:
          Optional:     false
          Secret Name:  cert
Status:
  Available Replicas:  90
  Desired Replicas:    2
  Ready Replicas:      88
  Replicas:            90
  Updated Replicas:    90
Events:                <none>
To Reproduce
1. enable actions metrics server.
2. create webhooks for workflow_job events.
3. Check the metrics server logs for errors.
Describe the bug

While actions metrics server handles most of the webhooks, some are not handled as pointed out in the metrics server logs and it logs the following:

  1. {"error": "mime: no media type"} - should be handled already in go-github v37, no?
  2. "error": "unexpected status code: 404 Not Found" - this is for the cases where the job gets skipped (due to other parallel job failing)
  3. {"error": "missing signature"} - this could be a user error.
  4. {"error": "webhook request has unsupported Content-Type "text/xml""}
  5. {"error": "invalid semicolon separator in query"}
  6. {"error": "webhook request has unsupported Content-Type "text/x-gwt-rpc""}
  7. {"error": "webhook request has unsupported Content-Type "application/xml""}
  8. {"error": "webhook request has unsupported Content-Type "x-application/hessian""}
  9. {"error": "webhook request has unsupported Content-Type "multipart/form-data""}
Describe the expected behavior

Metrics server should handle these cases to publish more accurate metric counts.

Whole Controller Logs
https://gist.github.com/dhawalseth/f8a78deebfc5df59e753190f92b65f55
Whole Runner Pod Logs
N/A
Additional Context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the Actions metrics server webhook handler and its logs, then reproduce the listed workflow_job webhook cases, including missing media types and unsupported Content-Type values. Done means the metrics server handles the relevant webhook responses without these errors and publishes accurate metric counts; the issue provides no source file or test path.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, go, kubernetes
Domain
api, devops, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.