Skip to content

Argus trying to set headers after response is set #4760

@kdembler

Description

@kdembler

Seeing those in my logs from time to time:

2023-05-15 14:24:22:2422 PublicApi error: middlewareError
{
    "err": {
        "code": "ERR_HTTP_HEADERS_SENT",
        "message": "Cannot set headers after they are sent to the client",
        "stack": "Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client\n    at new NodeError (internal/errors.js:322:7)\n    at ServerResponse.setHeader (_http_outgoing.js:561:11)\n    at PublicApiController.assetHead (/joystream/distributor-node/src/services/httpApi/controllers/public.ts:224:9)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n    at async /joystream/distributor-node/src/services/httpApi/HttpApiBase.ts:30:9"
    },
    "req": {
        "url": "/api/v1/assets/13702",
        "headers": {
            "host": "joystream.koalva.io",
            "user-agent": "undici",
            "accept": "*/*",
            "accept-encoding": "br, gzip, deflate",
            "accept-language": "*",
            "sec-fetch-mode": "cors",
            "x-forwarded-host": "joystream.koalva.io",
            "x-forwarded-proto": "https"
        },
        "method": "HEAD",
        "httpVersion": "1.1",
        "originalUrl": "/api/v1/assets/13702",
        "query": {}
    }
}
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    at new NodeError (internal/errors.js:322:7)
    at ServerResponse.setHeader (_http_outgoing.js:561:11)
    at PublicApiController.assetHead (/joystream/distributor-node/src/services/httpApi/controllers/public.ts:224:9)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async /joystream/distributor-node/src/services/httpApi/HttpApiBase.ts:30:9

Metadata

Metadata

Assignees

No one assigned

    Labels

    argusArgus distributor nodebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions