Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buggregator server doesn't catch var-dumps in specific cases #60

Closed
roxblnfk opened this issue Jul 6, 2023 · 9 comments · Fixed by #101
Closed

Buggregator server doesn't catch var-dumps in specific cases #60

roxblnfk opened this issue Jul 6, 2023 · 9 comments · Fixed by #101
Assignees
Labels

Comments

@roxblnfk
Copy link
Member

roxblnfk commented Jul 6, 2023

Buggregator server doesn't catch var-dumps in specific cases

For example, I installed temporal/samples-php project and
modified \Temporal\WorkerFactory (vendor package) like this:

    public function run(HostConnectionInterface $host = null): int
    {
        $host ??= RoadRunner::create();
        $this->codec = $this->createCodec();

        while ($msg = $host->waitBatch()) {
            try {
                \dump($msg->messages, $msg->context);
                $response = $this->dispatch($msg->messages, $msg->context);
                \dump($response); // line 263
                $host->send($response);
            } catch (\Throwable $e) {
                $host->error($e);
            }
        }

        return 0;
    }

After rr serve Buggregator Server doesn't catch responses. But buggregator/trap does.
{2A755B17-C290-41ED-ABAF-217CD3DD693B}

Need to research the problem.

@butschster butschster self-assigned this Aug 7, 2023
@FluffyDiscord
Copy link
Contributor

FluffyDiscord commented Sep 6, 2023

By the payload size, it may be because it's reaching the default nginx proxy limit of 1MB which should be fixed with next release #66 already released https://github.com/buggregator/server/releases/tag/1.0-rc9

@roxblnfk
Copy link
Member Author

roxblnfk commented Sep 6, 2023

I'll check it. Thanks.

@roxblnfk
Copy link
Member Author

roxblnfk commented Sep 6, 2023

Now I have error messages like this:

2023-09-06T13:41:32.481Z        ERROR   app             TypeError: Spiral\RoadRunnerBridge\Centrifugo\Broadcast::publish(): Argument #2 ($messages) must be of type iterable|string, bool given, called in /app/app/src/Application/Broadcasting/BroadcastEventInterceptor.php on line 28 in /app/vendor/spiral/roadrunner-bridge/src/Centrifugo/Broadcast.php at line 17 [] []

And missed messages.

The content is quite short (847 bytes).
image

@FluffyDiscord
Copy link
Contributor

@butschster
Copy link
Member

Probably the problem is with payload, as I see it contains binary data, so when buggregator app tries to broadcast data

$this->broadcast->publish(
    $event->getBroadcastTopics(),
    \json_encode([
        'event' => $event->getEventName(),
        'data' =>  $event->jsonSerialize(),
    ])
);

it endodes data into json and as I think, json_encode returns false when it tries to encode binary data

@FluffyDiscord
Copy link
Contributor

Just run into this issue. Any way for Buggregator to handle this correctly? VarDump shows the string binary correctly, adding the b indicator, just Buggregator seems to not be able to handle it.

@roxblnfk
Copy link
Member Author

Could you share your dumped binary data?

@FluffyDiscord
Copy link
Contributor

Can't, it was a confidential ~10MB of PDF.

@roxblnfk
Copy link
Member Author

Got it. I've reproduced it using Buggregator logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants