Skip to content

Crash when using php-fpm fcgi api without HTTP server #494

Closed
@timfennis

Description

@timfennis

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which SDK and version?

sentry/sdk 3.1.0
sentry/sentry 3.2.1
sentry/sentry-symfony 4.1.0

Steps to Reproduce

We have a healthcheck script that monitors the status of php-fpm like so:

REQUEST_METHOD=GET REQUEST_URI=/_health SCRIPT_FILENAME=index.php cgi-fcgi -bind -connect 127.0.0.1:9000

In this case the call to $request->getProtocolVersion() returns null which results in an error in TracingRequestListener::getHttpFlavor

Error:

str_starts_with(): Argument #1 ($haystack) must be of type string, null given

Expected Result

Eventhough this is a weird edge case that probably won't occur often maybe fall back to some empty value?

Actual Result

I get an error (in sentry though 👍)

Error:

str_starts_with(): Argument #1 ($haystack) must be of type string, null given

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions